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

geo: perform basic validation for Geospatial objects in spatialObjectFromGeomT #51074

Closed
otan opened this issue Jul 7, 2020 · 0 comments · Fixed by #51256
Closed

geo: perform basic validation for Geospatial objects in spatialObjectFromGeomT #51074

otan opened this issue Jul 7, 2020 · 0 comments · Fixed by #51256
Assignees
Labels
A-spatial Spatial work that is *not* related to builtins. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) good first issue

Comments

@otan
Copy link
Contributor

otan commented Jul 7, 2020

We currently do not perform any basic validation when creating a geospatial type. This can be done from spatialObjectFromGeomT. We should perform the following checks:

  • LineStrings have at least two points OR are empty
  • Polygon Linear Rings are closed and have at least four points OR are empty
  • MultiLineString: check LineString properties.
  • MultiPolygon: check Polygon properties.
  • GeometryCollection: check above properties.

Unit tests for this validate functionality would be great, one or two small integration tests in the geospatial logic test as well.

Ideally this should extend a pgerror InvalidArgument.

This should adapt and replace the logic in #50979.

@otan otan added A-spatial Spatial work that is *not* related to builtins. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) good first issue labels Jul 7, 2020
@cockroachdb cockroachdb deleted a comment from blathers-crl bot Jul 9, 2020
@otan otan self-assigned this Jul 9, 2020
@craig craig bot closed this as completed in d0c7962 Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spatial Spatial work that is *not* related to builtins. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant