[Geocoding] Nominatim: Listing all streets in city

Dariusz Bączkowski dariusz.baczkowski at esyscoder.pl
Mon May 27 22:58:45 UTC 2013


Dnia poniedziałek, 27 maja 2013 o 09:12:45 Sarah Hoffmann napisał(a):
> Hi,
> 
> On Sun, May 26, 2013 at 08:23:14PM +0200, Dariusz Bączkowski wrote:
> > I would like to list all streets in city using Nominatim.
> > Let's say in Koszalin, Poland. Is there any way to do that?
> > I have Nominatim server available, so it can be in a form of database
> > query if no other way is possible.
> 
> I have written a script that can do something like that some time ago.
> It can be found in this branch:
> https://github.com/lonvia/Nominatim/tree/export-script
> 
> as utils/export.php. You give it the OSM object of the city, choose the
> information you want and it prints out a CSV table.
> 
> It should be functional but I never got around to testing it thorougly,
> so it may do strange things sometimes. Also keep in mind that it was
> written against an older Nominatim version. You might have to tweak it
> to work against your DB. See if it can work for you at least as a starting
> point.

It works but there is repetition in output, so I had to filter it:
(...)
Zorzy,Koszalin
Żurawia,Koszalin
Żwirowa,Koszalin
Zwycięstwa,Koszalin
Zwycięstwa,Koszalin
Zwycięstwa,Koszalin
Zwycięstwa,Koszalin
Zwycięstwa,Koszalin
Zwycięstwa,Koszalin
Żytnia,Koszalin

php ./utils/export.php --restrict-to-osm-relation 2106899 --output-format 
"street;city" --output-type street | sort | wc -l
PHP Notice:  Undefined index: HTTP_ACCEPT_LANGUAGE in 
/home/src/Nominatim-2.0.0/lib/lib.php on line 106
586

php ./utils/export.php --restrict-to-osm-relation 2106899 --output-format 
"street;city" --output-type street | sort | uniq | wc -l
PHP Notice:  Undefined index: HTTP_ACCEPT_LANGUAGE in 
/home/src/Nominatim-2.0.0/lib/lib.php on line 106
517

Should work for me, thank you.

> 
> > P.S. Is there some place where I can read how Nominatim works in detail,
> > especially how database is used in searches?
> 
> There is currently no documentation other than the source code. I don't
> really have the time at the moment to write something up but if somebody
> would want to attempt to start some documentation, I'd be happy to help
> with any questions.

I would like to contribute because we need some features (like structured 
requests and partial search) but it is really hard to start just from source 
code.

-- 
Pozdrawiam,
Dariusz Bączkowski

ESYSCODER Dariusz Bączkowski
e-mail: biuro at esyscoder.pl
tel.: +48 720 820 220
fax: +48 947 166 554
http://esyscoder.pl/
http://system-taxi.pl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.openstreetmap.org/pipermail/geocoding/attachments/20130528/2248339d/attachment.pgp>


More information about the Geocoding mailing list