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
{{ message }}
This repository was archived by the owner on Dec 13, 2024. It is now read-only.
Index all tables (except the 'search' and 'geometries' tables which you need to specify explicitly)
27
26
-ancestors
28
27
Index the 'ancestors' tables
29
28
-concordances
30
29
Index the 'concordances' tables
31
-
-driver string
32
-
(default "sqlite3")
33
-
-dsn string
34
-
(default ":memory:")
30
+
-database-uri string
31
+
(default "modernc://mem")
35
32
-geojson
36
33
Index the 'geojson' table
37
34
-geometries
38
35
Index the 'geometries' table (requires that libspatialite already be installed)
39
-
-geometry
40
-
Index the 'geometry' table
41
36
-index-alt-files
42
37
Index alt geometries
43
38
-index-relations
44
39
Index the records related to a feature, specifically wof:belongsto, wof:depicts and wof:involves. Alt files for relations are not indexed at this time.
45
40
-index-relations-reader-uri string
46
41
A valid go-reader.Reader URI from which to read data for a relations candidate.
47
42
-iterator-uri string
48
-
A valid whosonfirst/go-whosonfirst-iterate/emitter URI. Supported emitter URI schemes are: directory://,featurecollection://,file://,filelist://,geojsonl://,git://,repo:// (default "repo://")
43
+
A valid whosonfirst/go-whosonfirst-iterate/v2 URI. Supported emitter URI schemes are: directory://,featurecollection://,file://,filelist://,geojsonl://,git://,null://,repo:// (default "repo://")
49
44
-live-hard-die-fast
50
45
Enable various performance-related pragmas at the expense of possible (unlikely) database corruption (default true)
51
-
-mode string
52
-
A valid whosonfirst/go-whosonfirst-iterate/emitter URI. Supported emitter URI schemes are: directory://,featurecollection://,file://,filelist://,geojsonl://,git://,repo://. THIS FLAG IS DEPRECATED, please use -iterator-uri instead. (default "repo://")
53
46
-names
54
47
Index the 'names' table
55
48
-optimize
56
49
Attempt to optimize the database before closing connection (default true)
57
50
-processes int
58
-
The number of concurrent processes to index data with (default 16)
51
+
The number of concurrent processes to index data with (default 8)
59
52
-properties
60
53
Index the 'properties' table
61
54
-rtree
62
55
Index the 'rtree' table
63
56
-search
64
57
Index the 'search' table (using SQLite FTS4 full-text indexer)
58
+
-spatial-tables
59
+
If true then index the necessary tables for use with the whosonfirst/go-whosonfirst-spatial-sqlite package.
Spatial indexes are also available if you have the [Spatialite extension](https://www.gaia-gis.it/fossil/libspatialite/index) installed and have indexed the `geometries` table. For example:
sqlite> SELECT s.id, s.name FROM spr s, geometries g WHERE ST_Intersects(g.geom, GeomFromText('POINT(-122.229137 49.450129)', 4326)) AND g.id = s.id;
216
-
1108962831|Maple Ridge-Pitt Meadows
217
-
```
218
-
219
-
Or:
220
-
221
-
```
222
-
> spatialite whosonfirst-data-latest.db
223
-
SpatiaLite version ..: 4.1.1 Supported Extensions:
224
-
...spatialite chatter goes here...
225
-
SQLite version 3.8.2 2013-12-06 14:53:30
226
-
Enter ".help" for instructions
227
-
Enter SQL statements terminated with a ";
228
-
229
-
spatialite> SELECT s.id, s.name FROM spr AS s, geometries AS g1, geometries AS g2 WHERE g1.id = 85834637 AND s.placetype = 'neighbourhood' AND g2.id = s.id AND ST_Touches(g1.geom, g2.geom) AND g2.ROWID IN (SELECT ROWID FROM SpatialIndex WHERE f_table_name = 'geometries' AND search_frame=g2.geom);
230
-
102112179|La Lengua
231
-
1108831803|Showplace Square
232
-
233
-
spatialite> SELECT s.id, s.name FROM spr AS s, geometries AS g1, geometries AS g2 WHERE g1.id != g2.id AND g1.id = 85865959 AND s.placetype = 'neighbourhood' AND s.is_current=1 AND g2.id = s.id AND (ST_Touches(g1.geom, g2.geom) OR ST_Intersects(g1.geom, g2.geom)) AND g2.ROWID IN (SELECT ROWID FROM SpatialIndex WHERE f_table_name = 'geometries' AND search_frame=g2.geom);
234
-
1108831807|Fairmount
235
-
85814471|Diamond Heights
236
-
85869221|Eureka Valley
237
-
238
-
SELECT s.id, s.name, s.is_current FROM spr AS s, geometries AS g1, geometries AS g2 WHERE g1.id != g2.id AND g1.id = 102061079 AND s.placetype = 'neighbourhood' AND g2.id = s.id AND (ST_Touches(g1.geom, g2.geom) OR ST_Intersects(g1.geom, g2.geom)) AND g2.ROWID IN (SELECT ROWID FROM SpatialIndex WHERE f_table_name = 'geometries' AND search_frame=g2.geom);
239
-
85892915|BoCoCa|0
240
-
85869125|Boerum Hill|1
241
-
420782915|Carroll Gardens|1
242
-
85865587|Gowanus|1
243
-
```
244
-
245
-
_Remember: When indexing geometries you will need to explcitly pass both the `-geometries` and `-driver spatialite` flags, even if you are already passing in the `-all` flag. This is so `-all` will continue to work as expected for people who don't have Spatialite installed on their computer._
246
-
247
189
## Indexing
248
190
249
191
Indexing time will vary depending on the specifics of your hardware (available RAM, CPU, disk I/O) but as a rule building indexes with the `geometries` table will take longer, and create a larger database, than doing so without. For example indexing the [whosonfirst-data](https://github.com/whosonfirst-data/whosonfirst-data) repository with spatial indexes:
0 commit comments