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

Support 'POINT EMPTY' conversion to geo_types #64

Merged
merged 4 commits into from
Mar 2, 2021

Conversation

rmanoka
Copy link
Contributor

@rmanoka rmanoka commented Mar 2, 2021

  • 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.

closes #61

+ support in Geometry<T>
+ support in deserialize_point
It seems to have been broken from earlier
Copy link
Member

@michaelkirk michaelkirk left a comment

Choose a reason for hiding this comment

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

Excellent! Thanks for taking this one!

I see one failing test when I run locally:

failures:

---- conversion::tests::convert_empty_point stdout ----
thread 'conversion::tests::convert_empty_point' panicked at 'assertion failed: res.is_err()', src/conversion.rs:370:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    conversion::tests::convert_empty_point

test result: FAILED. 60 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.11s

Geometry::Point(g) => geo_types::Geometry::Point(g.try_into()?),
Geometry::Point(g) => {
// Special case as `geo::Point` can't be empty
if g.0.is_some() {
Copy link
Member

Choose a reason for hiding this comment

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

Very minor thing, but we should be able to write this in an infallible way, like:

 if let Some(c) = g.0 {
    geo_types::Geometry::Point(geo_types::Point(c.into()))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to allow any other error handling / extensions we might add in the future here.

@rmanoka
Copy link
Contributor Author

rmanoka commented Mar 2, 2021

failures:
    conversion::tests::convert_empty_point

test result: FAILED. 60 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.11s

Good catch! I overlooked this test.

@michaelkirk
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 2, 2021

Build succeeded:

@bors bors bot merged commit aa202b3 into georust:master Mar 2, 2021
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.

POINT EMPTY vis-à-vis geo_types
3 participants