NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

I have a question. Using osmconvert can reasonably be saved in CSV relations and ways?

With the nodes do not have a problem. Simply:

./osmconvert europe-latest.osm.pbf --out-csv --csv="@id @lat @lon"

The current record in the CSV relations and ways, however, does not make sense to me ...

It looks like this:

relation    3903876     
relation    3903985     
relation    3903986     
relation    3903987     
relation    3903988     
relation    3903989     
relation    3903990

How to identify what is in relation to what?

asked 06 Jan '15, 20:45

Rysiu's gravatar image

Rysiu
26334
accept rate: 0%


Ways and relations are too complex to be output in a CSV file. If you want to process ways and relations, other avenues might be more promising, e.g. writing a program that reads the OSM file (using e.g. the Osmium library), or loading the OSM file into a database with osm2pgsql and then running your analysis on the database.

If you really need a text file with one OSM object per line, try Osmium's "OPL" format.

permanent link

answered 06 Jan '15, 22:42

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

How big will the MySQL database if the file osm.bz2 takes almost 900 MB?

(06 Jan '15, 22:54) Rysiu

As @Frederik said, relations & ways are complicated. osm2psql can output a pgsimp format, which is a directory of tab separated files (which are like CSVs). It might do what you want.

permanent link

answered 07 Jan '15, 10:26

rorym's gravatar image

rorym
5.4k1449100
accept rate: 11%

The --csv="@id @lat @lon" in your question suggests that you need just IDs and coordinates. Maybe the option --all-to-nodes will help. It will retrieve the coordinates for all your ways and relations.

https://wiki.openstreetmap.org/wiki/Osmconvert#Dispose_of_Ways_and_Relations_and_Convert_them_to_Nodes

permanent link

answered 07 Jan '15, 20:44

Marqqs's gravatar image

Marqqs
448510
accept rate: 22%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×47
×42

question asked: 06 Jan '15, 20:45

question was seen: 7,312 times

last updated: 07 Jan '15, 20:44

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum