Hello,
maybe I am doing something wrong here but I notice the following:
I am querying to find out if the S2LatLng.fromDegrees(-16.8583,-72.3417).toPoint() is inside the polygon:
# # -16.8583:-72.3453,-17.2876:-72.3453,-17.2876:-71.8962,-16.8583:-71.8962,-16.8583:-72.345. From my point of view it is touching the edge so the distance is zero i.e the point is contained.
When I run this in CPP (with the help of R), I see the expected:
S2ShapeIndex index = S2TextFormat.makeIndex("# #16.8583:-72.3453,-17.2876:-72.3453,-17.2876:-71.8962,-16.8583:-71.8962,-16.8583:-72.345")
S2ContainsPointQuery query= new S2ContainsPointQuery(index);
index.contains(S2LatLng.fromDegrees(-16.8583,-72.3417).toPoint());
Hello, maybe I am doing something wrong here but I notice the following:
I am querying to find out if the
S2LatLng.fromDegrees(-16.8583,-72.3417).toPoint()
is inside the polygon:# # -16.8583:-72.3453,-17.2876:-72.3453,-17.2876:-71.8962,-16.8583:-71.8962,-16.8583:-72.345
. From my point of view it is touching the edge so the distance is zero i.e the point is contained.When I run this in CPP (with the help of R), I see the expected:
s2::s2_contains(s2::s2_geog_from_text('MULTIPOLYGON(((-72.3453 -16.4279, -72.3453 -16.8583, -71.8962 -16.8583, -71.8962 -16.4279, -72.3453 -16.4279)))') , s2::s2_geog_from_text('POINT(-72.3417 -16.8583)')) TRUE
s2::s2_distance(s2::s2_geog_from_text('MULTIPOLYGON(((-72.3453 -16.4279, -72.3453 -16.8583, -71.8962 -16.8583, -71.8962 -16.4279, -72.3453 -16.4279)))') ,s2::s2_geog_from_text('POINT(-72.3417 -16.8583)'))`0
In Java I get:
S2ShapeIndex index = S2TextFormat.makeIndex("# #16.8583:-72.3453,-17.2876:-72.3453,-17.2876:-71.8962,-16.8583:-71.8962,-16.8583:-72.345") S2ContainsPointQuery query= new S2ContainsPointQuery(index); index.contains(S2LatLng.fromDegrees(-16.8583,-72.3417).toPoint());
S2ClosestEdgeQuery.Query query = S2ClosestEdgeQuery.builder() .setMaxDistance(S1ChordAngle.fromDegrees(60)) .setMaxError(S1ChordAngle.fromDegrees(0.0001)) .setMaxResults(1) .build(index);
S2ClosestEdgeQuery.PointTarget target =new S2ClosestEdgeQuery.PointTarget(pt);