Skip to content

Commit

Permalink
support full geojson export of GEOMETRYCOLLECTIONs
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbr committed Sep 25, 2024
1 parent 192001d commit d50e65c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 0 additions & 8 deletions src/qlever-petrimaps/GeomCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,14 +831,6 @@ std::vector<size_t> GeomCache::getGeomStarts(const std::string &str, size_t p) {
a++;
}

a = p;
while (1) {
a = str.find("GEOMETRYCOLLECTION(", a);
if (a == std::string::npos) break;
starts.push_back(a);
a++;
}

starts.push_back(std::string::npos);

std::sort(starts.begin(), starts.end());
Expand Down
7 changes: 7 additions & 0 deletions src/qlever-petrimaps/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,13 @@ util::http::Answer Server::handleExportReq(const Params& pars, int sock) const {
first = true;
} catch (std::runtime_error& e) {
}
try {
auto geom = util::geo::collectionFromWKT<double>(wkt);
if (first) ss << ",";
geoJsonOut.print(geom, dict);
first = true;
} catch (std::runtime_error& e) {
}
ss << "\n";
}

Expand Down
2 changes: 1 addition & 1 deletion src/util
Submodule util updated 1 files
+126 −9 geo/Geo.h

0 comments on commit d50e65c

Please sign in to comment.