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

Add quick_collection function and revise docs. #122

Merged
merged 9 commits into from
Feb 14, 2020

Conversation

urschrei
Copy link
Member

@urschrei urschrei commented Jan 2, 2020

The quick_collection function is essentially a port of the functionality provided by @lelongg's https://github.com/lelongg/geo-geojson crate: it accepts an arbitrary geojson::GeoJson object, and produces a geo::GeometryCollection for users who just want to process their geometries using geo's functionality (I suspect this is the primary use case for a lot of users).

The docs have been revised to add more detail about the structure of the crate, how to get started etc, and details about what quick_collection does and how it works. They now explicitly point out that you must enable the geo-types feature in order to use the conversion traits and quick_collection – I'm on the fence as to whether this should all just be enabled by default.

As I point out, quick_collection potentially sacrifices a little performance due to the use of clone() and creating new Vecs. I don't think we can do much about the latter, but if anyone wants to have a look at the clone() stuff feel free.

@urschrei urschrei requested a review from frewsxcv January 2, 2020 21:58
src/conversion.rs Outdated Show resolved Hide resolved
@@ -163,6 +170,7 @@ where
)
}

#[cfg_attr(docsrs, doc(cfg(feature = "geo-types")))]
Copy link
Member

Choose a reason for hiding this comment

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

what does this do?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a docs.rs directive that calls something out as only being available if a specific feature (in this case geo-types) is enabled. I can't find the docs for it anywhere now (of course), but it's used in quite a few places.

@urschrei
Copy link
Member Author

bors r+

bors bot added a commit that referenced this pull request Feb 14, 2020
122: Add quick_collection function and revise docs. r=urschrei a=urschrei

The `quick_collection` function is essentially a port of the functionality provided by @lelongg's https://github.com/lelongg/geo-geojson crate: it accepts an arbitrary `geojson::GeoJson` object, and produces a `geo::GeometryCollection` for users who just want to process their geometries using `geo`'s functionality (I suspect this is the primary use case for a lot of users).

The docs have been revised to add more detail about the structure of the crate, how to get started etc, and details about what `quick_collection` does and how it works. They now explicitly point out that you **must** enable the `geo-types` feature in order to use the conversion traits and `quick_collection` – I'm on the fence as to whether this should all just be enabled by default.

As I point out, `quick_collection` potentially sacrifices a little performance due to the use of `clone()` and creating new `Vec`s. I don't think we can do much about the latter, but if anyone wants to have a look at the clone() stuff feel free.

Co-authored-by: Stephan Hügel <shugel@tcd.ie>
Co-authored-by: Stephan Hügel <urschrei@gmail.com>
@bors
Copy link
Contributor

bors bot commented Feb 14, 2020

Build succeeded

@bors bors bot merged commit 505b6fd into georust:master Feb 14, 2020
@urschrei urschrei deleted the quick_collection branch September 2, 2020 16:48
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