pgRouting / osm2pgrouting

Import tool for OpenStreetMap data to pgRouting database
https://pgrouting.org
GNU General Public License v2.0
286 stars 113 forks source link

what tags used by osm2pgrouting that can be filtered by osmfilter? #265

Open tbicr opened 4 years ago

tbicr commented 4 years ago

Is your feature request related to a problem? Please describe. osm2pgrouting suggest to decrease osm file size, but I don't find suggestion to use osmfilter for it.

There are a few objects probably used like highways or cycleways or barriers as example.

So the question what the best filter for osmfilter I can use to reduce osm file size, but don't affect result importing data?

For example:

osmconvert INPUT.osm.pbf -o=INPUT.o5m
osmfilter INPUT.o5m  -o=OUTPUT.o5m \
--keep="highway= cycleway= cycleway:right= cycleway:left= tracktype= junction= barrier="
osmconvert OUTPUT.o5m -o=OUTPUT.osm

Describe the solution you'd like

Describe alternatives you've considered

Additional context

cayetanobv commented 4 years ago

Hi @tbicr ,

We suggest in "Tips" that you can use --drop-author and --drop-version flags with osmconvert to reduce size. If you would like to reduce more your dataset you should use osmfilter as you can have more granular filter functionality.

Answering your question I think you can reduce your data by removing all data you don't want to use to build your graph. I don't know what you need in your use case but you should be careful removing tags because you could build an incomplete graph.

tbicr commented 4 years ago

@cayetanobv , thanks for reply.

How can I figure out what tags use osm2pgrouting? I find tags usage in next places, but not sure that it all:

cayetanobv commented 4 years ago

Exactly, you need to define in mapconfig.xml your own use case or use this file directly. You have more xml config examples in the repository (you can tune as you want): image

rmarzocchi84 commented 2 years ago

It is possble to use additional mapconfig options for truck using maxwdth / maxhieight and maxweight tags? Have you an example?

  <tag_name name="highway" id="1">

[...]

    <tag_value maxweight="*"            id="201" priority="50"/>
    <tag_value maxwidth="*"            id="202" priority="100"/>

  </tag_name> 

but I encountered this error:

    Parsing configuration

osm2pgrouting: /build/osm2pgrouting-8kyiLn/osm2pgrouting-2.3.6/src/configuration/tag_value.cpp:33: osm2pgr::Tag_value::Tag_value(const char**): Assertion `has_attribute("name")' failed.
Aborted (core dumped)