ST_ReverseGeocode
Does Vertica geospatial toolkit contain the ST_ReverseGeocode function which reverses geolocation to readable Addresses ?
Tagged:
0
Does Vertica geospatial toolkit contain the ST_ReverseGeocode function which reverses geolocation to readable Addresses ?
Answers
Not at the current version.
Please open a support case to explain the business need to prioritize this.
Thank you Mosheg, basically we need to reverse geocode a location , feeding the function the lat/long and getting the address in human readable format
example:
SELECT ST_Reverse(ST_Point(-122.0856086, 37.4224082)) AS address;
An issue is that Vertica needs a third-party provider for address lookup. You could write a Python UDSF that takes a Point or (x,y) coordinate as input and calls the OpenStreetMap API to get an address, which you would then return as a VARCHAR (or ROW if you'd like the address components):
https://wiki.openstreetmap.org/wiki/Nominatim
ArcGIS and others also provide reverse geocoding API that could be accessed by a UDX.
I've posted a Python UDSF example using GeoPy and Nominatim at
https://github.com/bryanherger/vertica-python-udx
Please see the instructions and example under "UDSF example: reverseGeocode" in the README and sample implementation in the reversegeocode folder. It has not been tested at scale beyond the one-time example shown.
Thank you for your time, this is very helpful