Retrieval of Location

When I tried to retreive address using revgeocode for the location(1.379012,103.921313) , the api returns with no such location , where as If I enter the same location in the map of onemap.sg its shows the particular location in on the map . Why it is so?

Hi Jenna

Good question. OneMap.sg is using the buffer parameter in the API https://docs.onemap.sg/#reverse-geocode-wgs84. Like a compass, it will round up all buildings in a circumference from a point, and search building addresses within the buffer/radius range.
You can try setting a buffer to get a result for your “no such location” scenarios.

Hope it helps!

Thanks Junhong for your help

Also Junhong , Currently I’m using the API “https://developers.onemap.sg/commonapi/search?searchVal=” to retrieve the Latitude and Longitude . ( The search Val which I provide is the Postal Code). So , is their any buffering facility available , so that if a particular postal code is not present , it may buffer to the next nearest Postal code . for e.g. Our customer entered the Postal Code 739083 ( 20 Riverside ). As Per one map such location doesn’t exist. In such case would the API return the Latitude and Longitude of the next nearest Postal Code.

Hi Jeena

Currently we do not have the buffer parameter in our search API. We will note down your request and discuss within our team. Postal code 739083 has already defunct from use, thus the search API does not return with any response. Meanwhile, I think what you can do on your side is to call the search API when your customer enter “73908” before it enter “739083”, then you have some results.

Hi Junhong,

Thanks for your prompt response . Since the Postal code 739083 was functional at a point of time and is defunct from use , Can the API return with their new Postal Code. The problem we are facing right now is :
we have to create an optimized route for our driver automatically with the Postal codes the customers enter , So if the API return , “No Location”, then the algorithm fails

Hi Jeena

Unfortunately, our API is not able to return with the new postal code for 739083 as we only maintain accurate and current data set. I think it is right that your customer gets a “No Location” as the postal code is invalid. If you type in this postal code in google, it will point to an empty piece of land which is not correct.

Hi Junhong

Thank you for all the information and help you had been providing us with . Really appreciate it.

1 Like