[gdal-dev] MVT fields/geometry alignment

Even Rouault even.rouault at spatialys.com
Wed Aug 7 01:19:29 PDT 2019


Michael,

> 
> In this MVT source poLayer->GetFeatureCount() reports that there are 85
> features, as does ogrinfo summary:
> 
> But, iterating features finds 81 valid features, as reported by

The difference is due to clipping geometries to the tile extent.
GetFeatureCount() do a super fast scan, counting all features, whereas by 
default GetNextFeature() also checks if the geometry intersects the tile 
extent. And in that case there are a few features that are actually outside of 
the tile extent. If you add -oo CLIP=NO then GetNextFeature() will report 85 
features as well.

As a workaround for GetFeatureCount() to return 81 as well, you can specify a 
dummy attribute filter that will force it to go to the slow scan mode:

ogrinfo 14/4823/6160.mvt landuse -al -so -where 1=1

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list