Select to view content in your preferred language

Batch Geocoder Widget for Flexviewer 2.x

851
12
01-07-2011 11:10 AM
ReneRubalcava
Frequent Contributor II
We recently had a need to build a Batch Geocoder tool that we could use to verify some addresses against our internal GeocodeServer service. This started as an AIR application I built in my spare time, but decided to modify it to work with Flexviewer. It's a tool we might use in our internal Flexviewer app, and I thought others might find a use for it.

It will let you upload a dbf file of addresses, geocode them, give you the closest address found and the score, then export those results to an Excel file.

http://www.arcgis.com/home/item.html?id=c663df2846d04a6b9add92b66c637728
Tags (2)
0 Kudos
12 Replies
ReneRubalcava
Frequent Contributor II
This widget has been updated to that you can now edit your results and attempt to rematch the addresses to get a better score.
0 Kudos
deleted-user-RjoC4IOGTpoH
New Contributor
Good Morning Rene,

I have installed the uncompiled version using my own geocoder. Compiles fine with no errors.
When I geocode a dbf files of addresses that are known to be correct, I get no results or errors.

The fields in the dbf file show up and I select the Address field but nothing happens. I am only using the Address field and not City, State or Zip.

I can take the same addresses in the file and locate them using the Find Address widget which is using the same geocoder.

Any suggestions?

Thanks !!

Nestor.
0 Kudos
ReneRubalcava
Frequent Contributor II
I'll check over source when I get home. This could be left over from a limitation I had in my code where our internal locator required a city or zip. I'll see if I can fix that.

Thanks for pointing it out.
0 Kudos
deleted-user-RjoC4IOGTpoH
New Contributor
I'll check over source when I get home. This could be left over from a limitation I had in my code where our internal locator required a city or zip. I'll see if I can fix that.

Thanks for pointing it out.


I appreciate it Rene.

Since we are geocoding within our city only, there is no need for us to use City, State or Zip.
The widget will help greatly.

Thanks !!

Nestor.
0 Kudos
ReneRubalcava
Frequent Contributor II
I checked the source and I don't block geocoding if there is no city/zip, but depending on the Locator service you are using, you may have to change this in the source code.

widgets.BatchGeocoder.helpers
/**
 * Will parse the item passed to this class and prepare it for
 * use with ArcGIS Server geocoder.
 * @param item
 * @return 
 */
protected function buildAddressObject(item:Object):Object
{
 var address:String = "";
 var city:String = "";
 var state:String = "";
 var zip:String = "";
 var country:String = "USA";
 
 if (_addressField.length > 0)
  address = item[_addressField];
 if (_cityField.length > 0)
  city = item[_cityField];
 if (_stateField.length > 0)
  _stateField = item[_stateField];
 if (_zipField.length > 0)
  zip = item[_zipField];
 if (_countryField.length > 0)
  country = item[_countryField];
 
 // You may need to modify these fields to work with your
 // particular locator service
 return {
   Address:address,
   City:city,
   State:state,
   Zip:zip,
   Country:country
  };
}


That is the address object that gets created when you map the fields from your dbf. You may need to change Address to Street. You may even be able to eliminate all fields except for address in your case.

I test against this geocodeserver.
http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA/GeocodeServer
0 Kudos
deleted-user-RjoC4IOGTpoH
New Contributor
Good Morning Rene,

The change from Address to Street worked. I'm using a composite locator which I will add the Address field to map as well. Thanks.

Now it gets strange. First, the results come up but the background of the box turns white and the text does as well. I can mouse over the text and see it.

Next, the results take me to some extreme northing and easting outside my geographic boundary and no points are plotted. My locators are using projected coordinates instead of geographic although I am not having any issues with other addressing widgets.

Your thoughts?

Nestor.
0 Kudos
ReneRubalcava
Frequent Contributor II
I'll look over the code, but there is a section when I initialize the locator, that I set the output Spatial Reference to geographic. I've been meaning to add that as an xml option.
0 Kudos
ReneRubalcava
Frequent Contributor II
Sorry for the delay.
I've updated the source code this morning.
http://www.arcgis.com/home/item.html?id=c663df2846d04a6b9add92b66c637728

You can now define the output Spatial Reference wkid for your Locator service so that it will match your map services.

I tested it briefly without issue, but if anything does not work please let me know.
Thanks.
0 Kudos
deleted-user-RjoC4IOGTpoH
New Contributor
Sorry for the delay.
I've updated the source code this morning.
http://www.arcgis.com/home/item.html?id=c663df2846d04a6b9add92b66c637728

You can now define the output Spatial Reference wkid for your Locator service so that it will match your map services.

I tested it briefly without issue, but if anything does not work please let me know.
Thanks.


Good Morning Rene,

Still no luck. Definately an issue with the projection. If I use the ESRI geocoder, it stays within the correct geographic location although I don't see any points mapped. All the addresses geocode correctly though.

Don't spend any more time on this for now. I am going to create new locators and services and go from there. I will let you know.

Thanks !!

Nestor.
0 Kudos