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

Fix WKT for empty geometry collections #132

Merged
merged 1 commit into from
Nov 30, 2024
Merged

Fix WKT for empty geometry collections #132

merged 1 commit into from
Nov 30, 2024

Conversation

LachlanArthur
Copy link
Contributor

Empty geometry collections should generate their WKT as GEOMETRYCOLLECTION EMPTY instead of GEOMETRYCOLLECTION()

$empty = new MatanYadaev\EloquentSpatial\Objects\GeometryCollection([], 4326);

$emptyWkt = $empty->toWkt();
// "GEOMETRYCOLLECTION()"

$parsed = MatanYadaev\EloquentSpatial\Objects\Geometry::fromWkt($emptyWkt, 4326);
// InvalidArgumentException: Invalid spatial value.

@MatanYadaev MatanYadaev merged commit 102db62 into MatanYadaev:master Nov 30, 2024
@MatanYadaev
Copy link
Owner

Thanks @LachlanArthur!

@LachlanArthur LachlanArthur deleted the lachlan/fix-empty-geometrycollection-wkt branch December 1, 2024 23:10
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.

2 participants