Skip to content
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

OGRFeature::SetGeometry does not check the Geometry type #11147

Open
dbaston opened this issue Oct 28, 2024 · 1 comment
Open

OGRFeature::SetGeometry does not check the Geometry type #11147

dbaston opened this issue Oct 28, 2024 · 1 comment
Labels
documentation Issues and contributions to the documentation content

Comments

@dbaston
Copy link
Member

dbaston commented Oct 28, 2024

What is the bug?

Since 1999, the docs for OGRFeature::SetGeometry and friends have stated that the method may return OGRERR_NONE if successful, or OGRERR_FAILURE if the index is invalid, or OGRERR_UNSUPPORTED_GEOMETRY_TYPE if the geometry type is illegal for the OGRFeatureDefn (checking not implemented).

These methods should either be updated to perform the type checking, or the docs should be updated to remove OGRERR_UNSUPPORTED_GEOMETRY_TYPE as a possible return value.

Steps to reproduce the issue

none

Versions and provenance

1.1.1 to 3.10

Additional context

No response

@dbaston dbaston added the documentation Issues and contributions to the documentation content label Oct 28, 2024
@rouault
Copy link
Member

rouault commented Oct 28, 2024

or the docs should be updated to remove OGRERR_UNSUPPORTED_GEOMETRY_TYPE as a possible return value.

I'd favor that (and perhaps add a comment that this is not checked). Checking the geometry type would involve doing more changes, in particular the shapefile driver has for ages reported wkbPolygon at the layer level but may return wkbMultiPolygon geometries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues and contributions to the documentation content
Projects
None yet
Development

No branches or pull requests

2 participants