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

downcast geometry array #918

Merged
merged 9 commits into from
Dec 10, 2024
Merged

downcast geometry array #918

merged 9 commits into from
Dec 10, 2024

Conversation

kylebarron
Copy link
Member

@kylebarron kylebarron commented Dec 7, 2024

todo:

  • Change downcast to be implemented in terms of resolve_types and cast.
  • Handle slicing in GeometryArray::has_points. I.e. bring back the slice offset and length. Then if the array has been sliced and the point array exists, check if the point values are within the bounds of the current slice. The fastest way to do this should be to check the length of the point array, then as you're iterating through the type_ids array, once you've seen that many ids pointing to the point array, you know the array is fully there. Or, in the cast of downcasting you really only care about whether any geometry exists. So you can short-circuit as soon as you've seen the first point.
  • Ensure we apply slicing when exporting the GeometryArray. E.g. in the TryFrom impl from GeometryArray to PointArray, we need to call the slice when we export.
  • recursively expand the types from the geometry collection array. But only if the geometry collection array has only a single geometry per row and it could be split up.

Closes #416

@kylebarron kylebarron enabled auto-merge (squash) December 10, 2024 17:00
@kylebarron kylebarron merged commit 9e68c71 into main Dec 10, 2024
22 checks passed
@kylebarron kylebarron deleted the kyle/downcast-geometry-array branch December 10, 2024 17:07
@kylebarron kylebarron mentioned this pull request Dec 10, 2024
4 tasks
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.

Casting and downcasting follow ups
1 participant