We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello There,
we noticed that Contains method returns false sometimes.
Contains
false
Ex: https://play.golang.org/p/WqDx36fG4rG
package main import ( "fmt" "github.com/golang/geo/s2" ) func main() { polygon := s2.PolygonFromLoops([]*s2.Loop{ s2.LoopFromPoints([]s2.Point{ s2.PointFromLatLng(s2.LatLngFromDegrees(-38.0, -135.0)), s2.PointFromLatLng(s2.LatLngFromDegrees(-38.0, 149.0)), s2.PointFromLatLng(s2.LatLngFromDegrees(77.0, 149.0)), s2.PointFromLatLng(s2.LatLngFromDegrees(77.0, -135.0)), s2.PointFromLatLng(s2.LatLngFromDegrees(-38.0, -135.0)), }), }) tile := s2.PolygonFromLoops([]*s2.Loop{ s2.LoopFromPoints([]s2.Point{ s2.PointFromLatLng(s2.LatLngFromDegrees(37.99616267972809, 13.007812500000002)), s2.PointFromLatLng(s2.LatLngFromDegrees(37.99616267972809, 13.359375000000002)), s2.PointFromLatLng(s2.LatLngFromDegrees(38.272819658516866, 13.359375000000002)), s2.PointFromLatLng(s2.LatLngFromDegrees(38.272819658516866, 13.007812500000002)), s2.PointFromLatLng(s2.LatLngFromDegrees(37.99616267972809, 13.007812500000002)), }), }) // +0.2 lat +0.2 lon tileExtended := s2.PolygonFromLoops([]*s2.Loop{ s2.LoopFromPoints([]s2.Point{ s2.PointFromLatLng(s2.LatLngFromDegrees(37.99616267972809, 13.007812500000002)), s2.PointFromLatLng(s2.LatLngFromDegrees(37.99616267972809, 13.559375000000002)), s2.PointFromLatLng(s2.LatLngFromDegrees(38.472819658516866, 13.559375000000002)), s2.PointFromLatLng(s2.LatLngFromDegrees(38.472819658516866, 13.007812500000002)), s2.PointFromLatLng(s2.LatLngFromDegrees(37.99616267972809, 13.007812500000002)), }), }) fmt.Println(polygon.Contains(tile)) fmt.Println(polygon.Contains(tileExtended)) }
Returns
false true Program exited.
However, all these geometries (tile & tileExtended) are contained in polygon.
Maybe, this might be linked to #77
The text was updated successfully, but these errors were encountered:
Yes @gcollot, this is related to #77.
Sorry, something went wrong.
No branches or pull requests
Hello There,
we noticed that
Contains
method returnsfalse
sometimes.Ex: https://play.golang.org/p/WqDx36fG4rG
Returns
However, all these geometries (tile & tileExtended) are contained in polygon.
Maybe, this might be linked to #77
The text was updated successfully, but these errors were encountered: