So I have been trying to get a query that shows data that is within a coastline like |
It is not possible to find out whether a coordinate is on land through the Overpass API, or any other OSM driven web service that I know of. The main reason for that is that land/water areas are not kept in OSM as polygons. The perfect solution for your problem would be to load the OSM coastline polygons from www.openstreetmapdata.com into a spatial database and make a query to that database. A less-than-perfect solution would be computing which tile your coordinate is on, loading that tile from an existing tile server, and checking whether the corresponding pixel is blue. For the tiles@home project, we used to keep an "index PNG file" of, I believe, 4096x4096 pixels for the whole world (corresponding to one pixel per zoom level 12 tile) that would say whether a certain tile is fully water, fully land, or had coastline in it. Such a PNG file is relatively small and easy to query so maybe if your precision requirements aren't high, you could revive that old technology. Thanks for your response, looks like i'm just going to setup a postgis that returns true or false if lat long is over land from a shape file. Thanks for pointing me in the right direction.
(20 Oct '13, 23:53)
JacobKukuk
|
To add this this if you are making a postgis query you can use this query with http://openstreetmapdata.com/data/land-polygons. This will return true or false. Also Make point is somewhat backwards, instead of lat long its long lat... ST_MakePoint(Long, Lat)
|