osm-search / Nominatim

Open Source search based on OpenStreetMap data
https://nominatim.org
GNU General Public License v3.0
3.17k stars 714 forks source link

Reverse Geocoding in international waters #510

Open ThinkingGuy opened 8 years ago

ThinkingGuy commented 8 years ago

I'm experimenting with Nominatim for use with vehicle tracking, in particular, ships or aircraft in remote locations. I would expect that a reverse lookup of a position such as "S 6, W 128" with a low rank/zoom value ("Continent/Sea") would return just "Pacific Ocean." In my testing, however, this doesn't seem to be the case. Is there something in the API I'm missing? A tweak in the code I could make? Or could I implement something like this more easily by querying the database directly (I'm more comfortable with SQL than with PHP)?

mtmail commented 8 years ago

Nominatim tries to assign each named feature a country (also used for sharding/optimizations). There is the concept of not belonging to a country, but that applies to small features only, e.g. a buoy or maybe an oil platform (funny, I never checked if we find those).

OpenStreetMap itself doesn't have a type sea or ocean, so there is nothing in the Nominatim database you could query.

Oceans need to be processed as the negative of all existing coastlines (https://wiki.openstreetmap.org/wiki/Tag:natural%3Dcoastline) and Christoph Hormann has done that here http://openstreetmapdata.com/data/water-polygons That's a medium size project and likely easier to query outside of Nominatim.

It still doesn't give the ocean parts a name (where does the Pazific start and end?)

lonvia commented 8 years ago

There would be some merit to include oceans as country-like features. Currently reverse queries of points in the ocean are very expensive because they search for features over a very large radius. It would help if these bad points can be filtered earlier.

That said, Nominatim certainly isn't the right tool for tracking of ships or aircraft. It contains too much detail on land and too little at sea for that purpose.

lonvia commented 6 years ago

1054 fixes the performance issue when searching in oceans. It also restricts reverse results to areas within countries, thus completely excluding international waters. It is in principle possible to deliver a coarse-grained result regarding the ocean but this is something very, very low on the priority list. So leaving this open for somebody else to tackle.