[gdal-dev] vector drivers with mixed topology types in a single layer?

Even Rouault even.rouault at spatialys.com
Wed Feb 17 04:18:18 PST 2016


Le mercredi 17 février 2016 12:25:24, Michael Sumner a écrit :
> Hi there, is there an easy way to discover which formats allow mixing of
> vector types in a single layer?

No, there is no such driver metadata currently. You need to open the dataset 
and query the layer geometry type. If it is unknown, then it allows mix of 
geometry types.

> 
> I.e. a single layer MapInfo file with points, lines, and polygons - I know
> there is MapInfo (tab) and MapInfo (mif) and GeoJSON,
> 
> I'd also like to know what drivers can present as a single data set but
> with these types separated into different layers, like SDTS.
> 
> I consider the multiple shapefiles in one folder feature to be a somewhat
> different, third case.
From the point of view of the OGR API, a directory of shapefile = a dataset 
with several layers
> 
> Is there a clear way to categorize these three kinds, and classify all
> existing drivers this way?

I think there are 2 orthogonal isssues :
- which drivers support mixed of geometry type in a single layer
- which drivers support multiple layers in a dataset (in general, datasets 
that support multiple layers do not set a constraint on the unicity of the 
geometry type among layers)

And perhaps to address your shapefile case :
- which drivers support only opening a file
- which drivers support only opening a directory
- which drivers support both
- which drivers are not file related (already addressed by checking if the 
GDAL_DMD_CONNECTION_PREFIX / "DMD_CONNECTION_PREFIX" metadata item is present. 
Was added in GDAL 2.0)

> 
> Am I on the right track, or is it more complicated?
> 
> Cheers, Mike.

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


More information about the gdal-dev mailing list