Replace cellsToLinkedMultiPolygon backend with cellsToMultiPolygon#1136
Merged
Conversation
isaacbrodsky
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
cellsToLinkedMultiPolygonnow usescellsToMultiPolygoninternally (Add LinkedGeo <-> GeoMultiPolygon conversion functions #1126, MakecellsToLinkedMultiPolygontests order independent #1133, Replace cellsToLinkedMultiPolygon backend with cellsToMultiPolygon #1136)cellsToLinkedMultiPolygon(andcellsToMultiPolygon) now return errors for invalid cells (E_CELL_INVALID), mixed resolutions (E_RES_MISMATCH), and duplicate cells(
E_DOMAIN) instead of producing undefined outputdestroyLinkedMultiPolygonis now idempotent (safe to call twice) (Replace cellsToLinkedMultiPolygon backend with cellsToMultiPolygon #1136)Notes
Discussion
We should discuss the new invalid input behavior. We now raise errors instead of having undefined behavior on invalid, duplicate, or mixed resolution cells. Alternatively, we might automatically de-dupe for the user without raising an error, for example.
I'm in favor of the strict behavior; it helped us find one bug in the CLI recently with #1124.
Note that we can start strict and relax later without making a breaking API change. Relaxing an error into a success is backwards-compatible, but adding a new error to previously-accepted input is not. So strict is the safer starting point.
All that being said, it might be prudent to hold off on finalizing these APIs and releasing a new version until we implement
uncompactCellsToMultiPolygonand #1114. Since we'll have a few functions with different expectations on inputs, it would be helpful to have them all in hand at once to figure out what the APIs should look like, and hopefully make them intelligible to end users.