provide some more info in GEOS errors on geojson load

This commit is contained in:
Emma Broman
2023-06-15 16:35:06 +02:00
parent 5c8ff9eec5
commit bf38d9a415

View File

@@ -231,13 +231,20 @@ void GlobeGeometryFeature::createFromSingleGeosGeometry(const geos::geom::Geomet
_type = GeometryType::Polygon;
}
catch (geos::util::IllegalStateException&) {
LERROR("Non-simple (e.g. self-intersecting) polygons not supported yet");
catch (geos::util::IllegalStateException& e) {
LERROR(fmt::format(
"Non-simple (e.g. self-intersecting) polygons not supported yet. "
"GEOS error: '{}'", e.what()
));
throw ghoul::MissingCaseException();
// TODO: handle self-intersections points
// https://www.sciencedirect.com/science/article/pii/S0304397520304199
}
catch (geos::util::GEOSException& e) {
LERROR(fmt::format("Unknown geos error: {}", e.what()));
throw ghoul::MissingCaseException();
}
break;
}
default: