Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions flex-config/sql/amenity.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ ALTER TABLE osm.amenity_polygon
;


CREATE INDEX ix_osm_amenity_point_type ON osm.amenity_point (osm_type);
CREATE INDEX ix_osm_amenity_line_type ON osm.amenity_line (osm_type);
CREATE INDEX ix_osm_amenity_polygon_type ON osm.amenity_polygon (osm_type);


COMMENT ON COLUMN osm.amenity_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.amenity_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.amenity_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
Expand Down
2 changes: 0 additions & 2 deletions flex-config/sql/building.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ ALTER TABLE osm.building_polygon
;


CREATE INDEX ix_osm_building_polygon_type ON osm.building_polygon (osm_type);


CREATE VIEW osm.vbuilding_all AS
SELECT osm_id, 'N' AS geom_type, osm_type, osm_subtype, name, levels,
Expand Down
2 changes: 0 additions & 2 deletions flex-config/sql/infrastructure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ ALTER TABLE osm.infrastructure_point
PRIMARY KEY (osm_id)
;

CREATE INDEX ix_osm_infrastructure_point_highway ON osm.infrastructure_point (osm_type);

COMMENT ON COLUMN osm.infrastructure_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.infrastructure_point.ele IS 'Elevation in meters';

Expand Down
3 changes: 0 additions & 3 deletions flex-config/sql/landuse.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ ALTER TABLE osm.landuse_polygon
PRIMARY KEY (osm_id)
;

CREATE INDEX ix_osm_landuse_point_type ON osm.landuse_point (osm_type);
CREATE INDEX ix_osm_landuse_polygon_type ON osm.landuse_polygon (osm_type);


COMMENT ON COLUMN osm.landuse_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.landuse_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
Expand Down
3 changes: 0 additions & 3 deletions flex-config/sql/leisure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ ALTER TABLE osm.leisure_polygon
PRIMARY KEY (osm_id)
;

CREATE INDEX ix_osm_leisure_point_type ON osm.leisure_point (osm_type);
CREATE INDEX ix_osm_leisure_polygon_type ON osm.leisure_polygon (osm_type);

COMMENT ON COLUMN osm.leisure_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.leisure_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';

Expand Down
5 changes: 0 additions & 5 deletions flex-config/sql/natural.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ ALTER TABLE osm.natural_polygon
;


CREATE INDEX ix_osm_natural_point_type ON osm.natural_point (osm_type);
CREATE INDEX ix_osm_natural_line_type ON osm.natural_line (osm_type);
CREATE INDEX ix_osm_natural_polygon_type ON osm.natural_polygon (osm_type);


COMMENT ON COLUMN osm.natural_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.natural_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.natural_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
Expand Down
5 changes: 0 additions & 5 deletions flex-config/sql/place.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ ALTER TABLE osm.place_polygon
;


CREATE INDEX ix_osm_place_point_type ON osm.place_point (osm_type);
CREATE INDEX ix_osm_place_line_type ON osm.place_line (osm_type);
CREATE INDEX ix_osm_place_polygon_type ON osm.place_polygon (osm_type);



------------------------------------------------
CREATE TEMP TABLE place_polygon_in_relations AS
Expand Down
5 changes: 0 additions & 5 deletions flex-config/sql/poi.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ ALTER TABLE osm.poi_polygon
;


CREATE INDEX ix_osm_poi_point_type ON osm.poi_point (osm_type);
CREATE INDEX ix_osm_poi_line_type ON osm.poi_line (osm_type);
CREATE INDEX ix_osm_poi_polygon_type ON osm.poi_polygon (osm_type);


COMMENT ON COLUMN osm.poi_point.osm_type IS 'Stores the OpenStreetMap key that included this feature in the layer. Value from key stored in osm_subtype.';
COMMENT ON COLUMN osm.poi_line.osm_type IS 'Stores the OpenStreetMap key that included this feature in the layer. Value from key stored in osm_subtype.';
COMMENT ON COLUMN osm.poi_polygon.osm_type IS 'Stores the OpenStreetMap key that included this feature in the layer. Value from key stored in osm_subtype.';
Expand Down
5 changes: 0 additions & 5 deletions flex-config/sql/public_transport.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ ALTER TABLE osm.public_transport_polygon
;


CREATE INDEX ix_osm_public_transport_point_type ON osm.public_transport_point (osm_type);
CREATE INDEX ix_osm_public_transport_line_type ON osm.public_transport_line (osm_type);
CREATE INDEX ix_osm_public_transport_polygon_type ON osm.public_transport_polygon (osm_type);


COMMENT ON COLUMN osm.public_transport_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.public_transport_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.public_transport_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
Expand Down
11 changes: 0 additions & 11 deletions flex-config/sql/road.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ ALTER TABLE osm.road_line
;


CREATE INDEX ix_osm_road_point_highway ON osm.road_point (osm_type);
CREATE INDEX ix_osm_road_line_highway ON osm.road_line (osm_type);


-- Standard use case is to query WHERE major.
-- Opting for partial index to maximize benefits.
CREATE INDEX ix_osm_road_line_major
ON osm.road_line (major)
WHERE major;



------------------------------------------------
CREATE TEMP TABLE road_polygon_in_relations AS
Expand Down
2 changes: 0 additions & 2 deletions flex-config/sql/traffic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ ALTER TABLE osm.traffic_point
;


CREATE INDEX ix_osm_traffic_point_type ON osm.traffic_point (osm_type);

COMMENT ON COLUMN osm.traffic_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.traffic_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
COMMENT ON COLUMN osm.traffic_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
Expand Down
7 changes: 0 additions & 7 deletions flex-config/sql/water.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ ALTER TABLE osm.water_polygon
PRIMARY KEY (osm_id)
;

-- osm_type column only has natural/waterway values.
-- Indexing osm_subtype b/c has more selective and seems more likely to be used.
CREATE INDEX ix_osm_water_point_type ON osm.water_point (osm_subtype);
CREATE INDEX ix_osm_water_line_type ON osm.water_line (osm_subtype);
CREATE INDEX ix_osm_water_polygon_type ON osm.water_polygon (osm_subtype);


------------------------------------------------
CREATE TEMP TABLE water_polygon_in_relations AS
SELECT p_no_rel.osm_id
Expand Down
15 changes: 15 additions & 0 deletions flex-config/style/amenity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ tables.amenity_point = osm2pgsql.define_table({
{ column = 'wheelchair', type = 'text'},
{ column = 'wheelchair_desc', type = 'text'},
{ column = 'geom', type = 'point', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' },
}
})

Expand All @@ -39,6 +44,11 @@ tables.amenity_line = osm2pgsql.define_table({
{ column = 'wheelchair', type = 'text'},
{ column = 'wheelchair_desc', type = 'text'},
{ column = 'geom', type = 'linestring', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' },
}
})

Expand All @@ -60,6 +70,11 @@ tables.amenity_polygon = osm2pgsql.define_table({
{ column = 'wheelchair', type = 'text'},
{ column = 'wheelchair_desc', type = 'text'},
{ column = 'geom', type = 'multipolygon', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' },
}
})

Expand Down
10 changes: 10 additions & 0 deletions flex-config/style/building.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ tables.building_point = osm2pgsql.define_table({
{ column = 'wheelchair_desc', type = 'text'},
{ column = 'operator', type = 'text'},
{ column = 'geom', type = 'point', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' },
}
})

Expand All @@ -47,6 +52,11 @@ tables.building_polygon = osm2pgsql.define_table({
{ column = 'wheelchair_desc', type = 'text'},
{ column = 'operator', type = 'text'},
{ column = 'geom', type = 'multipolygon', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' },
}
})

Expand Down
12 changes: 12 additions & 0 deletions flex-config/style/indoor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ tables.indoor_point = osm2pgsql.define_table({
{ column = 'capacity', type = 'text'},
{ column = 'highway', type = 'text'},
{ column = 'geom', type = 'point' , projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand All @@ -36,6 +40,10 @@ tables.indoor_line = osm2pgsql.define_table({
{ column = 'capacity', type = 'text'},
{ column = 'highway', type = 'text'},
{ column = 'geom', type = 'linestring', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand All @@ -55,6 +63,10 @@ tables.indoor_polygon = osm2pgsql.define_table({
{ column = 'capacity', type = 'text'},
{ column = 'highway', type = 'text'},
{ column = 'geom', type = 'multipolygon' , projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand Down
15 changes: 15 additions & 0 deletions flex-config/style/infrastructure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ tables.infrastructure_point = osm2pgsql.define_table({
{ column = 'operator', type = 'text'},
{ column = 'material', type = 'text'},
{ column = 'geom', type = 'point', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' },
}
})

Expand All @@ -44,6 +49,11 @@ tables.infrastructure_line = osm2pgsql.define_table({
{ column = 'operator', type = 'text'},
{ column = 'material', type = 'text'},
{ column = 'geom', type = 'linestring', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' },
}
})

Expand All @@ -61,6 +71,11 @@ tables.infrastructure_polygon = osm2pgsql.define_table({
{ column = 'operator', type = 'text'},
{ column = 'material', type = 'text'},
{ column = 'geom', type = 'multipolygon', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'osm_subtype', method = 'btree', where = 'osm_subtype IS NOT NULL' },
}
})

Expand Down
8 changes: 8 additions & 0 deletions flex-config/style/landuse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ tables.landuse_point = osm2pgsql.define_table({
{ column = 'osm_type', type = 'text' , not_null = true},
{ column = 'name', type = 'text' },
{ column = 'geom', type = 'point', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand All @@ -23,6 +27,10 @@ tables.landuse_polygon = osm2pgsql.define_table({
{ column = 'osm_type', type = 'text', not_null = true},
{ column = 'name', type = 'text' },
{ column = 'geom', type = 'multipolygon', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand Down
8 changes: 8 additions & 0 deletions flex-config/style/leisure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ tables.leisure_point = osm2pgsql.define_table({
{ column = 'osm_type', type = 'text', not_null = true},
{ column = 'name', type = 'text' },
{ column = 'geom', type = 'point', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand All @@ -23,6 +27,10 @@ tables.leisure_polygon = osm2pgsql.define_table({
{ column = 'osm_type', type = 'text' , not_null = true},
{ column = 'name', type = 'text' },
{ column = 'geom', type = 'multipolygon', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand Down
12 changes: 12 additions & 0 deletions flex-config/style/natural.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ tables.natural_point = osm2pgsql.define_table({
{ column = 'name', type = 'text' },
{ column = 'ele', type = 'int' },
{ column = 'geom', type = 'point', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand All @@ -25,6 +29,10 @@ tables.natural_line = osm2pgsql.define_table({
{ column = 'name', type = 'text' },
{ column = 'ele', type = 'int' },
{ column = 'geom', type = 'linestring' , projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand All @@ -38,6 +46,10 @@ tables.natural_polygon = osm2pgsql.define_table({
{ column = 'name', type = 'text' },
{ column = 'ele', type = 'int' },
{ column = 'geom', type = 'multipolygon' , projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
}
})

Expand Down
21 changes: 21 additions & 0 deletions flex-config/style/place.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ tables.place_point = osm2pgsql.define_table({
{ column = 'admin_level', type = 'int4' },
{ column = 'name', type = 'text' },
{ column = 'geom', type = 'point', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'boundary', method = 'btree', where = 'boundary IS NOT NULL ' },
{ column = 'admin_level', method = 'btree', where = 'admin_level IS NOT NULL ' },
{ column = 'name', method = 'btree', where = 'name IS NOT NULL ' },
}
})

Expand All @@ -26,6 +33,13 @@ tables.place_line = osm2pgsql.define_table({
{ column = 'admin_level', type = 'int4' },
{ column = 'name', type = 'text' },
{ column = 'geom', type = 'linestring', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'boundary', method = 'btree', where = 'boundary IS NOT NULL ' },
{ column = 'admin_level', method = 'btree', where = 'admin_level IS NOT NULL ' },
{ column = 'name', method = 'btree', where = 'name IS NOT NULL ' },
}
})

Expand All @@ -41,6 +55,13 @@ tables.place_polygon = osm2pgsql.define_table({
{ column = 'name', type = 'text' },
{ column = 'member_ids', type = 'jsonb'},
{ column = 'geom', type = 'multipolygon', projection = srid, not_null = true},
},
indexes = {
{ column = 'geom', method = 'gist' },
{ column = 'osm_type', method = 'btree' },
{ column = 'boundary', method = 'btree', where = 'boundary IS NOT NULL ' },
{ column = 'admin_level', method = 'btree', where = 'admin_level IS NOT NULL ' },
{ column = 'name', method = 'btree', where = 'name IS NOT NULL ' },
}
})

Expand Down
Loading