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


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

accept rate: 0%

Did you have a look at osmfilter?

permanent link

answered 21 Mar '18, 11:26

Katzmann's gravatar image

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
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 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

accept rate: 0%

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 21 Mar '18, 10:56

question was seen: 3,189 times

last updated: 11 May '18, 03:31

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