I removed a few test cases when importing test cases from s2geography into our Python integration tests in #816 .
# Polygon contains interior sub-polygon with shared boundary
pytest.param(
"POLYGON ((0 0, 2 0, 0 2, 0 0))",
"POLYGON ((0 0, 0.5 0, 0 0.5, 0 0))",
True,
id="polygon_contains_interior_polygon",
),
# Linestring contains an interior point
pytest.param(
"LINESTRING (0 0, 1 0)",
"POINT (0.5 0)",
True,
id="linestring_contains_interior_point",
),
# Linestring contains an interior linestring
pytest.param(
"LINESTRING (0 0, 2 0)",
"LINESTRING (0 0, 1 0)",
True,
id="linestring_contains_interior_linestring",
),
The expected values above are BigQuery's result (and I believe the result that would be expected for the geometry case). PostGIS doesn't implement Contains for geography so we can't compare that (but it does implement covers).
One of the tricky things about non-vertex boundaries in Geography is that it is exceedingly rare for a point to be exactly on a great circle between two vertices...these test cases are contrived but do expose a hole in the s2geography testing (I am not sure there's a good test case for the difference between contains and covers where the vertices are exactly the same).
I removed a few test cases when importing test cases from s2geography into our Python integration tests in #816 .
The expected values above are BigQuery's result (and I believe the result that would be expected for the geometry case). PostGIS doesn't implement Contains for geography so we can't compare that (but it does implement covers).
One of the tricky things about non-vertex boundaries in Geography is that it is exceedingly rare for a point to be exactly on a great circle between two vertices...these test cases are contrived but do expose a hole in the s2geography testing (I am not sure there's a good test case for the difference between contains and covers where the vertices are exactly the same).