You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-34Lines changed: 46 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,71 +3,83 @@ Tool for creating index-free s2 coverings, at any level
3
3
4
4
## Background
5
5
6
-
[S2](http://s2geometry.io/) is a spatial grid system with hierarchy, designed to be easily indexed and queried. Knowledge graphs commonly make use of different geospatial indices for linking spatial data to areas.
6
+
[S2](http://s2geometry.io/) is a spatial grid system with hierarchy, designed to be easily indexed and queried. Knowledge graphs commonly make use of geospatial indices as ways to connect geospatial data.
7
7
8
-
At the moment, many graph databases don't have native support for making use of the s2 index system. That's where this tool comes into play.
9
8
10
-
Rather than relying on geosparql functions (which in turn rely on geosparql support and indices), you can instead pre-materialize the relations between cells and query them though the KnowWhereGraph ontology.
9
+
Rather than relying on geosparql functions (which in turn rely on geosparql support), you can instead
10
+
1. Generate the global spatial index (create s2 cells, as rdf statements)
11
+
2. Pre-materialize the relations between cells (connect s2 cells with RCC8 relations)
12
+
3. Integrate your own geometries with the S2 cells (connect the geometry to s2 cells with RCC*)
11
13
12
14
This breaks the reliance on the need for the graph database to support s2 indexing and instead make use of the predicate index from the pre-materialized spatial relations.
13
15
14
16
## Cell Generation and Integration
15
17
16
18
There are two tools:
17
19
18
-
1. s2.py: This generates the S2 cell structure at a desired layer. For example, generating cells at level 3 and 4.
20
+
1. s2.py: This generates the S2 cell structure at a desired layer, or for an existing set of geometries
19
21
2. integrate.py: This performs s2 integrations against existing geometries. These may be your own geometries, they may be the output of the s2 tool.
20
22
21
-
## Running
22
-
23
-
### Docker
24
23
24
+
## Running
25
25
The project dependencies can be difficult to install; docker images are provided so that the code can be run in different environments without needing to install dependencies. Rather than offering a docker image for each cript, both scripts are included in the image and they can be called externally
26
26
27
-
####Generating S2 Cells
27
+
### Generating S2 Cells for a Level
28
28
29
+
Given a target S2 level, the s2 generation script will generate s2 cells at the target level.
Results will be written to the `output/` folder. The results can then be loaded into your graph database and queried. For more information on querying with the KnowWhereGraph ontology, visit the [docs site](https://knowwheregraph.github.io/#/).
53
-
54
-
### Locally
55
-
56
-
Due to the steps involved with installing the s2 libray bindings and different approaches needed for each architecture - running outside of Docker isn't supported. If you're inspired, the Dockerfile has all necessary steps to install the requirements to run the tool.
0 commit comments