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
+7-12Lines changed: 7 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,13 @@ This is work in progress. It may change, probably has bugs and isn't properly do
6
6
7
7
The goal is to have a package that conforms to the [database.SpatialDatabase](https://github.com/whosonfirst/go-whosonfirst-spatial#spatialdatabase) interface using [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) and SQLite's [RTree](https://www.sqlite.org/rtree.html) extension.
8
8
9
-
Also, this is not as fast as it should be. This is largely with the way WOF records are inflated and passed around in order to support GeoJSON output. There is [an open ticket](https://github.com/whosonfirst/go-whosonfirst-spatial-sqlite/issues/2) to address this.
10
-
11
9
## Databases
12
10
13
11
This code depends on (4) tables as indexed by the `go-whosonfirst-sqlite-features` package:
14
12
15
13
*[rtree](https://github.com/whosonfirst/go-whosonfirst-sqlite-features#rtree) - this table is used to perform point-in-polygon spatial queries.
16
14
*[spr](https://github.com/whosonfirst/go-whosonfirst-sqlite-features#spr) - this table is used to generate [standard place response](#) (SPR) results.
17
-
*[geometry](https://github.com/whosonfirst/go-whosonfirst-sqlite-features#geometry) - this table is used to append geometries to GeoJSON-formatted results.
18
-
*[properties](https://github.com/whosonfirst/go-whosonfirst-sqlite-features#properties) - this table is used to append extra properties (to the SPR response) for GeoJSON-formatted results.
19
-
20
-
The `go-whosonfirst-sqlite-features` package also indexes a `geojson` table but it turns out that retrieving, and parsing, properties and geometries from their own tables is faster.
15
+
*[properties](https://github.com/whosonfirst/go-whosonfirst-sqlite-features#properties) - this table is used to append extra properties (to the SPR response) for `spatial.PropertiesResponseResults` responses.
21
16
22
17
Here's an example of the creating a compatible SQLite database for all the [administative data in Canada](https://github.com/whosonfirst-data/whosonfirst-data-admin-ca) using the `wof-sqlite-index-features` tool which is part of the [go-whosonfirst-sqlite-features-index](https://github.com/whosonfirst/go-whosonfirst-sqlite-features-index) package:
23
18
@@ -61,18 +56,18 @@ $> ./bin/query \
61
56
2020/12/15 15:32:06 Unable to parse placetype (alt) for ID 85633041, because 'Invalid placetype' - skipping placetype filters
62
57
2020/12/15 15:32:06 Unable to parse placetype (alt) for ID 136251273, because 'Invalid placetype' - skipping placetype filters
63
58
2020/12/15 15:32:06 Unable to parse placetype (alt) for ID 85633041, because 'Invalid placetype' - skipping placetype filters
64
-
2020/12/15 15:32:06 Time to point in polygon, 596.579126ms
65
-
"wof:id": "1108955735",
59
+
2020/12/16 13:25:32 Time to point in polygon, 395.201983ms
60
+
"wof:id": "85633041",
66
61
"wof:id": "85874359",
62
+
"wof:id": "1108955735",
67
63
"wof:id": "85874359",
68
-
"wof:id": "890458661",
69
64
"wof:id": "85633041",
65
+
"wof:id": "890458661",
70
66
"wof:id": "136251273",
71
-
"wof:id": "85633041",
72
-
"wof:id": "85633041",
73
67
"wof:id": "136251273",
74
68
"wof:id": "85633041",
75
69
"wof:id": "136251273",
70
+
"wof:id": "85633041",
76
71
```
77
72
78
73
_TBW: Indexing tables on start-up._
@@ -237,7 +232,7 @@ $> ./bin/query \
237
232
Note: This assumes a database that was previously indexed using the [whosonfirst/go-whosonfirst-sqlite-features](https://github.com/whosonfirst/go-whosonfirst-sqlite-features)`wof-sqlite-index-features` tool. For example:
0 commit comments