hi

I'm trying to use pyrosm to read a pbf file and filter it to get 'major' driving edges i.e. which are not parking/parking aisle etc. I tried using the "exclude" filter type to get edges that don't have specific tags, but I still get such edges. Any idea what am I doing wrong?

thanks

My code is:

from pyrosm import OSM, get_data
drive_filter = dict(
    area=['yes'],
    service=['parking', 'parking_aisle', 'private', 'emergency_access','parking_aisle'],
    highway=['cycleway', 'footway', 'path', 'pedestrian', 'steps', 'track',
             'corridor', 'elevator', 'escalator', 'proposed', 'construction',
             'bridleway', 'abandoned', 'platform', 'raceway'],
    motor_vehicle=['no'],
    motorcar=['no']
)
osm = OSM(get_data("test_pbf"))
driving = osm.get_data_by_custom_criteria(custom_filter=drive_filter,
                                          osm_keys_to_keep="highway",
                                          filter_type="exclude")
print(driving['service'].unique())

Output is:

[None 'driveway' 'parking_aisle']

asked 14 Mar, 15:45

anatrk's gravatar image

anatrk
112
accept rate: 0%

edited 15 Mar, 07:07

Be the first one to answer this question!
toggle preview

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:

×53
×2

question asked: 14 Mar, 15:45

question was seen: 89 times

last updated: 15 Mar, 07:07

powered by OSQA