Skip to content

Additional ergonomic constructors (for Geometry and FeatureCollection)#271

Merged
michaelkirk merged 3 commits into
mainfrom
mkirk/ergonomic-geometry
Feb 24, 2026
Merged

Additional ergonomic constructors (for Geometry and FeatureCollection)#271
michaelkirk merged 3 commits into
mainfrom
mkirk/ergonomic-geometry

Conversation

@michaelkirk
Copy link
Copy Markdown
Member

@michaelkirk michaelkirk commented Jan 31, 2026

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

Based on #270, so please review that first. If we decide not to merge #270, I can rebase this.

Like #265, but for Geometry, not GeometryValue, and added a FeatureCollection::new(features) which I expect will be more discoverable than features.into_iter().collect::<FeatureCollection>().

I also touched up the docs a bit.

This is a bit of a junk drawer polishing pull request. I could open a PR for each commit, but I think they're all pretty simple.

@michaelkirk michaelkirk mentioned this pull request Feb 18, 2026
Comment thread src/feature_collection.rs
}

impl FeatureCollection {
/// Construct a `FeatureCollection` from an iterator of Features (or things that can be turned `Into` a Feature)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very convenient new API :)

@michaelkirk michaelkirk force-pushed the mkirk/remove-json-methods branch 5 times, most recently from f2b755b to 8752c60 Compare February 23, 2026 19:39
Base automatically changed from mkirk/remove-json-methods to main February 24, 2026 00:56
We have a lot of places where we build a GeometryValue and then convert
it to a Geometry. Building the Geometry directly is a little cleaner.
I think it'll be easier for people to find
FeatureCollection::new(features) rather than
features.into_iter().collect();
@michaelkirk michaelkirk force-pushed the mkirk/ergonomic-geometry branch from 5f835a6 to 54c335d Compare February 24, 2026 01:01
@michaelkirk michaelkirk added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 3c362b4 Feb 24, 2026
3 checks passed
@michaelkirk michaelkirk deleted the mkirk/ergonomic-geometry branch February 24, 2026 01:08
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