Member-only story
Geocoding Locations with Turf Mapbox SDK
Implement common Turf functionalities in Java. Use-case + Full Source Code.
Most Geographic Information System (GIS) practitioners who are familiar with Geospatial web applications have encountered the JavaScript utility known as TurfJS, an open-sourced Geospatial Analysis tool. While Turf is known for its versatility and wide array of Geospatial functionalities, 1 of its common use-cases often involves geocoding specific location coordinates within custom boundaries— i.e. Tagging the specific area/region/zone to a target location.
For more in-depth details, please refer to the article below:
To illustrate this functionality, take the country Singapore as an example where the island is divided into 5 separate regions — Central, North, North-East, East & West.

In order to tag the correct region which the ❝National Dental Centre (NDC)❞ building resides in, two particular spatial data inputs would be required:
Input (1) The Geometric Polygon/Multi-Polygon features of the 5 regions (assigned as a GeoJSON object in the demo HTML code — boundaries
)
Input (2) The building coordinates of the target location — National Dental Centre (assigned as a GeoJSON object in the demo HTML code— targetLocations
)
Note: The full HTML code implementation can be found here
Output is as follows:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"BLK_NO": "5",
"BUILDING": "NATIONAL DENTAL CENTRE",
"ROAD_NAME": "SECOND HOSPITAL AVENUE",
"POSTAL": "168938",
"REGION_N": "CENTRAL REGION",
"REGION_C": "CR"…