> The amended code looks like this:
> 
>         ds = gdal.OpenEx(input_pbfname, gdal.OF_VECTOR)
>         nly = ds.GetLayerCount()
>         ds.ResetReading()
>         for ily in (0,1,2,4,3):
>             layer = ds.GetLayerByIndex(ily)
>             layer.ResetReading()
>             feat = layer.GetNextFeature()
>             while feat is not None:
>                  # do stuff with feat

This is not the proper way of doing layer interleaved reading. It might work 
by chance on your particular dataset, but not in the general case. See
https://gdal.org/drivers/vector/osm.html#interleaved-reading

With recent GDAL versions, you might also use ds.GetNextFeature()

See https://github.com/OSGeo/gdal/blob/master/autotest/ogr/ogr_osm.py#L702

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to