I have 5 point datasets that I want to display and be able to filter by fields. I will then be able to hand draw a polygon and export Excel of the data from each dataset within the polygon.

Which web map API should I use? I was looking at mapbox/turf and geojson, but this seems limited.

  • Mapbox is built on Leaflet, which I suspect can easily handle what you describe (though saving to Excel from a Javascript application will be a bit of a hack, it is doable). Your question is a bit on the broad side for this format, though, and could you clarify what you mean by limited? – John Powell Feb 18 '15 at 7:50
  • I was reading about the Turf library for Mapbox and I didn't see a function that would be used for spatial data selection, but maybe I am wrong. I am really hoping there is a webmap out there that demonstrates what I am aiming to do. – mapmedia Feb 18 '15 at 8:19
  • Have a look at the examples in Leaflet or OpenLayers, drawing a polygon and outputting to csv, json, etc. – John Powell Feb 18 '15 at 8:28

For drawing the polygons, use Leaflet Draw.

Also, check out the turf.within function. It takes a set of points and a set of polygons and returns the points that fall within the polygons.

For the excel piece, there are several ways to hack this. The easiest would probably be to setup a simple server endpoint that runs ogr2ogr on your geojson and outputs a csv or xls. Another quick alternative would be to parse out the csv in memory, then post the string to a github gist.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.