[OSM-newbies] making a csv file of a data set

Hermann Peifer peifer at gmx.eu
Sat Mar 22 16:46:51 UTC 2014


On 2014-03-22 1:34, wouter van der plas wrote:
>
> and therefor i'd like a csv file with all the tags so i can import them
> to programs and find the data i need.
>
> so what i'm asking: is there a way to make a csv file with all the tags.
> i am already familiar with with the csv function in osmconvert but this
> tool needs you to know the tags before you run the program.
>

$ ogr2ogr -f csv /dev/stdout liechtenstein-latest.osm.pbf points | head

osm_id,place,all_tags
26860698,,"""name""=>""Mittagspitze"",""tourism""=>""camp_site"""
26863444,,"""name""=>""Kuhgrat"",""natural""=>""peak"""
32011241,suburb,"""name""=>""Oberplanken"",""place""=>""suburb"""
32020993,,"""railway""=>""level_crossing"""
49872384,,"""highway""=>""crossing"""
49872651,,"""information""=>""guidepost"",""name""=>""Schloss 
Vaduz"",""tourism""=>""information"""
49939577,,"""highway""=>""crossing"""
49939622,,"""highway""=>""crossing"""
50049362,,"""highway""=>""crossing"""
50069907,,"""amenity""=>""parking"""
(...)

ogr2ogr is a command line tool that converts between various vector file 
formats, see [0]. For the field definitions of the above example: see [1].

I am not quite sure in how far ogr2ogr can attack the whole planet.

Hermann


[0] http://www.gdal.org/ogr_utilities.html

[1]

[points]
# common attributes
osm_id=yes

# keys to report as OGR fields
attributes=place

# keys that, alone, are not significant enough to report a node as a OGR 
point
unsignificant=created_by,converted_by,source,time,ele,attribution

# keys that should NOT be reported in the "other_tags" field
ignore=created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME

# uncomment to avoid creation of "other_tags" field
#other_tags=no

# uncomment to create "all_tags" field. "all_tags" and "other_tags" are 
exclusive
all_tags=yes




More information about the newbies mailing list