Commit af27e9d9 authored by Volker Krause's avatar Volker Krause
Browse files

Fix reading of GeoJson multi-polygons

parent 9febf722
...@@ -68,11 +68,11 @@ QPolygonF GeoJson::readOuterPolygon(const QJsonObject &obj) ...@@ -68,11 +68,11 @@ QPolygonF GeoJson::readOuterPolygon(const QJsonObject &obj)
const auto coordinates = obj.value(QLatin1String("coordinates")).toArray(); const auto coordinates = obj.value(QLatin1String("coordinates")).toArray();
QPolygonF poly; QPolygonF poly;
for (const auto &polyV : coordinates) { for (const auto &polyV : coordinates) {
const auto polyCoords = polyV.toArray(); const auto polyElements = polyV.toArray();
if (polyCoords.empty()) { if (polyElements.empty()) {
return {}; return {};
} }
auto subPoly = readPolygonCoordinates(polyCoords); auto subPoly = readPolygonCoordinates(polyElements.at(0).toArray());
poly = poly.empty() ? std::move(subPoly) : poly.united(subPoly); poly = poly.empty() ? std::move(subPoly) : poly.united(subPoly);
} }
return poly; return poly;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment