Sunday, December 28, 2014
GIS for Digital Maps
You can get a great overview of the range of Turf's geospatial processing capabilities on the Turf examples page. Using the library with Leaflet and Mapbox is very easy. It took me less than 15 minutes to set-up this map of central London police stations. I grabbed the GeoJSON data for the stations using Overpass Turbo and then simply used the html for the turf-nearest example in the Turf documentation.
The map shows the nearest London police station to a certain point. The queried location is pre-determined in this map but it should be a simple task to make the marker of the queried location draggable. Turf can process the geospatial query in the browser so it should be simple to allow users to query the map to find the nearest police station to any location.