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

Check for spatialite geometry #138

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

damienmulder
Copy link
Collaborator

Description

Valid geometry checks (RQ5 and RQ23) now check if geometry is in the GeoPackage format using the IsValidGPB() function.
Non-empty geometry which is not in the GeoPackage format is now considered invalid.

Type of change

  • Improvement of existing feature

Checklist:

  • I've double-checked the code in this PR myself
  • I've left the code better than before (boy scout rule)
  • The code is readable, comments are added that explain hard or non-obvious parts.
  • I've expanded/improved the (unit) tests, when applicable
  • I've run (unit) tests that prove my solution works
  • There's no sensitive information like credentials in my PR

FROM(
SELECT
CASE INSTR(ST_IsValidReason("{column_name}"), '[')
CASE ST_IsValid("{column_name}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De uitkomst van ST_IsValide(.....) is een integer en geen boolean.

ogrinfo -sql "select ST_IsValid(geom) from MajorRailwaySource where id=574 " nieuwe_data/DF1_5_major_railway_source.gpkg
ST_IsValid(geom) (Integer) = 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja, mee eens. De integer uit St_IsValid() wordt in de CASE expressie gematched aan de WHEN 0 of ELSE, zie bijv.:

ogrinfo reststromen.gpkg -sql "SELECT CASE ST_IsValid(geom) WHEN 0 THEN 'Not valid' ELSE 'Valid' END AS message FROM reststromen WHERE fid=1"

@damienmulder damienmulder merged commit 8560cf9 into master Feb 5, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants