[Geocoding] How Nominatim works and where are seas?
Peter Johnson
peter.johnson at mapzen.com
Wed Jul 8 10:39:50 UTC 2015
Hey Stefan!
First of all thanks for writing, I'm not involved with the nominatum
project but I may be able to help out with some geographic concepts.
To answer your first point, yes, "reverse geocoding" is generally
considered to be a process of asking the database for a list of the
geographically nearest database entries to the co-ordinates you entered, it
could return one or more result and optionally sort those results by
distance from the input co-ordinates.
This process works really well for areas of the world which have data
points (like venues, places, buildings, roads etc.) but will not work so
well for places which don't have many "points", such as in the middle of a
desert or ocean.
A good example of this are the co-ordinates 0,0 which land in the middle of
the Altantic Ocean south of Ghana and east of Gabon, the nearest land mass
is hundreds of kilometres away (despite a running joke that there is an
island there called null island).
So when you ask nominatum to reverse geocode the 0,0 co-ordinates you get
back an error "unable to geocode" which simply means "I couldn't find a
real world 'thing' near here, so instead of giving you something very very
far away, I returned nothing"
Regarding your question about Italy and the co-ordinates 40,18. I checked
and 40,18 actually lies in shallow water very close to land just south of
Gallipoli on the very Eastern part of Italy and it indeed due South of your
Slovakian co-ordinates of 48,18.
One of the problems with reverse geocoding countries, cities, states etc.
is that they don't really have a "true" center point, in the database they
are represented by a set of points (vertices on it's border) and are
grouped together as a polygon. Due to border disputes and historical
politics those geometries can be very unusual shapes and I'm not aware of
any place in the world which fits a nice simple shape profile like a
rectangle or triangle.
To give you a bit more of an idea what I'm talking about I did a super
quick trace of your country by clicking points along the border line I can
see on the visual basemap which resulted in this very simplified outline:
[link to border data for slovakia]
https://gist.githubusercontent.com/anonymous/5e29ce69e99981828c03/raw/f9b1174cb40f50a99e5c608dfeda89a6c2e8f6f3/map.geojson
That data format is called geojson (you can find more about it on the net)
and it's reasonably safe to say that any point that lies inside that shape
is somewhere inside Slovakian national borders.
These geometries can be found online and I can link you if you are
interested, however they can be very detailed and very complex, meaning
that they are very difficult to deal with unless you are an experienced
software engineer. Simplified versions of these geometries exist (as per
lossy audio codecs), which obviously lose fidelity but are useful for
things like rendering visual map layers.
Sorry for the long wordy reply, I just wanted to explain this concept so
that you understand that there also exists the idea of "point inside
polygon intersection" which means that you can ask the database to tell you
which polygons envelope the co-ordinates you specify, this is a bit
different as it does not require a place or 'thing' to exist in the
database in order to return a result. I'm not sure if nominatum offers this
functionality.
In regards to your second question, you are correct about your co-ordinates
being in the Adriatic sea at 41,18 and also probably why the results you
saw differed from those you got when your co-ordinates were over land. I am
assuming that this is because the Italy polygon data includes the Adriatic
sea area.
In short answer to your question, reverse geocoding and nominatum will be
very useful for you when working on land, however when working with oceans
you might be better off finding something else like the overpass API.
I'll leave it for other people more experienced in nominatum and
openstreetmap to suggest more tools to look at.
All the best, I've been to your country before for the Pohoda Festival and
had a great time.
On Tue, Jul 7, 2015 at 11:48 PM, Štefan Kiss <stefan.kiss at nextra.sk> wrote:
> Hello everybody!
>
> My name is Stefan and I am from Slovakia. I am a blind user of computer
> and for the work with PC I am using a screenreader which cann me to read a
> text from screen. I cann work with text, e-mail, webpages, sound but not
> with pictures and maps. But I am interested in geography and I would like
> to find some possibility for reading maps.
> I found a Nominatim service and I thought that it is a chance for me. I
> am living in Slovakia (48 lat and 18 lon) and I sent to Nominatim a
> sequence of queries where lat was 48 and lon was step by step decremented
> from 18 to 0. It was great for me to know what about countryes are under my
> Slovakia. I think - this is a way for blinds - how they cann read a maps
> and to create some image about the world.
> But now I hawe 2 questions to you.
>
> 1. On the webpage of Nominatim service is written:
>
> "...The following examples use Nominatim to reverse geocode. This is the
> process where you begin with a geographic coordinate and the nearest known
> address is returned."
>
> Please, what it means? When I send to Nominatim a coordinates 40 18
> (
> http://nominatim.openstreetmap.org/reverse?format=xml&lat=40&lon=18&zoom=18
> )
> and I get result Apulia, Italia, means it that I am really in Italia or
> the result is only the nearest known address and my location 40 18 dont
> must be in Italia?
>
> 2. When I sent to Nominatim a sequence of queries and I went from 48 18
> down to 10 18, I saw, that the seas are missed. I know that under Europe is
> Adriatic sea but in Nominatim results I go from Italia to Admas Tisal and
> Libia. (Admas and Tisal are tagget with tag address29 without other tags
> about Country or city).
>
> Please, cann you recommend me how specify the query when I would like to
> have a really information about place which is appointed with lat and lon
> coordinates? Or if Nominatim is not the best way for me, do you know some
> service which cann I use for reverse geolocation? I dont need roads,
> houses, buildings or points. I would like browse the maps through gps
> coordinates and to know in which country or city or on which sea I am. Is
> it so unrealistically?
>
> Thanks
>
> Stefan from Slovakia
>
> _______________________________________________
> Geocoding mailing list
> Geocoding at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/geocoding
>
>
--
Peter Johnson
Senior Geo-Search Engineer
peter.johnson at mapzen.com
https://github.com/missinglink
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/geocoding/attachments/20150708/c5211d4d/attachment-0001.html>
More information about the Geocoding
mailing list