<div dir="ltr"><div><br><br>On Thu, Aug 24, 2017 at 3:37 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br>><br>> On jeudi 24 août 2017 15:34:11 CEST Markus Metz wrote:<br>><br>> > On Thu, Aug 24, 2017 at 11:15 AM, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>><br>><br>> ><br>><br>> > wrote:<br>><br>> > > > You can use v.in.ogr directly for OSM PBF files (<br>><br>> > > ><br>><br>> > > > <a href="http://gdal.org/drv_osm.html">http://gdal.org/drv_osm.html</a>).<br>><br>> > > ><br>><br>> > > ><br>><br>> > > ><br>><br>> > > > BTW, with GDAL 2.2.1, using OGR_INTERLEAVED_READING=YES does not work<br>><br>> ><br>><br>> > for<br>><br>> ><br>><br>> > > > me (empty vector).<br>><br>> > ><br>><br>> > > Caution: you cannot just specify OGR_INTERLEAVED_READING=YES and loop<br>><br>> ><br>><br>> > over layers as usual. See the "Interleaved reading" section of<br>><br>> > <a href="http://gdal.org/drv_osm.html">http://gdal.org/drv_osm.html</a><br>><br>> ><br>><br>> > I see, thanks for the hint. That means v.in.ogr must be changed to use the<br>><br>> > special reading mode, or OGR_INTERLEAVED_READING must be unset in v.in.ogr,<br>><br>> > together with a warning.<br>><br>>  <br>><br>> If you unset OGR_INTERLEAVED_READING, the classical read pattern (loop over layers, and for each layer, loop over its features) will work only for small osm/pbf files where the number of features in each layer isn't larger than 100K.<br>><br>> For larger files, OGR_INTERLEAVED_READING=YES and the special reading pattern described in drv_osm.html is needed.<br><br></div>OK, I have disabled OSM import for trunk and relbr72 (r71543,4), because it results in empty vectors or incomplete imports.<br><br>I am not sure if v.in.ogr should be modified to use this special reading mode for one single OGR supported format. The GDAL/OGR API is very convenient because applications do not need to bother about particular formats. If we start implementing code for particular formats in v.in.ogr, we might open a Pandora's box... <br><div><br></div><div>Markus M<br></div></div>