Select to view content in your preferred language

World locator can't find country anymore

871
3
09-11-2012 01:17 AM
JorisBoffard
Emerging Contributor
Hi everyone,

I'm using ArcGIS API for Flex + World Locator (http://tasks.arcgis.com/ArcGIS/rest/services/WorldLocator/GeocodeServer) to improve a web application that requires reverse geocoding.

Everything worked fine, I was able to get every data I needed (country, city, latitude, longitude, etc...) all over the world when the user clicked on the map.

I spent a couple of months working on something else, and when I went back to the application to complete development, I noticed the locator did not work anymore.

The reason is : the country is not recognized anymore.

The data I got was : latitude, longitude, country, city, county, state and postal code. Now, I only get latitude, longitude, city and postal code. County, state and country are not known anymore.

I made a major update to my application before noticing that, but I don't think it's related since the "reverse geocoding widget" was not modified.

For example, the only data I get when clicking on the point that have 41° lat and 14° long is :
City = "Villa Literno"
Postal Code = "81039"
Street = "Ss7bis Diramazione"

But nothing informs me that this is located in Italia, I don't have the (Country = "ITA") information that I had before.

Anyone can help ? Thanks a lot !

(NB : Sorry for my english as it's not my native language)
Tags (2)
0 Kudos
3 Replies
MikeMinami
Esri Notable Contributor
Yes, the service has changed.

Use this endpoint instead. Here's an example that will return the country.

http://geocode.arcgis.com/ArcGIS/rest/services/World/GeocodeServer/findAddressCandidates?SingleLine=...

For the output fields, look here.

http://geocode.arcgis.com/arcgis/geocoding.html#output

Thanks,

Mike
0 Kudos
MikeMinami
Esri Notable Contributor
Oops, you are doing reverse geocoding... the best thing to do is look for the Loc_name and extract the first three characters.

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-117%2C+3...

Thanks,

Mike
0 Kudos
JorisBoffard
Emerging Contributor
Oops, you are doing reverse geocoding... the best thing to do is look for the Loc_name and extract the first three characters.

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-117%2C+3...
Mike


Thank you very much, that works !

But I still have a problem... In big french cities, I don't have the name of the city. For example :
http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=+4.85%2C+...

Nothing indicates that the city is Lyon. Same thing for Paris. It does work, however, in other European countries (I tried Italy, England, Spain, Germany and Netherlands). Another little thing, for Paris, I noticed that the postal code is in "Admin1" whereas the "arrondissement" is in "PostalCode", whereas for Lyon, it's the opposite (postal code is in "PostalCode" and arrondissement is in "Admin1").

Thank you very much anyway, the most important was to get information on the country. But it would be great if I could have information on the city, too.
0 Kudos