Re: [OSM-talk] Street/POI Index from OSM data

2013-08-22 Thread Alex Rollin
Hi Jukka!

Thank you for the detailed instructions!

it took me a whole year to get this installed.

are you still doing mapping?

i wrote a number of scripts to parse pbf files for our charity maps for
indonesia.  they are not very efficient.


On Sat, Sep 29, 2012 at 12:37 AM, Jukka Rahkonen <
jukka.rahko...@latuviitta.fi> wrote:

> Alex Rollin  gmail.com> writes:
>
> >
> >
> > Hello,
> >
> >
> > I am rather new to OSM data.  I've enjoyed doing edits on the map and
> now I'd
> like to start learning how to arrange it on a printed page.
> >
> > I know there are lots and lots of tools out there.
> >
> >
> > Could I receive a few recommendations for getting some text data out?
> >
> > I was thinking I might need to use Osmosis.  Some pointers would be
>  very helpful.
> >
> >
> >
> > I would like to:
>
>  Select a bounding box (I can produce lat/lon)
>  Get a list of street names'
>  Output a CSV file (or other text file)
>
>  Select a bounding box (I can produce lat/lon)
>  Get a list of POIs
>
>  Output a CSV file (or other text file)
>
>  For these I would also like to be able to get any other attributes/
> keys like
> description text or other things.
>
> > Thank you to each of you for all the work you do!
>
> Hi,
>
> Sorry for a bit delayed answer but GDAL/OGR OSM driver developer had
> to do a couple of fixes for making this task to perform well.
>
> So you can do all that with GDAL OSM driver and SQL query language. Output
> can be despite CSV any other format that is supported by GDAL/OGR for
> writing.
> http://www.gdal.org/ogr/drv_osm.html
> http://www.gdal.org/ogr/ogr_formats.html
>
> Install a very fresh GDAL development version, about rev. 24970 or higher.
> For Windows you can get it from gisinternals
> http://www.gisinternals.com/sdk/
>
> You want to query streetname from osm lines and name and probably some
> other
> attributes from osm points and from a limited area. It is possible but
> quite
> slow to create such CSV file directly from OSM data file that can be in
> osm-xml or pbf format with following command
>
> ogr2ogr -f CSV streets.csv finland.osm.pbf -sql "select distinct
> name from lines where highway is not null order by name"
> -spat 24.821 60.123 25.259 60.317
>
> However, it is faster, especially if you want to do more queries,
> to convert OSM data first into Spatialite database. Here is a quite
> optimised command to use as a template
>
> ogr2ogr -f SQLite -dsco spatialite=yes finland.sqlite finland.osm.pbf
>  --config SQLITE_SYNCHRONOUS OFF --config OSM_COMPRESS_NODES YES
>  -progress
>
> This conversion takes a few minutes with 130 MB finland.osm.pbf file.
> Then you can repeat the first streetname search and it will be pretty fast
>
> ogr2ogr -f CSV streets.csv finland.sqlite -sql "select distinct name
> from lines where highway is not null order by name"
> -spat 24.821 60.123 25.259 60.317
>
> The poi file can be created in a similar way. Let's say you want to
> get all the amenities and names for those. The command is
>
> ogr2ogr -f CSV poi.csv finland.sqlite -sql "select name, amenity
> from points where amenity is not null order by amenity"
> -spat 24.821 60.123 25.259 60.317
>
> Note 1. Read the OSM driver manual page. The second command does not
> work before editing the defauld osmconf.ini file so that "amenity"
> is included in the points layer attributes.
>
> Note 2. There is a little bug in ogr2ogr CSV driver that may prevent
> creating a new csv file if there is already another CSV file with an
> uncommon structure in the same directory. The one-column CSV file that
> was created in the first example has such a structure. Delete the file
> or rename it with another extension before running the second example.
>
> Regards,
>
> -Jukka Rahkonen-
>
>
>
>
> ___
> talk mailing list
> talk@openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk
>
___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Street/POI Index from OSM data

2012-09-28 Thread Jukka Rahkonen
Alex Rollin  gmail.com> writes:

> 
> 
> Hello,
> 
> 
> I am rather new to OSM data.  I've enjoyed doing edits on the map and 
now I'd
like to start learning how to arrange it on a printed page.
> 
> I know there are lots and lots of tools out there.
> 
> 
> Could I receive a few recommendations for getting some text data out?
> 
> I was thinking I might need to use Osmosis.  Some pointers would be
 very helpful.
> 
> 
> 
> I would like to:
 
 Select a bounding box (I can produce lat/lon)
 Get a list of street names'
 Output a CSV file (or other text file)
 
 Select a bounding box (I can produce lat/lon)
 Get a list of POIs
 
 Output a CSV file (or other text file)
 
 For these I would also like to be able to get any other attributes/
keys like
description text or other things.

> Thank you to each of you for all the work you do!

Hi,

Sorry for a bit delayed answer but GDAL/OGR OSM driver developer had 
to do a couple of fixes for making this task to perform well.

So you can do all that with GDAL OSM driver and SQL query language. Output
can be despite CSV any other format that is supported by GDAL/OGR for 
writing.
http://www.gdal.org/ogr/drv_osm.html
http://www.gdal.org/ogr/ogr_formats.html

Install a very fresh GDAL development version, about rev. 24970 or higher.
For Windows you can get it from gisinternals
http://www.gisinternals.com/sdk/

You want to query streetname from osm lines and name and probably some other
attributes from osm points and from a limited area. It is possible but quite
slow to create such CSV file directly from OSM data file that can be in
osm-xml or pbf format with following command

ogr2ogr -f CSV streets.csv finland.osm.pbf -sql "select distinct 
name from lines where highway is not null order by name" 
-spat 24.821 60.123 25.259 60.317

However, it is faster, especially if you want to do more queries, 
to convert OSM data first into Spatialite database. Here is a quite 
optimised command to use as a template

ogr2ogr -f SQLite -dsco spatialite=yes finland.sqlite finland.osm.pbf
 --config SQLITE_SYNCHRONOUS OFF --config OSM_COMPRESS_NODES YES
 -progress

This conversion takes a few minutes with 130 MB finland.osm.pbf file. 
Then you can repeat the first streetname search and it will be pretty fast

ogr2ogr -f CSV streets.csv finland.sqlite -sql "select distinct name 
from lines where highway is not null order by name" 
-spat 24.821 60.123 25.259 60.317

The poi file can be created in a similar way. Let's say you want to 
get all the amenities and names for those. The command is

ogr2ogr -f CSV poi.csv finland.sqlite -sql "select name, amenity 
from points where amenity is not null order by amenity"
-spat 24.821 60.123 25.259 60.317

Note 1. Read the OSM driver manual page. The second command does not 
work before editing the defauld osmconf.ini file so that "amenity" 
is included in the points layer attributes.

Note 2. There is a little bug in ogr2ogr CSV driver that may prevent 
creating a new csv file if there is already another CSV file with an 
uncommon structure in the same directory. The one-column CSV file that 
was created in the first example has such a structure. Delete the file 
or rename it with another extension before running the second example.

Regards,

-Jukka Rahkonen-




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


Re: [OSM-talk] Street/POI Index from OSM data

2012-09-23 Thread john whelan
Or since the OSM data is held as an xml data file with tags a quick VB
program to parse it will pull out the street names.  Or even Maperitive,
load a local file, export tags, then you'll find a list of street names
prefixed by addr:street in csv format.

Cheerio John

On 23 September 2012 20:50, Kate Chapman  wrote:

> Hi Alex,
>
> Specifically for Indonesia there is an export tool available here:
> http://hot-export.geofabrik.de/ (It also works for Haiti and Africa).
>
> The way it works is you upload your JOSM preset and it will spit out
> the data you want in a variety of formats. CSV is not one of them but
> shp is and if you take the dbf file from the shhp it would work
> basically the same.
>
> -Kate
>
> On Mon, Sep 24, 2012 at 4:33 AM, Alex Rollin 
> wrote:
> > Hello,
> >
> > I am rather new to OSM data.  I've enjoyed doing edits on the map and now
> > I'd like to start learning how to arrange it on a printed page.
> >
> > I know there are lots and lots of tools out there.
> >
> > Could I receive a few recommendations for getting some text data out?
> >
> > I was thinking I might need to use Osmosis.  Some pointers would be very
> > helpful.
> >
> > I would like to:
> >
> > Select a bounding box (I can produce lat/lon)
> > Get a list of street names'
> > Output a CSV file (or other text file)
> >
> >
> > Select a bounding box (I can produce lat/lon)
> > Get a list of POIs
> > Output a CSV file (or other text file)
> >
> > For these I would also like to be able to get any other attributes/keys
> like
> > description text or other things.
> >
> > Thank you to each of you for all the work you do!
> >
> > Alex
> >
> > ___
> > talk mailing list
> > talk@openstreetmap.org
> > http://lists.openstreetmap.org/listinfo/talk
> >
>
> ___
> talk mailing list
> talk@openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk
>
___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk


Re: [OSM-talk] Street/POI Index from OSM data

2012-09-23 Thread Kate Chapman
Hi Alex,

Specifically for Indonesia there is an export tool available here:
http://hot-export.geofabrik.de/ (It also works for Haiti and Africa).

The way it works is you upload your JOSM preset and it will spit out
the data you want in a variety of formats. CSV is not one of them but
shp is and if you take the dbf file from the shhp it would work
basically the same.

-Kate

On Mon, Sep 24, 2012 at 4:33 AM, Alex Rollin  wrote:
> Hello,
>
> I am rather new to OSM data.  I've enjoyed doing edits on the map and now
> I'd like to start learning how to arrange it on a printed page.
>
> I know there are lots and lots of tools out there.
>
> Could I receive a few recommendations for getting some text data out?
>
> I was thinking I might need to use Osmosis.  Some pointers would be very
> helpful.
>
> I would like to:
>
> Select a bounding box (I can produce lat/lon)
> Get a list of street names'
> Output a CSV file (or other text file)
>
>
> Select a bounding box (I can produce lat/lon)
> Get a list of POIs
> Output a CSV file (or other text file)
>
> For these I would also like to be able to get any other attributes/keys like
> description text or other things.
>
> Thank you to each of you for all the work you do!
>
> Alex
>
> ___
> talk mailing list
> talk@openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk
>

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


Re: [OSM-talk] Street/POI Index from OSM data

2012-09-23 Thread Richard Weait
On Sun, Sep 23, 2012 at 5:33 PM, Alex Rollin  wrote:
> Hello,
>
> I am rather new to OSM data.  I've enjoyed doing edits on the map and now
> I'd like to start learning how to arrange it on a printed page.
>
> I know there are lots and lots of tools out there.
>
> Could I receive a few recommendations for getting some text data out?

You might like http://maposmatic.org  They render an OSM map for you
with a street index.  Their code is open, so you could build on that.

Many other opportunities to dive into the data as well, from building
your own geo database to processing planet or .osm files, to using
osmosis, *XAPI queries, Osmium, ...

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


[OSM-talk] Street/POI Index from OSM data

2012-09-23 Thread Alex Rollin
Hello,

I am rather new to OSM data.  I've enjoyed doing edits on the map and now
I'd like to start learning how to arrange it on a printed page.

I know there are lots and lots of tools out there.

Could I receive a few recommendations for getting some text data out?

I was thinking I might need to use Osmosis.  Some pointers would be very
helpful.

I would like to:

Select a bounding box (I can produce lat/lon)
Get a list of street names'
Output a CSV file (or other text file)


Select a bounding box (I can produce lat/lon)
Get a list of POIs
Output a CSV file (or other text file)

For these I would also like to be able to get any other attributes/keys
like description text or other things.

Thank you to each of you for all the work you do!

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