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

Hi

Is it possible to extract only the geometry from an osm file (osm.pbf, osm or o5m) ? Practically this will mean dropping all the tags from an OSM file I presume.

If not what are the possible ways to achieve this result ?

Thanks in advance

asked 21 Mar '18, 10:56

psychiclocust's gravatar image

psychiclocust
11112
accept rate: 0%


Did you have a look at osmfilter? https://wiki.openstreetmap.org/wiki/Osmfilter

permanent link

answered 21 Mar '18, 11:26

Katzmann's gravatar image

Katzmann
71115
accept rate: 0%

Yes I did. Been able to extract only the roads from an OSM file but not sure how to get only the geometry information without all the tags.

(21 Mar '18, 11:53) psychiclocust

Your question can't be answered the way you posed it. What format should the result have? It can't be an OSM file, because without tags you can't interpret the "geometry" content of an OSM file as actual geometries. Tell us what you are trying to achieve with those geometries and you might get more useful answers.

permanent link

answered 26 Mar '18, 07:47

Jochen%20Topf's gravatar image

Jochen Topf
5.2k55074
accept rate: 31%

I don't know if it works but it would do :

  • don't filter the tags because they are needed to build the correct geometry
  • osm2psql has an option style, ie openstreetmap-carto.style and hstore is also an option. Edit this file and remove all the the columns.

A priori, this is only the output table specification. The comment at the top of the file has nore sense in a carto-mapnik process.

Let's hope now that osm2pgsql will accept an empty style and that there is not the assumption that there is at least one col. Or else, try with only one column, ie

# OsmType  Tag          DataType     Flags
node,way   layer        int4         linear
permanent link

answered 11 May '18, 03:31

AntaC's gravatar image

AntaC
13115
accept rate: 0%

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:

×22

question asked: 21 Mar '18, 10:56

question was seen: 3,428 times

last updated: 11 May '18, 03:31

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