Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into improve-get-geometr…
Browse files Browse the repository at this point in the history
…ies-queries
  • Loading branch information
Hannah Bast committed Sep 24, 2024
2 parents f01c8e8 + bf93caf commit a071670
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[![Build](https://github.com/ad-freiburg/qlever-petrimaps/actions/workflows/build.yml/badge.svg)](https://github.com/ad-freiburg/qlever-petrimaps/actions/workflows/build.yml)
# QLever petrimaps
# QLever Petrimaps

Visualization of geospatial SPARQL query results for QLever on a map, either as individual objects or as a heatmap. Can handle hundreds of millions of result rows, tested with over 200 million results (all streets in OSM). Implemented as a middle-end / middleware.
This is still very much hacked-together, use with care.
Interactive visualization of SPARQL query results with geospatial information on a map, either as individual objects or as a heatmap. Petrimaps can display **hundreds of millions of objects** interactively, for example, a heatmap of all the streets in a given country, or even in the whole world. Petrimaps is implemented as a middleware. In the [QLever UI](https://github.com/ad-freiburg/qlever-ui), whenever a SPARQL result has WKT literals in its last column, a "Map view" button is displayed, which leads to an instance of Petrimaps.

Examples: [All railway lines in OSM](http://qlever.cs.uni-freiburg.de/mapui-petri/?query=PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E+PREFIX+geo%3A+%3Chttp%3A%2F%2Fwww.opengis.net%2Font%2Fgeosparql%23%3E+PREFIX+osmkey%3A+%3Chttps%3A%2F%2Fwww.openstreetmap.org%2Fwiki%2FKey%3A%3E+PREFIX+osm%3A+%3Chttps%3A%2F%2Fwww.openstreetmap.org%2F%3E+PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E+SELECT+%3Fosm_id+%3Fgeometry+WHERE+%7B+%3Fosm_id+osmkey%3Arailway+%3Frail+.+%3Fosm_id+rdf%3Atype+osm%3Away+.+%3Fosm_id+geo%3AhasGeometry%2Fgeo%3AasWKT+%3Fgeometry+%7D&backend=https%3A%2F%2Fqlever.cs.uni-freiburg.de%2Fapi%2Fosm-planet), [All buildings in Germany in OSM](http://qlever.cs.uni-freiburg.de/mapui-petri/?query=PREFIX%20geo%3A%20%3Chttp%3A%2F%2Fwww.opengis.net%2Font%2Fgeosparql%23%3E%20PREFIX%20osmkey%3A%20%3Chttps%3A%2F%2Fwww.openstreetmap.org%2Fwiki%2FKey%3A%3E%20PREFIX%20ogc%3A%20%3Chttp%3A%2F%2Fwww.opengis.net%2Frdf%23%3E%20PREFIX%20osmrel%3A%20%3Chttps%3A%2F%2Fwww.openstreetmap.org%2Frelation%2F%3E%20SELECT%20%3Fosm_id%20%3Fhasgeometry%20WHERE%20%7B%20osmrel%3A51477%20ogc%3AsfContains%20%3Fosm_id%20.%20%3Fosm_id%20geo%3AhasGeometry%2Fgeo%3AasWKT%20%3Fhasgeometry%20.%20%3Fosm_id%20osmkey%3Abuilding%20%3Fbuilding%20%7D&backend=https%3A%2F%2Fqlever.cs.uni-freiburg.de%2Fapi%2Fosm-planet)
Here are two example queries: [All railway lines in OSM](https://qlever.cs.uni-freiburg.de/petrimaps/?query=PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E+PREFIX+geo%3A+%3Chttp%3A%2F%2Fwww.opengis.net%2Font%2Fgeosparql%23%3E+PREFIX+osmkey%3A+%3Chttps%3A%2F%2Fwww.openstreetmap.org%2Fwiki%2FKey%3A%3E+PREFIX+osm%3A+%3Chttps%3A%2F%2Fwww.openstreetmap.org%2F%3E+PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E+SELECT+%3Fosm_id+%3Fgeometry+WHERE+%7B+%3Fosm_id+osmkey%3Arailway+%3Frail+.+%3Fosm_id+rdf%3Atype+osm%3Away+.+%3Fosm_id+geo%3AhasGeometry%2Fgeo%3AasWKT+%3Fgeometry+%7D&backend=https%3A%2F%2Fqlever.cs.uni-freiburg.de%2Fapi%2Fosm-planet), [All streets in Germany in OSM](https://qlever.cs.uni-freiburg.de/petrimaps/?query=PREFIX+ogc%3A+%3Chttp%3A%2F%2Fwww.opengis.net%2Frdf%23%3E+PREFIX+osmrel%3A+%3Chttps%3A%2F%2Fwww.openstreetmap.org%2Frelation%2F%3E+PREFIX+geo%3A+%3Chttp%3A%2F%2Fwww.opengis.net%2Font%2Fgeosparql%23%3E+PREFIX+osm%3A+%3Chttps%3A%2F%2Fwww.openstreetmap.org%2F%3E+PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E+PREFIX+osmkey%3A+%3Chttps%3A%2F%2Fwww.openstreetmap.org%2Fwiki%2FKey%3A%3E+SELECT+%3Fosm_id+%3Fshape+WHERE+%7B+osmrel%3A51477+ogc%3AsfContains+%3Fosm_id+.+%3Fosm_id+osmkey%3Ahighway+%3Fhighway+.+%3Fosm_id+rdf%3Atype+osm%3Away+.+%3Fosm_id+geo%3AhasGeometry%2Fgeo%3AasWKT+%3Fshape+%7D&backend=https%3A%2F%2Fqlever.cs.uni-freiburg.de%2Fapi%2Fosm-planet).

## Requirements
* gcc > 5.0 || clang > 3.9
Expand Down
4 changes: 0 additions & 4 deletions src/qlever-petrimaps/GeomCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ void GeomCache::parse(const char *c, size_t size) {
_linesFSize++;
insertLine(line, false);

if (line.size() > 10000) {
std::cout << _dangling << std::endl;
}

IdMapping idm{0, I_OFFSET + _linesFSize - 1};
_lastQidToId = idm;
_qidToIdF.write(reinterpret_cast<const char *>(&idm),
Expand Down

0 comments on commit a071670

Please sign in to comment.