spacer1
spacer2 1_1 1_2
2_1
 Subscribe
 The MP2K Update!
 
 
 
 Magazine
Front Cover
What's New
Articles
Toolbar
News
Sample Data
Gallery
Advertise
About
 Features
MapPoint 2009
Press Releases
MapPoint Forums
Companies
Link to MP2Kmag
Wish List
MapPoint Trial
Authors
 Sponsors
 Order

MapPoint 2009

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
ViaVirtualEarth
SVG Tutorials
MapPoint

Map Visitors

 Direct Media

Travel Insurance Compare over 450 travel insurance policies (inc. annual multi-trip, single trip & winter sports)

Remote support
For a fixed monthly fee, our customers have unlimited access to our expert remote IT support as well as our on-site support service.

printer ink
Printer ink for sale. Epson, HP, Lexmark, Dell, Canon, Brother, Minolta… The list goes on. We have a massive range at a great price.

Cheap flights to Athens
Book cheap flights to Athens on Holiday Hypermarket and you can book some great value accommodation too! Check it out online.

Greece Holidays
Greece is rich in modern and ancient history making for a fantastic holiday destination. On The Beach holidays specialise in cheap holidays.

Bulgaria Property...
These people promise their clients exactly what they want from their Bulgaria property.

Egypt Deals
Visit a country with incredible history and amazing culture. Let us compare Egypt deals for you. Book great value holiday to Egypt through dealchecker.co.uk.

Cheap Spain Holidays
Stay well informed when you are searching for cheap holidays online. For useful advice on when to book cheap Spain holidays make sure you look on ulookubook.com

  ARTICLES  


Reverse Geocoding, Pt. III

Walt Cygan, a frequent contributor of late, submits this solution for tackling reverse geocoding

My code to do reverse geocoding was intended to answer the need to able to find an address near a location virtually all of the time. Compared with Gilles Kohl's approach in http://www.mp2kmag.com/articles.asp?ArticleID=47, mine is more brute force in nature. I use the ObjectsFromPoint method repeatedly at slightly different locations to attempt to find an address.

In the code I use data on a SQL Server 2000 database where I have lat and lon stored. The steps I go through to get the address are:

  1. Use the GetLocation method with the database lat and lon.
  2. Check the Location object from step 1 with the ObjectsFromPoint method to see if the best match has a street address. If so, I'm done. If not, move on.
  3. Round the database lat/lon to 4 digits after the decimal and get use those coordinates with GetLocation
  4. Check the Location object from step 3 with the ObjectsFromPoint method to see if the best match has a street address. If so, I'm done. If not, move on.

Now is where the fun starts: I start working outward in squares (spherical rectangles really) each 1-ten thousandth of point of latitude and longitude larger that the one before. The center point is the location found after rounding to 4 digits. The first square has 8 points, the next has 16, then 24, 32, etc. I have the code set to do 10 squares before giving up, giving a total of 442 attempts, including the one with the original latitude and longitude. The idea here was to find the nearest possible address without ever testing the same point twice.

For each point the same process as in steps 1-4 is followed: GetLocation followed by ObjectsFromPoint.

I tested this code on 22 locations in and around Minneapolis and St. Paul, Minnesota. Most of these points had been moved slightly to more accurately place their pushpin on the map before getting their latitudes and longitudes that were stored on the database. Addresses were found for all 22 locations in just over a minute using the ActiveX control in a VB app. The majority of this time was used to find 2 of the addresses, 1 in a more rural area, 1 next to a golf course (therefore fewer available nearby streets and addresses). 10 addresses were found on the first attempt; 18 were found in 7 or fewer attempts; the rest in 18, 39, 112 and 403 attempts. When run only with the 18 addresses that were found in fewer than 10 attempts, the process ran in about 10 seconds.

The code is as follows (Note to folks who saw a preview of this: I made a small change adding "Exit For" statements for each inner loop for the sides of the "squares"):

Discuss this story in the forum.

Author: Walt Cygan
Email: wcygan(AT)macrogroup.net
URL: http://www.macrogroup.net
Walt is a consultant for The MACRO GROUP, Inc. in Minneapolis, Minnesota. The MACRO GROUP, Inc. is an information systems consulting firm whose customers include public, private and non-profit organizations of all sizes.



Google
 
MP2Kmag Internet


 Recent Discussion
-http://fireero.ru the best ero video free
-Sell New Apple Iphone 3G 16gb Unlocked ====== 300usd
-Forsale brand new Apple Iphone 32gb 3G----£180/Sony Ericsson XPERIA X1-----£160
-mappoint service
-Opening MSST files in MapPoint
-Zipcode Boundaries
-Microsoft Virtual Earth for Texas Emergency Management Support
-Windows Live Search Map
-460 millions de km² couverts en images satellites
-W2K vs XP with MP2004
-open Map "read only" ?
-PushPin:Note
-how to get Zipcode from the Latitude/longitude
-Get the address from the coordinates
-Edushi City Maps
-How to Remove Empty Toolbar?
-File > Import....etc....
-Cropping Tool in 2009?
-I'm brand new - confused on setting up territories with different criteria.
-Virtual Earth & DigitalGlobe - Worldwide Imagery Improvement
-Microsoft Virtual Earth to Include DigitalGlobe Satellite Imagery
-Partenariat DigitalGlobe - Microsoft Virtual Earth
-Mapping both Reps and Sales
-Create an invisible panel on top of mappoint activeX control
-WorldWide Telescope Stars in Virtual Earth
 Resources
Browse GIS books and periodicals
Best Car Contract Hire Lease Save
Find a MapPoint Partner or Consultant
Real Estate Columbia, MO


Want Your Site To Appear Here?

   © 1999-2008 MP2K. Questions and comments to: website@mp2kmag.com
  Microsoft and MapPoint 2002/2004/2006/2009 are either trademarks or registered trademarks of Microsoft.

• Replacement Cordless Phone Batteries from DSMiller
Improve your career with a computer degree LocalEDU.com
• Tim Cohn's Marketing Strategy Consultancy
• Buy Toner, Ink Cartridges & Drums at Marquee Office Solutions
• Looking for Dry Erase Boards? See Dry Erase Boards • The Search Starts Here Used Cars
• 5339 - We Know Bikes: Road Bikes / Triathlon Bikes / Mountain Bikes / BMX Bikes
• Buy Your Car Used Cars, Car Lease and Contract Hire