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 PostGIS and GeoJSON integration/conversions #180

Merged
merged 3 commits into from
Jan 27, 2018

Conversation

eeeeeta
Copy link
Contributor

@eeeeeta eeeeeta commented Jan 21, 2018

This PR adds conversions from PostGIS types to geo primitives, and conversions from geo primitives to GeoJSON and PostGIS types.

This integration is gated behind two new features, postgis-integration and geojson-integration.

@urschrei
Copy link
Member

The PostGIS part looks great, but GeoJSON already provides fallible conversions for Geo items, however, the documentation was hidden for some reason when the original PR merged. I unhid it recently, but it won't hit docs.rs until we cut a new release, so nobody knows about it – sorry about that :/

@eeeeeta
Copy link
Contributor Author

eeeeeta commented Jan 22, 2018

@urschrei No problem - I got rid of the GeoJSON parts of this PR. Nice to know that a (better) implementation of it exists already! (Perhaps you should cut a new release? I don't know...)

Anyway, let me know if there's anything more you want me to do w.r.t. the PostGIS integration stuff.

@eeeeeta
Copy link
Contributor Author

eeeeeta commented Jan 22, 2018

Err, now I've gotten rid of the GeoJSON parts... (missed an extern crate statement).

@urschrei urschrei requested a review from frewsxcv January 22, 2018 17:06
@urschrei
Copy link
Member

Perhaps you should cut a new release?

Yes, absolutely. I thought we had after I updated the docs last time, but it seems we didn't. Anyway, the PostGIS conversions lgtm.

@frewsxcv
Copy link
Member

this looks good to me! when i originally was thinking about this crate, i had envisioned 'geo' not having many dependencies and all of the associated crates (e.g. geojson, postgis, gpx) would have all of the conversion logic. but after seeing this pull request, it seems appropriate to have it live in this crate by an opt-in feature flag, good idea!

thanks for the contribution!

bors r+

bors bot added a commit that referenced this pull request Jan 27, 2018
180: Add PostGIS and GeoJSON integration/conversions r=frewsxcv a=eeeeeta

This PR adds conversions from PostGIS types to `geo` primitives, and conversions from `geo` primitives to GeoJSON and PostGIS types.

This integration is gated behind two new features, `postgis-integration` and `geojson-integration`.
@bors
Copy link
Contributor

bors bot commented Jan 27, 2018

Build succeeded

@bors bors bot merged commit 5b877e3 into georust:master Jan 27, 2018
bors bot added a commit that referenced this pull request Feb 4, 2018
183: Add Haversine length algorithm r=frewsxcv a=eeeeeta

This PR adds a new algorithm, `haversine_length`, that computes the "Haversine length" of a line or linestring - i.e. the sum of the Haversine distances between every two points in the line.

It also reexports this algorithm, and the PostGIS algorithms introduced in #180, in the prelude (because I realised I forgot to reexport them in #180...)
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.

3 participants