Arcgis Online Geocoding service

4308
16
09-03-2015 12:49 AM
MaheshReddy
New Contributor

Hi All,

I am looking for an online web service to get Lat, Long values for the addresses using Arcgis Online Geocoding service. Please let me know if there is any dll or online web service to get the results using .Net Framework 4.0 and Visual Studio 2010.

Thank you,

Mahesh

0 Kudos
16 Replies
MaheshReddy
New Contributor

Thanks for the information. We are in the process of upgrading the framework.

0 Kudos
DEWright_CA
Occasional Contributor III

Ok, so you want the Lat/Long for the addresses you geocode? These attributes are exposed by either the REST or SOAP interfaces.

Or are you just wanting to Reverse Geocode the locations against that ArcGIS Online locator?

0 Kudos
MaheshReddy
New Contributor

I want the Lat/Long for the addresses provided. I tried with the REST service and able to get the Lat/Long, but when countryCode alone is passed, I could not get the correct results.

Thad Tilton provided me code snippet, but I am looking for REST/SOAP url to get the correct results when only countryCode  is passed.

Please check below:

I am using following url to get lat, long:http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?Address=Sta...Pagar&Subregion=&Region=&CountryCode=SGP&outFields=Addr_type&maxLocations=1&forStorage=false&f=pjson and able to get the results, when Address is provided along with Country.

But for some addresses, require Lat, Long for Country only. However, when I just input country code, the result is not correct. For eg.,

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?Address=&Ne....

Thank you.

0 Kudos
DEWright_CA
Occasional Contributor III

Using only a country code does not meet the needed minimums for a full reverse-geocode for all locations. The more information you include the more precise a result you get. When you pass in only a country code, you will get the center of mass for the polygon for that country.

0 Kudos
MaheshReddy
New Contributor

We pass as much information as we have to get the lat/long for the addresses. For some addresses, we have only CountryCode without any other information. We should be able to get Lat/Long from the countryCode provided.

Is there a way we can get lat/long from location or extent below:

"candidates": [

  {

   "address": "Sgp",

   "location": {

    "x": -40.309738060999621,

    "y": -20.310026429999596

   },

   "score": 100,

   "attributes": {

    "Addr_type": "POI"

   },

   "extent": {

    "xmin": -40.314739000000003,

    "ymin": -20.315027000000001,

    "xmax": -40.304738999999998,

    "ymax": -20.305026999999999

   }

  }

]

0 Kudos
dotMorten_esri
Esri Notable Contributor

When you only have very little information, geocoding gets more inaccurate. If you increase the maxLocations value to return a few more than one result, it seems to me the second result is the correct one (also achieves a score of 100):

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?CountryCode...

Blindly geocoding to the first result without human verification can be a little dangerous. Often it's better to ask for a few locations, and present the user with multiple options during the geocoding process - especially if you get more than one result with a confidence score close to a 100.

0 Kudos
DEWright_CA
Occasional Contributor III

To me; its looks like you need to put in your code minimum requirements to process so you don't spend time trying to massage data that is already going to be highly inaccurate it not problematic.

At the least a street address and jurisdiction name, or a address and postal-code; as you look at the various numbers of fields you can use then you can adjust according.

0 Kudos