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

Enable setting coord type when creating mutable arrays #277

Merged
merged 5 commits into from
Nov 28, 2023

Conversation

kylebarron
Copy link
Member

@kylebarron kylebarron commented Nov 27, 2023

Change list

  • Add new_with_options, with_capacities_and_options, etc that allow defining the coord type of the generated arrays (either interleaved or separated)

  • Convert the existing first_pass and second_pass functions for each mutable array into a private count_from_iter that takes in an iterable of geometries (implemented from traits) and an extend_from_iter that fills geometries into the array, whether or not they've been pre-allocated.

    So this is exposed to the end user as e.g. from_line_strings which takes in a slice of impl LineStringTrait and creates a MutableLineStringArray with the exact allocations. This makes the From impls super simple

  • Add Default for CoordType, setting it to Interleaved

@kylebarron kylebarron changed the title Public from methods on mutable arrays Enable setting coord type when creating mutable arrays Nov 27, 2023
JosiahParry and others added 3 commits November 27, 2023 11:11
* add multable multilinepoint array with options

* new_with_options() for MultiLineString

* new_with_options() for Polygon

* new_with_options() for MultiPolygon

* run cargo fmt

* address PR comments

* cargo fmt
@kylebarron kylebarron merged commit 774b212 into main Nov 28, 2023
6 checks passed
@kylebarron kylebarron deleted the kyle/coord-type branch November 28, 2023 03:36
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