-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OGRLayer::GetGeometryTypes() #6491
Conversation
…ypes() Use OGR_L_GetGeometryTypes() to get the actual geometry types of a layer. Cf OSGeo/gdal#6491
9544b15
to
f9889d0
Compare
f9889d0
to
d3eb5cf
Compare
Sorry that I cannot read the details from the code. Do you stop with MIXED if just linestring and multilinestring, or polygon and multipolygon are found? They could still be handled by promoting the geometries to MULTI without a need to change the geometry field into generic GEOMETRY if no other geometry types are found? In case of GeoPackage, do you first check that the geometry_type_name in gpkg_geometry_columns is |
d3eb5cf
to
afbd237
Compare
yes. I had some hesitation about that, but I decided to keep things simple. It could be tricky to decide which grouping of "equivalent" geometry types make sense. In some context linestring ~= multilinestring, but circularstring, compoundcurve or multicurve should be treated differently. In other contexts, all types of lines should be considered equivalent. Thus the user can just query all types and decide by itself which groupings make sense.
No, the implementation of GetGeometryTypes() is really checking all features. It is the responsibility of the user to only call it when it makes sense (ie GetGeomType() == wkbUnknown).
That wasn't the motivation, but yes could be used for that. |
This method iterates over features to retrieve their geometry types. This is mostly useful for layers that report a wkbUnknown geometry type. By default this method returns an array of nEntryCount entries with each geometry type (in OGRGeometryTypeCounter::eGeomType) and the corresponding number of features (in OGRGeometryTypeCounter::nCount). Features without geometries are reported as eGeomType == wkbNone.
…ss == 0 don't get discarded
afbd237
to
aa6445e
Compare
…ypes() (#50491) Use OGR_L_GetGeometryTypes() to get the actual geometry types of a layer. Cf OSGeo/gdal#6491
This method iterates over features to retrieve their geometry types. This
is mostly useful for layers that report a wkbUnknown geometry type.
By default this method returns an array of nEntryCount entries with each
geometry type (in OGRGeometryTypeCounter::eGeomType) and the corresponding
number of features (in OGRGeometryTypeCounter::nCount).
Features without geometries are reported as eGeomType == wkbNone.
Optimized implementations for GPKG and PostgreSQL