How To GeoCode Multiple Addresses At Once


  • Is there a way to plot multiple addresses? I have a list of addresses I'd like to add pushpins for. I've used the Find Method but it's one address at a time.
    DJ Baby Anne's Biggest Fan................
    Friday, June 04, 2010 9:12 PM


All replies

  • Read #6 in the best practices post at the top of the forum: http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/e275f3ee-f83e-4b92-980a-6d18b20acb9a
    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Friday, June 04, 2010 9:44 PM
  • Thanks for the quick response. That page was very helpful. It also confirmed my worst fears - I'd have to do a find call row by row. Are there plans to be able to send a dataset or an array as a opposed to individual calls in future versions of this API? I'm anticipating plotting 1000's of addresses.
    DJ Baby Anne's Biggest Fan................
    Friday, June 04, 2010 10:04 PM
  • Abercrombie07.  Use RIA services to map your addresses to a datagrid.  Then you can loop through the records and call the service; but keep in mind the trick is to do it async.  Also keep in mind the confidence level (it's in the response of each result).  I found a cluster of addresses EUROPE (they were US addresses!).

    1) Find Tim Huer's RIA services / HR Application (Note: SL4 is a bit different, but if you're using SL3, you're golden.)

    2)  Drop a grid in that uses RIA services to connect to your data.  (Tim's video show exactly how to do this too.)

    3) Drop a map in.

    4) Spin through the grid and geocode.  Put a pin on the map.

    5) Watch for "wacked out" addresses.  Sometimes addresses aren't exactly correct.  You will have to have a way to jump over the rows and reprocess.  (also queue the bad ones so you can reprocess the list)

    6) Watching the pins populate is more fun than a bug zapper. :-)

    7) Have fun!

    Saturday, June 05, 2010 5:58 AM
  • If you have 1000's of addresses then you shouldn't be geocoding on the client side. You should either upload your data tot he customer service site and have all the addresses geocoded and then either access the data from there or use a database.  If you use a database you could setup a trigger that geocodes an address when it gets added to a table and use the Bing Maps Geocoding Web service.
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com
    Saturday, June 05, 2010 10:31 AM
  • I am using a database to store the data and as a DBA I see your point about using the triggers. The part I'm lost on is how to display the results on the map since the addresses are stored and aggregated at different times an ways. The goal I'm looking for is to be able to click a button and displays what could be hundreds or  1000's of randomly grouped addresses on a map. My experience in the geocode arena limited so I'm weighing my options. I have successfully created my user control with an address gridview that has a button that will show the map for the address in that row. Now I'm want to take my datatable (array, list or collection) and display a map in one shot. Tanoshim and Landando are confirming my worst fears about looping thru the grid (Ouch) but I'm still exploring options. Even if I stored the results as spatial data in SQL, there's a point where I'd have to be able to plot the result set on the map. That resultset would be in the 1000's so I'm looking for a high performance way to do that and am still parsing ideas. I'll say thanks to the ideas so far and to Tanosimi for the best practices list. It was a great just in general approach because it made me aware of some things.

    DJ Baby Anne's Biggest Fan................
    Saturday, June 05, 2010 10:58 AM
  • I think you've got two separate issues here - one of which is how to geocode 1000s of addresses, and the second is how to display those 1000s of addresses on the map.

    What Richard is suggesting (and I agree with!) is that the first of those issues needn't be done at render time - you can geocode the addresses in batch and store the resulting latitude/longitude values to the database, and add a trigger so that newly inserted records are automatically geocoded as they added to the DB.

    The second issue, about how to display 1000s of points at the same time comes down to one of rendering performance, and has been discussed on the forum lots of times - the solution normally involves either using a clustering algorithm, or consider using raster tilesets rather than trying to plot 1000s of vector points.

    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Saturday, June 05, 2010 11:35 AM
  • You're absolutely right Tanoshimi. I'm wrestling with the display part of the issue. I can geocode prior to loading via the trigger (or scheduled job if the activity is high enough). Raster Tilesets?... Time to Google.. Any heads up or links I can use? I'm totally green in that department.
    DJ Baby Anne's Biggest Fan................
    Saturday, June 05, 2010 1:02 PM
  • Thought this link on the Bing site was right up my alley and might help others:



    If you look in the Spatial API section, it's right up my alley... send a batch of addresses to a service and let 'em geocode for you! I haven't worked out all the details yet like that pesky BingAPIkey and whether or not you have to pay for commerical use of this function (I know, I know........ no free lunch).

    DJ Baby Anne's Biggest Fan................
    • Marked as answer by Abercrombie07 Tuesday, June 08, 2010 8:06 PM
    Tuesday, June 08, 2010 8:06 PM
  • That just got released yesterday. It may help your situation, however if the addresses are pretty consistent and your app is used by lots of people you would still be better office geocoding once and storing the coordinates. Not only would it be faster but you would use less transactions.
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com
    Tuesday, June 08, 2010 8:32 PM