Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tbicr opened this issue Apr 13, 2020 · 4 comments
Open

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

tbicr opened this issue Apr 13, 2020 · 4 comments

Comments

@tbicr
Copy link

tbicr commented Apr 13, 2020

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
Copy link
Member

cayetanobv commented Apr 14, 2020

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.

@cayetanobv
Copy link
Member

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

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants