Originally posted by **metonymic-smokey** July 18, 2022
Hey @jmr ,
The query I ran was a 'contains' query on a polygon, with the indexed shapes being points. One of the points I received as a hit was unexpected since it lies outside the polygon, although it's close to the edge.
The below screenshot is a visualisation of the query polygon and the point returned:
![image](https://user-images.githubusercontent.com/48997495/179445003-d1cf3620-f57f-43ef-881d-0148c8abdefa.png)
This is the test for this case:
```
TEST(S2NonWithIn, AllCases) {
vector pts(4);
S2LatLng latlng;
pts[0] = latlng.FromDegrees(41.959368254132166, 7.222348606851546).ToPoint();
pts[1] = latlng.FromDegrees(2.3184942494899996, 13.459529974343564).ToPoint();
pts[2] = latlng.FromDegrees(7.813467030273539, 61.085156337800264).ToPoint();
pts[3] = latlng.FromDegrees(41.00990312902452, 74.64247754703456).ToPoint();
S2Loop* loop = new S2Loop(pts);
EXPECT_EQ(true, loop->IsValid());
EXPECT_EQ(true, loop->IsNormalized());
vector> loops;
loops.emplace_back(loop);
S2Polygon polygon1 = S2Polygon(std::move(loops));
EXPECT_EQ(true, polygon1.IsValid());
// point lies outside
S2Point point = latlng.FromDegrees(41.44166591306549, 54.18990767747903).ToPoint();
bool contains = polygon1.Contains(point);
EXPECT_EQ(false, contains);
}
```
I have validated the vertices using [geojsonlint](https://geojsonlint.com/), so I think the polygon vertices would comply with the spec.
Any leads on these results would be appreciated.
Thanks!
Discussed in https://github.com/google/s2geometry/discussions/264