Skip to content

convert 3d and 4d geometries to 2d#136

Merged
missinglink merged 1 commit intomasterfrom
cast_2d
Nov 12, 2025
Merged

convert 3d and 4d geometries to 2d#136
missinglink merged 1 commit intomasterfrom
cast_2d

Conversation

@missinglink
Copy link
Member

Strip Z/M coordinates to avoid WKB format mismatch

WKB encodes 3D geometries differently: legacy format uses type+1000 (e.g., 0x03eb for PolygonZ), while ISO format uses type|0x80000000 (e.g., 0x80000003).

The wkx library outputs ISO format when SRID is set, but spatialite/duckdb expect legacy.
Converting to 2D avoids this mismatch entirely.

This PR avoids invalid geometries for the two WOF features with 3D geometry by stripping the 3rd and 4th dimensions (where available).

@missinglink missinglink merged commit f776a59 into master Nov 12, 2025
6 checks passed
@missinglink missinglink deleted the cast_2d branch November 12, 2025 09:57
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.

1 participant