forked from gravitystorm/openstreetmap-carto
-
Notifications
You must be signed in to change notification settings - Fork 20
/
indexes-hstore.yml
48 lines (47 loc) · 1.84 KB
/
indexes-hstore.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# A goal with the indexes is to have them general-purpose enough to not need
# frequent changing with stylesheet changes, but to be usable with many
# versions, and potentially other styles.
point:
# The point table is small, but so are the partial indexes
place:
where: (tags->'place') IS NOT NULL AND (tags->'name') IS NOT NULL
line:
label:
where: (tags->'name') IS NOT NULL OR (tags->'ref') IS NOT NULL
ferry:
where: (tags->'route') = 'ferry' AND osm_id > 0
river:
where: (tags->'waterway') = 'river'
waterway:
where: (tags->'waterway') IN ('river', 'canal', 'stream', 'drain', 'ditch')
polygon:
# The polygon table is by far the largest, and generally the slowest
name:
function: ST_PointOnSurface(way)
where: (tags->'name') IS NOT NULL
admin:
function: ST_PointOnSurface(way)
where: (tags->'name') IS NOT NULL AND (tags->'boundary') = 'administrative' AND (tags->'admin_level') IN ('0', '1', '2', '3', '4')
nobuilding:
where: (tags->'building') IS NULL
military:
where: ((tags->'landuse') = 'military' OR (tags->'military') = 'danger_area') AND (tags->'building') IS NULL
water:
# The indentation here makes sense in the SQL output
where: |-
(tags->'waterway') IN ('dock', 'riverbank', 'canal')
OR (tags->'landuse') IN ('reservoir', 'basin')
OR (tags->'natural') IN ('water', 'glacier')
way_area_z6:
where: way_area > 5980000
way_area_z10:
where: way_area > 23300
roads:
# The roads table only has a subset of data, so it's just got some low-zoom
# indexes and some fairly selective ones for high zoom
admin_low:
where: (tags->'boundary') = 'administrative' AND (tags->'admin_level') IN ('0', '1', '2', '3', '4')
admin:
where: (tags->'boundary') = 'administrative'
roads_ref:
where: (tags->'highway') IS NOT NULL AND (tags->'ref') IS NOT NULL