Reverse GEOCODE from custom Lat Long

Hi, I know is possible to do reverse geocode by querying the location sensor for current address, but I would like it to do it with custom Lat and Long not just those “sensed” is it possible?
shouldn’t the reverse geocode be a functionality of the Map Component instead of the sensor location?
to my it would make much more sense to have to just feed any lat long to the map container and have it spiting out the address.
Thank for any help.

You can obtain a street address directly from the LocationSensor (CurrentAddress) where this is based on your device’s present latitude and longitude. You cannot obtain address information from an arbitrary latitude / longitude pair with Blocks. The LocationSensor can provide a CurrentAddress from the user’s actual location .

To reverse geocode (what you want to do) to determine the address of an arbitrary latitude and longitude pair, do some advanced coding using javascript using Google’s Maps Javascript API . Get an API Key from Google. This service is not free., The technique uses Google’s database to provide the address.

Alternatively, there are web pages that can convert a latitude/longitude into an address. You might be able to use the Web component to capture the information this way. I don’t know if it is possible (never tried). Here are several: ONLINECONVERTERS

What you do to get an address depends on the source of your latitude and longitude information. It is very easy to get a latitude and longitude from an address (use the LatitudeFromAddress and LongitudeFromAddress blocks of the LocationSensor)

The geocoding is possible by using LocationSensor coordinates with the CurrentAddress block if you only use Blocks.

The LocationSensor provides reverse geocoding using Google’s database for free when used with a GPS receiver’s provided coordinates. Google provides that service outside of the LocationSensor when you obtain a Map developer license and use Google’s Map api.

MIT’s Map component, which uses OSM tiles) does not have a reverse geocoding option, Developers of OSM does have a reverse geocoder called Nomination. It is no where near as specific as Google’s database. In other words, the geocoding is not very precise to the point of almost being useless. In fairness, the Nomination database is provided by volunteers.



1 Like

Thanks Steve! I have really appreciated your answer, I have decided to pay google for the api usage and go with that solution of implementing the api call with web component and parsng the resulting json.
Thanks again!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.