Select to view content in your preferred language

Geocoding multiple addresses

3268
3
04-15-2013 11:14 AM
AlexSarracino
Emerging Contributor
Hello,

I am new to using the ESRI JavaScript API. I am currently trying to develop an application but I am having troubles with it.

The application I am developing uses a .csv file with a bunch of locations. The fields for each location are the address, zipcode, county, city, and state. It then geocodes each location and returns another .csv file with all the the address, zipcode, county, city, state, latitude, and longitude. The .csv file usually has over 10,000 addresses.

Using a .csv file to geocode the addresses isn't the important part, I could convert the .csv file into something else if necessary, what I am having trouble with is with the geocoding.

I looked at the samples online and the tutorials but did not find any that would geocode multiple addresses and that would return a file instead of just placing a mark on the map.

Could anyone please give me an idea of how this could be accomplished using the API? Tutorials/Samples would be extremely helpful.
3 Replies
JohnGravois
Deactivated User
our locatorTask includes an addressesToLocations() method which would allow you to batch geocode against ArcGIS Server 10.1, but geocoding services return a collection of JSON features which are typically handled as graphics in memory in JavaScript applications.

if you want to take CSV and write out a flat file (like shapefile) instead, you'd be better off publishing your own geoprocessing service which calls a model which does the geocoding and writes an output file which can be downloaded from within your application.

we don't have any examples of that exact workflow, but you might want to check out this sample to see how geoprocessing services are called and how flat files can be made accessible.
0 Kudos
AlexSarracino
Emerging Contributor
Thank you! I think my best option will probably be publishing my own geoprocessing service, but is it possible to get individual address information from the JSON to construct a new table in JavaScript?
0 Kudos
JohnGravois
Deactivated User
not identical, but check out this sample to see how attributes from the JSON featureset returned by the FindTask are written to a dojo table for an example in action.
0 Kudos