Skip to content

Commit

Permalink
AER-6605 - reverted to previous behavior - removed validity checks fo…
Browse files Browse the repository at this point in the history
…r loop, polygon and circle - these caused rare odd results which require investigation.
  • Loading branch information
gooding470 committed Mar 16, 2023
1 parent a09cf7b commit f6639d9
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions as/src/geospatial/geojson.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ traverse_loop(json_t * vertices)

unique_ptr<S2Loop> loop(new S2Loop(points));

if (! loop->IsValid()) {
throwstream(runtime_error, "invalid loop");
}
// TODO - caused rare odd results - be conservative until we know more.
// if (! loop->IsValid()) {
// throwstream(runtime_error, "invalid loop");
// }

loop->Normalize();
return loop;
Expand All @@ -155,9 +156,10 @@ traverse_polygon(json_t * loops)

unique_ptr<S2Polygon> polygon = make_unique<S2Polygon>(move(loopv));

if (! polygon->IsValid()) {
throwstream(runtime_error, "invalid polygon");
}
// TODO - caused rare odd results - be conservative until we know more.
// if (! polygon->IsValid()) {
// throwstream(runtime_error, "invalid polygon");
// }

return polygon;
}
Expand Down Expand Up @@ -245,9 +247,10 @@ process_circle(GeoJSON::GeometryHandler & geohand, json_t * coord)

unique_ptr<S2Cap> capp(new S2Cap(center, angle));

if (! capp->is_valid()) {
throwstream(runtime_error, "invalid circle");
}
// TODO - caused rare odd results - be conservative until we know more.
// if (! capp->is_valid()) {
// throwstream(runtime_error, "invalid circle");
// }

geohand.handle_region(capp.release());
}
Expand Down

0 comments on commit f6639d9

Please sign in to comment.