I've downloaded an openstreetmap shapefile and want to extract certain features (to make the file less heavy and have only the ones I'm interested in, for example bicycle paths from the roads). How would I do this, I can currently open the file and look at the features with this code:
from osgeo import ogr
file = ogr.Open('gis.osm_roads_free_1.shp')
shape = file.GetLayer(0)
# here I want to filter on an "fclass" value
Any suggestions on how to do this?