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

Add Geometry Validation functions from PostGIS #39

Closed
blikij opened this issue Feb 17, 2023 · 8 comments
Closed

Add Geometry Validation functions from PostGIS #39

blikij opened this issue Feb 17, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@blikij
Copy link

blikij commented Feb 17, 2023

Would it be possible to add the geometry validation functions. Such as ST_IsValid, ST_IsValidDetail, ST_IsValidReason and ST_MakeValid? The European Environment Agency could use this excellent work in our data reporting tool making spatial validation as well possible.

@sheinbergon
Copy link
Owner

Hi @blikij

I can add this PostGIS like functionality, sure.
I'll make it a part of the upcoming release.

Bear in mind that much like PostGIS, validation will work on sane geometries only (for example, you can't create a polygon comprised of a non closed ring). Such shapes will cause queries to fail (which is also what happens in PostGIS)

It will of course, work for softer errors (like self Intersecrting polygons)

@sheinbergon sheinbergon changed the title Add the Geometry Validation functions from Post's Add Geometry Validation functions from Post's Feb 17, 2023
@sheinbergon sheinbergon changed the title Add Geometry Validation functions from Post's Add Geometry Validation functions from PostGIS Feb 17, 2023
@sheinbergon sheinbergon self-assigned this Feb 17, 2023
@sheinbergon sheinbergon added enhancement New feature or request good first issue Good for newcomers labels Feb 17, 2023
@sheinbergon sheinbergon modified the milestones: 0.8.6, 0.5.14 Feb 17, 2023
@sheinbergon
Copy link
Owner

sheinbergon commented Feb 18, 2023

@bliki Bothj ST_IsValid and ST_IsValidReason (including their ESRI flag variants) will be part of the next release (27.2).

ST_IsValidDetail would not be implemented for the time being, as I've yet to unrevel the whole expand object thingy in Dremio ( there are no composite tuple types like Postgres).

I'll also try and push ST_MakeValid into that relese, but it'll require more work

@blikij
Copy link
Author

blikij commented Feb 19, 2023

Thank you so much. ST_IsValidDetail is not that crucial for us. If the other cn be implemented we have something I can use in production.

@sheinbergon
Copy link
Owner

Do you plan on using ST_MakeValid in production?

@blikij
Copy link
Author

blikij commented Feb 19, 2023

Do you plan on using ST_MakeValid in production?

Yes, It would allow us to perform additional validations on the data. If the errors are minor... The result would not be written back, instead we would write into an additional table... (using a create table... select...)

@sheinbergon
Copy link
Owner

OK. Got it. I'll make an effort to add that to the release plan

@sheinbergon
Copy link
Owner

sheinbergon commented Feb 25, 2023

@blikij I can confirm that an implementation of ST_MakeValid, based on JTS's GeometryFixer will make it into the upcoming release.

You will be able to call

ST_MakeValid(geom)
ST_MakeValid(geom,'keepcollapsed=true|false')

bear in mind this is somewhat experimental as GeometryFixer is somewhat of a new feature for JTS. Results seem to differ from the GEOS / PostGIS implementation

You can see further discussion here locationtech/jts#959

@sheinbergon
Copy link
Owner

sheinbergon commented Feb 28, 2023

Released in 0.8.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants