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

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 '21, 15:45

anatrk's gravatar image

anatrk
11113
accept rate: 0%

edited 15 Mar '21, 07:07

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:

×66
×3

question asked: 14 Mar '21, 15:45

question was seen: 749 times

last updated: 15 Mar '21, 07:07

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