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

Simple example for LineString containing a Point fails #452

Closed
frewsxcv opened this issue May 8, 2020 · 1 comment · Fixed by #500
Closed

Simple example for LineString containing a Point fails #452

frewsxcv opened this issue May 8, 2020 · 1 comment · Fixed by #500
Labels

Comments

@frewsxcv
Copy link
Member

frewsxcv commented May 8, 2020

From @michaelkirk's comment here:

This example I contrived fails:

use geo::algorithm::contains::Contains;
use geo::{LineString, Point};

let line_string = LineString::from(vec![(0., 0.), (3., 3.)]);
let point_on_line = Point::new(1., 1.);
assert!(line_string.contains(&point_on_line)); // <- 💥 currently fails

I don't think this was a change in behavior with this PR, but at least one point of comparison, postgis, agrees that we should change it so that my example passes:

psql> SELECT ST_Contains(
  ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(3,3)),
  ST_MakePoint(1,1)
);

st_contains 
-------------
 t
@frewsxcv
Copy link
Member Author

frewsxcv commented May 8, 2020

This may be related to #415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant