Skip to content

Commit b4e74da

Browse files
committed
Update styles to create unique indexes from Lua instead of PKs from SQL.
1 parent 09efa14 commit b4e74da

32 files changed

+42
-202
lines changed

flex-config/sql/amenity.sql

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@ COMMENT ON TABLE osm.amenity_line IS 'OpenStreetMap amenity lines - all lines wi
33
COMMENT ON TABLE osm.amenity_polygon IS 'OpenStreetMap amenity polygons - all polygons with an amenity tag. Some amenity tags are pulled into other tables (e.g. infrastructure, shop, and traffic layers) and duplicated again here. This is currently intentional but may change in the future. Generated by osm2pgsql Flex output using pgosm-flex/flex-config/amenity.lua';
44

55

6-
ALTER TABLE osm.amenity_point
7-
ADD CONSTRAINT pk_osm_amenity_point_osm_id
8-
PRIMARY KEY (osm_id)
9-
;
10-
ALTER TABLE osm.amenity_line
11-
ADD CONSTRAINT pk_osm_amenity_line_osm_id
12-
PRIMARY KEY (osm_id)
13-
;
14-
ALTER TABLE osm.amenity_polygon
15-
ADD CONSTRAINT pk_osm_amenity_polygon_osm_id
16-
PRIMARY KEY (osm_id)
17-
;
18-
19-
206
COMMENT ON COLUMN osm.amenity_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
217
COMMENT ON COLUMN osm.amenity_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
228
COMMENT ON COLUMN osm.amenity_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';

flex-config/sql/building.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ COMMENT ON COLUMN osm.building_polygon.operator IS 'Entity in charge of operatio
3535

3636

3737

38-
ALTER TABLE osm.building_polygon
39-
ADD CONSTRAINT pk_osm_building_polygon_osm_id
40-
PRIMARY KEY (osm_id)
41-
;
42-
43-
4438
COMMENT ON COLUMN osm.building_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
4539
COMMENT ON COLUMN osm.building_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
4640

flex-config/sql/building_combined_point.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11

2-
ALTER TABLE osm.building_combined_point
3-
ADD CONSTRAINT pk_osm_building_combined_point_osm_id_geom_type
4-
PRIMARY KEY (osm_id, geom_type)
5-
;
6-
72

83
COMMENT ON TABLE osm.building_combined_point IS 'Combined building data as points. Building polygons are converted in osm2pgsql to points with centroid().';
94
COMMENT ON COLUMN osm.building_combined_point.address IS 'Address combined from address parts in helpers.get_address().';

flex-config/sql/indoor.sql

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,3 @@ COMMENT ON COLUMN osm.indoor_point.geom IS 'Geometry loaded by osm2pgsql.';
4646
COMMENT ON COLUMN osm.indoor_line.geom IS 'Geometry loaded by osm2pgsql.';
4747
COMMENT ON COLUMN osm.indoor_polygon.geom IS 'Geometry loaded by osm2pgsql.';
4848

49-
50-
ALTER TABLE osm.indoor_point
51-
ADD CONSTRAINT pk_osm_indoor_point_osm_id
52-
PRIMARY KEY (osm_id)
53-
;
54-
ALTER TABLE osm.indoor_line
55-
ADD CONSTRAINT pk_osm_indoor_line_osm_id
56-
PRIMARY KEY (osm_id)
57-
;
58-
ALTER TABLE osm.indoor_polygon
59-
ADD CONSTRAINT pk_osm_indoor_polygon_osm_id
60-
PRIMARY KEY (osm_id)
61-
;

flex-config/sql/infrastructure.sql

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
COMMENT ON TABLE osm.infrastructure_point IS 'OpenStreetMap infrastructure layer. Generated by osm2pgsql Flex output using pgosm-flex/flex-config/infrasturcture.lua';
22

3-
ALTER TABLE osm.infrastructure_point
4-
ADD CONSTRAINT pk_osm_infrastructure_point_osm_id
5-
PRIMARY KEY (osm_id)
6-
;
73

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

flex-config/sql/landuse.sql

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@ COMMENT ON TABLE osm.landuse_polygon IS 'OpenStreetMap landuse polygons - all po
22
COMMENT ON TABLE osm.landuse_point IS 'OpenStreetMap landuse points - all points with a landuse tag. Generated by osm2pgsql Flex output using pgosm-flex/flex-config/landuse.lua';
33

44

5-
ALTER TABLE osm.landuse_point
6-
ADD CONSTRAINT pk_osm_landuse_point_osm_id
7-
PRIMARY KEY (osm_id)
8-
;
9-
ALTER TABLE osm.landuse_polygon
10-
ADD CONSTRAINT pk_osm_landuse_polygon_osm_id
11-
PRIMARY KEY (osm_id)
12-
;
13-
14-
155
COMMENT ON COLUMN osm.landuse_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
166
COMMENT ON COLUMN osm.landuse_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
177

flex-config/sql/leisure.sql

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
COMMENT ON TABLE osm.leisure_polygon IS 'OpenStreetMap leisure polygons - all polygons with a leisure tag. Generated by osm2pgsql Flex output using pgosm-flex/flex-config/leisure.lua';
22
COMMENT ON TABLE osm.leisure_point IS 'OpenStreetMap leisure points - all points with a leisure tag. Generated by osm2pgsql Flex output using pgosm-flex/flex-config/leisure.lua';
33

4-
5-
ALTER TABLE osm.leisure_point
6-
ADD CONSTRAINT pk_osm_leisure_point_osm_id
7-
PRIMARY KEY (osm_id)
8-
;
9-
ALTER TABLE osm.leisure_polygon
10-
ADD CONSTRAINT pk_osm_leisure_polygon_osm_id
11-
PRIMARY KEY (osm_id)
12-
;
13-
144
COMMENT ON COLUMN osm.leisure_polygon.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
155
COMMENT ON COLUMN osm.leisure_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
166

flex-config/sql/natural.sql

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,6 @@ COMMENT ON COLUMN osm.natural_point.ele IS 'Elevation in meters';
66
COMMENT ON COLUMN osm.natural_line.ele IS 'Elevation in meters';
77
COMMENT ON COLUMN osm.natural_polygon.ele IS 'Elevation in meters';
88

9-
ALTER TABLE osm.natural_point
10-
ADD CONSTRAINT pk_osm_natural_point_osm_id
11-
PRIMARY KEY (osm_id)
12-
;
13-
ALTER TABLE osm.natural_line
14-
ADD CONSTRAINT pk_osm_natural_line_osm_id
15-
PRIMARY KEY (osm_id)
16-
;
17-
ALTER TABLE osm.natural_polygon
18-
ADD CONSTRAINT pk_osm_natural_polygon_osm_id
19-
PRIMARY KEY (osm_id)
20-
;
21-
229

2310
COMMENT ON COLUMN osm.natural_point.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';
2411
COMMENT ON COLUMN osm.natural_line.osm_id IS 'OpenStreetMap ID. Unique along with geometry type.';

flex-config/sql/place.sql

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,6 @@ COMMENT ON COLUMN osm.place_polygon.boundary IS 'Value from boundary tag. https
3030

3131

3232

33-
ALTER TABLE osm.place_point
34-
ADD CONSTRAINT pk_osm_place_point_osm_id
35-
PRIMARY KEY (osm_id)
36-
;
37-
ALTER TABLE osm.place_line
38-
ADD CONSTRAINT pk_osm_place_line_osm_id
39-
PRIMARY KEY (osm_id)
40-
;
41-
ALTER TABLE osm.place_polygon
42-
ADD CONSTRAINT pk_osm_place_polygon_osm_id
43-
PRIMARY KEY (osm_id)
44-
;
45-
46-
47-
4833
------------------------------------------------
4934
CREATE TEMP TABLE place_polygon_in_relations AS
5035
SELECT p_no_rel.osm_id

flex-config/sql/poi.sql

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@ COMMENT ON TABLE osm.poi_polygon IS 'OpenStreetMap Points of Interest (POI) (pol
44

55

66

7-
8-
ALTER TABLE osm.poi_point
9-
ADD CONSTRAINT pk_osm_poi_point_osm_id
10-
PRIMARY KEY (osm_id)
11-
;
12-
ALTER TABLE osm.poi_line
13-
ADD CONSTRAINT pk_osm_poi_line_osm_id
14-
PRIMARY KEY (osm_id)
15-
;
16-
ALTER TABLE osm.poi_polygon
17-
ADD CONSTRAINT pk_osm_poi_polygon_osm_id
18-
PRIMARY KEY (osm_id)
19-
;
20-
21-
227
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.';
238
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.';
249
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.';

0 commit comments

Comments
 (0)