Re: [OSM-talk] Reverse look-up gazetteer

2009-03-21 Thread Tom Carden
2009/3/19 paul youlten :
> Does anyone know if there is there a web service that lets me take the
> latitude and longitude of a node and establish which country,
> state/county/province, city and Zip/post code the node is in?
>

Flickr has an API method that will do this to city level.
http://www.flickr.com/services/api/flickr.places.findByLatLon.html

I don't know if Yahoo's GeoPlanet API does this itself
http://developer.yahoo.com/geo/ but I think Flickr's method also
benefits from corrections Flickr's users make if they drop a photo in
a place and the assigned place name is wrong.

It's not OSM, but it sounds like what you want.

Tom.

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-20 Thread Roland Olbricht
> Does anyone know if there is there a web service that lets me take the
> latitude and longitude of a node and establish which country,
> state/county/province, city and Zip/post code the node is in?

The most canonical way is to use the boundary data inside OSM. This is usually 
stored in a relation tagged with the key "admin_level" and values from "2" 
(for countries) to "10" (for parts of hamlets, depending on the country) 
which countains all the ways that constitute the boundary.
The data is of quite good quality for a lot of cities in various European 
countries but it is poor for the most country boundaries themselves (there 
are gaps in the boundaries). But this should improve over the time.

I'm currently working as part of a larger project on this service. The reverse 
gazetteer itself based purely on OSM data works fine, but it is not online 
yet. Currently, I'm working on making minute updates possible. And the entire 
system should anyway be re-tested after the move to the 0.6 api which will 
take place at 20th april.

So I think I'll probably go online around mid-may. I you can't wait, I can put 
the source code on the web, but it is really a huge mess at the moment.

Cheers,
Roland

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread paul youlten
I am not doing anything that needs great accuracy - there are a few
hundred pages on Yellowikis have geo tags in this format:

40 16 05 N 106 53 41 W

I want to use a bot to go through the wiki and use these geo tags to
make geo categories:

like this: [[Category:USState:CO]]

geonames.org looks pretty good for this.

PaulY


On Thu, Mar 19, 2009 at 3:38 PM, Someoneelse
 wrote:
> marcus.wolsc...@googlemail.com wrote:
>
>> Lets face it. Everyone else manages this (tomtom, google, garmin, )
>
> I'm not sure that "everyone else" does make too good a job of it. Google
> has quite a few village placenames in the wrong place near me
> (Derbyshire, UK).  The free satnav on my Blackberry is OK with UK
> postcodes but struggles with smaller placenames and "street or feature
> in placename".
>
> ___
> talk mailing list
> talk@openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk
>



-- 
Tel: +44(0) 7814 517 807

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread marcus.wolschon
On Thu, 19 Mar 2009 14:38:58 +, Someoneelse
 wrote:
> marcus.wolsc...@googlemail.com wrote:
> 
>> Lets face it. Everyone else manages this (tomtom, google, garmin, )
> 
> I'm not sure that "everyone else" does make too good a job of it. Google 
> has quite a few village placenames in the wrong place near me 
> (Derbyshire, UK). 

Interesting. They seem to be very accurate whenever I use them. Maybe its
different for other maps.

> The free satnav on my Blackberry is OK with UK 
> postcodes but struggles with smaller placenames and "street or feature 
> in placename".

You said "free satnav"? Does it use a commercial map?
I was comparing us with established commercial applications
that use the established $$$-maps.

What I like in Map&Guide or tomtom for example is typing in a
city and getting all streets, typing in a house-number and getting
only the results that have this house-number in the street. This works
like a charm even with the smallest villages without presenting me
streets from the next village.

(When setting your targets, why settle for lower quality then to be
 >better< then the ones you like to replace.)

Marcus

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread Someoneelse
marcus.wolsc...@googlemail.com wrote:

> Lets face it. Everyone else manages this (tomtom, google, garmin, )

I'm not sure that "everyone else" does make too good a job of it. Google 
has quite a few village placenames in the wrong place near me 
(Derbyshire, UK).  The free satnav on my Blackberry is OK with UK 
postcodes but struggles with smaller placenames and "street or feature 
in placename".

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread marcus.wolschon
>> This will fail if:
>> * there are more then 1 place-nodes in the bounding box
> 
> Why not automatically choose the closest place.

Possible. What you get is the dreaded " near ".
You don't get a defined getCityForStreet() that is guaranteed
to return a correct result if it returns a non-null result.

Lets face it. Everyone else manages this (tomtom, google, garmin, )
but city-limits, country-limits and zip-codes in OSM are a mess and in
desperate need of repair.

>> * the city is too large the the node is not in the bounding-box
>> * the location does not belong to the city but the center of some
village
>> is nearby
> 
> Yes, then again with any such "reverse gazeteer" you need to choose an
> arbitrary distance to decide what point is "in the city" and what is
> outside.  Some localities have an associated landuse=residential.

That should be a polygon tagged as place=(city|village|...), name=.
It often coincides with a landuse but landuse is a rendered area and
a city is made up of many, one or no such areas while it has exactly one
circumsizing polygon.

Marcus

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread andrzej zaborowski
2009/3/19  :
> On Thu, 19 Mar 2009 14:09:21 +0100, andrzej zaborowski 
> wrote:
>> 2009/3/19 paul youlten :
>>> Does anyone know if there is there a web service that lets me take the
>>> latitude and longitude of a node and establish which country,
>>> state/county/province, city and Zip/post code the node is in?
>>
>> I don't know of a specific web service but it turns out using the
>> usual API you can find the city name quite easily, I first saw it done
>> in the party render script:
>> http://svn.openstreetmap.org/applications/rendering/party/render.py .
>> The post code and other data you would have to pull from somewhere
>> else as OSM doesn't store those except for a few places now.
>
> Hello Andrezej,
>
> I read the source-code and it just looks for a node with a place-tag
> exists in a certain bounding box, expecting to find exactly one.

Yes, in practice that simple way turned out to work very well for me.

>
> This will fail if:
> * there are more then 1 place-nodes in the bounding box

Why not automatically choose the closest place.

> * the city is too large the the node is not in the bounding-box
> * the location does not belong to the city but the center of some village
> is nearby

Yes, then again with any such "reverse gazeteer" you need to choose an
arbitrary distance to decide what point is "in the city" and what is
outside.  Some localities have an associated landuse=residential.

> * the location is part of a place=hamlet or anything but "city", "village"
> or "town"

I didn't say you should literally use the party render code, obviously
it's an example.
I don't know what use Paul has for this service but it doesn't seem
like separate web service is justified (thought it might be, and if
there is one already, with zip codes etc...).

Regards

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread marcus.wolschon
On Thu, 19 Mar 2009 14:09:21 +0100, andrzej zaborowski 
wrote:
> 2009/3/19 paul youlten :
>> Does anyone know if there is there a web service that lets me take the
>> latitude and longitude of a node and establish which country,
>> state/county/province, city and Zip/post code the node is in?
> 
> I don't know of a specific web service but it turns out using the
> usual API you can find the city name quite easily, I first saw it done
> in the party render script:
> http://svn.openstreetmap.org/applications/rendering/party/render.py .
> The post code and other data you would have to pull from somewhere
> else as OSM doesn't store those except for a few places now.

Hello Andrezej,

I read the source-code and it just looks for a node with a place-tag
exists in a certain bounding box, expecting to find exactly one.

This will fail if:
* there are more then 1 place-nodes in the bounding box
* the city is too large the the node is not in the bounding-box
* the location does not belong to the city but the center of some village
is nearby
* the location is part of a place=hamlet or anything but "city", "village"
or "town"

It's also quite expensive to do a bbox-query like that for more then a few
locations.
So it's neither easy nor anywhere near reliable. It's just a quick hack
that
works in some cases.

Marcus

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread marcus.wolschon
On Thu, 19 Mar 2009 12:01:12 +0100, paul youlten 
wrote:
> Does anyone know if there is there a web service that lets me take the
> latitude and longitude of a node and establish which country,
> state/county/province, city and Zip/post code the node is in?

Not yet.
Considering the many missing place-boundary-poylgons and border-polygons
(grouped in a relation)
and the efford required to collect zip-regions as polygons
this will take quite a while.

Marcus

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread andrzej zaborowski
2009/3/19 paul youlten :
> Does anyone know if there is there a web service that lets me take the
> latitude and longitude of a node and establish which country,
> state/county/province, city and Zip/post code the node is in?

I don't know of a specific web service but it turns out using the
usual API you can find the city name quite easily, I first saw it done
in the party render script:
http://svn.openstreetmap.org/applications/rendering/party/render.py .
The post code and other data you would have to pull from somewhere
else as OSM doesn't store those except for a few places now.

Cheers

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread Michel Barakat
Take a look at the GeoNames.org web service:
http://www.geonames.org/export/ws-overview.html
I didn't play with it yet, but I believe it can achieve what you're asking for.

On Thu, Mar 19, 2009 at 1:01 PM, paul youlten  wrote:
> Does anyone know if there is there a web service that lets me take the
> latitude and longitude of a node and establish which country,
> state/county/province, city and Zip/post code the node is in?
>
> PaulY
> --
> Tel: +44(0) 7814 517 807
>
> ___
> talk mailing list
> talk@openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk
>

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


[OSM-talk] Reverse look-up gazetteer

2009-03-19 Thread paul youlten
Does anyone know if there is there a web service that lets me take the
latitude and longitude of a node and establish which country,
state/county/province, city and Zip/post code the node is in?

PaulY
-- 
Tel: +44(0) 7814 517 807

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk