Skip to content

Commit

Permalink
Merge pull request #140 from rustprooflabs/public_transit
Browse files Browse the repository at this point in the history
Public transport
  • Loading branch information
rustprooflabs authored Jul 11, 2021
2 parents b81106d + b3314bf commit 0883256
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 4 deletions.
1 change: 1 addition & 0 deletions flex-config/run-no-tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require "style.leisure"
require "style.natural"
require "style.place"
require "style.poi"
require "style.public_transport"
require "style.road"
require "style.shop"
require "style.traffic"
Expand Down
1 change: 1 addition & 0 deletions flex-config/run-no-tags.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
\i sql/traffic.sql
\i sql/place.sql
\i sql/poi.sql
\i sql/public_transport.sql
\i sql/road.sql
\i sql/shop.sql
\i sql/water.sql
48 changes: 48 additions & 0 deletions flex-config/sql/public_transport.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
COMMENT ON TABLE osm.public_transport_point IS 'OpenStreetMap public transport points - all points with a public_transport tag. Generated by osm2pgsql Flex output using pgosm-flex/flex-config/public_transport.lua';
COMMENT ON TABLE osm.public_transport_line IS 'OpenStreetMap public transport lines - all lines with a public_transport tag. Generated by osm2pgsql Flex output using pgosm-flex/flex-config/public_transport.lua';
COMMENT ON TABLE osm.public_transport_polygon IS 'OpenStreetMap public transport polygons - all polygons with a public_transport tag. Generated by osm2pgsql Flex output using pgosm-flex/flex-config/public_transport.lua';


ALTER TABLE osm.public_transport_point
ADD CONSTRAINT pk_osm_public_transport_point_osm_id
PRIMARY KEY (osm_id)
;
ALTER TABLE osm.public_transport_line
ADD CONSTRAINT pk_osm_public_transport_line_osm_id
PRIMARY KEY (osm_id)
;
ALTER TABLE osm.public_transport_polygon
ADD CONSTRAINT pk_osm_public_transport_polygon_osm_id
PRIMARY KEY (osm_id)
;


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.';

COMMENT ON COLUMN osm.public_transport_point.geom IS 'Geometry loaded by osm2pgsql.';
COMMENT ON COLUMN osm.public_transport_line.geom IS 'Geometry loaded by osm2pgsql.';
COMMENT ON COLUMN osm.public_transport_polygon.geom IS 'Geometry loaded by osm2pgsql.';

COMMENT ON COLUMN osm.public_transport_point.osm_type IS 'Key indicating type of public transport feature if detail exists, falls back to public_transport tag. e.g. highway, bus, train, etc';
COMMENT ON COLUMN osm.public_transport_line.osm_type IS 'Key indicating type of public transport feature if detail exists, falls back to public_transport tag. e.g. highway, bus, train, etc';
COMMENT ON COLUMN osm.public_transport_polygon.osm_type IS 'Key indicating type of public transport feature if detail exists, falls back to public_transport tag. e.g. highway, bus, train, etc';

COMMENT ON COLUMN osm.public_transport_point.osm_subtype IS 'Value describing osm_type key, e.g. osm_type = "highway", osm_subtype = "bus_stop".';
COMMENT ON COLUMN osm.public_transport_line.osm_subtype IS 'Value describing osm_type key, e.g. osm_type = "highway", osm_subtype = "bus_stop".';
COMMENT ON COLUMN osm.public_transport_polygon.osm_subtype IS 'Value describing osm_type key, e.g. osm_type = "highway", osm_subtype = "bus_stop".';

COMMENT ON COLUMN osm.public_transport_point.public_transport IS 'Value from public_transport key.';
COMMENT ON COLUMN osm.public_transport_line.public_transport IS 'Value from public_transport key.';
COMMENT ON COLUMN osm.public_transport_polygon.public_transport IS 'Value from public_transport key.';

COMMENT ON COLUMN osm.public_transport_point.wheelchair IS 'Indicates if feature is wheelchair accessible. Expected values: yes, no, limited. Per https://wiki.openstreetmap.org/wiki/Key:wheelchair';
COMMENT ON COLUMN osm.public_transport_line.wheelchair IS 'Indicates if feature is wheelchair accessible. Expected values: yes, no, limited. Per https://wiki.openstreetmap.org/wiki/Key:wheelchair';
COMMENT ON COLUMN osm.public_transport_polygon.wheelchair IS 'Indicates if feature is wheelchair accessible. Expected values: yes, no, limited. Per https://wiki.openstreetmap.org/wiki/Key:wheelchair';

7 changes: 3 additions & 4 deletions flex-config/sql/shop.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ COMMENT ON COLUMN osm.shop_point.geom IS 'Geometry loaded by osm2pgsql.';
COMMENT ON COLUMN osm.shop_polygon.geom IS 'Geometry loaded by osm2pgsql.';


COMMENT ON COLUMN osm.shop_point.wheelchair IS 'Indicates if building is wheelchair accessible. Values: yes, no, limited. Per https://wiki.openstreetmap.org/wiki/Key:wheelchair';
COMMENT ON COLUMN osm.shop_polygon.wheelchair IS 'Indicates if building is wheelchair accessible. Values: yes, no, limited. Per https://wiki.openstreetmap.org/wiki/Key:wheelchair';
COMMENT ON COLUMN osm.shop_point.wheelchair IS 'Indicates if feature is wheelchair accessible. Values: yes, no, limited. Per https://wiki.openstreetmap.org/wiki/Key:wheelchair';
COMMENT ON COLUMN osm.shop_polygon.wheelchair IS 'Indicates if feature is wheelchair accessible. Values: yes, no, limited. Per https://wiki.openstreetmap.org/wiki/Key:wheelchair';
COMMENT ON COLUMN osm.shop_point.operator IS 'Entity in charge of operations. https://wiki.openstreetmap.org/wiki/Key:operator';
COMMENT ON COLUMN osm.shop_polygon.operator IS 'Entity in charge of operations. https://wiki.openstreetmap.org/wiki/Key:operator';

Expand Down Expand Up @@ -45,7 +45,6 @@ COMMENT ON COLUMN osm.shop_polygon.city IS 'Value from addr:city tag';
COMMENT ON COLUMN osm.shop_polygon.state IS 'Value from addr:state tag';
COMMENT ON COLUMN osm.shop_polygon.postcode IS 'Value from addr:postcode tag';

COMMENT ON COLUMN osm.shop_polygon.wheelchair IS 'Indicates if building is wheelchair accessible.';
COMMENT ON COLUMN osm.shop_point.brand IS 'Identity of product, service or business. https://wiki.openstreetmap.org/wiki/Key:brand';
COMMENT ON COLUMN osm.shop_polygon.brand IS 'Identity of product, service or business. https://wiki.openstreetmap.org/wiki/Key:brand';

Expand Down Expand Up @@ -82,7 +81,7 @@ COMMENT ON COLUMN osm.vshop_all.address IS 'Address combined from address parts
COMMENT ON COLUMN osm.vshop_all.name IS 'Best name option determined by helpers.get_name(). Keys with priority are: name, short_name, alt_name and loc_name. See pgosm-flex/flex-config/helpers.lua for full logic of selection.';
COMMENT ON COLUMN osm.vshop_all.geom IS 'Geometry, mix of points loaded by osm2pgsql and points calculated from the ST_Centroid() of the polygons loaded by osm2pgsql.';

COMMENT ON COLUMN osm.vshop_all.wheelchair IS 'Indicates if building is wheelchair accessible.';
COMMENT ON COLUMN osm.vshop_all.wheelchair IS 'Indicates if feature is wheelchair accessible. Values: yes, no, limited. Per https://wiki.openstreetmap.org/wiki/Key:wheelchair';
COMMENT ON COLUMN osm.vshop_all.geom_type IS 'Type of geometry. N(ode), W(ay) or R(elation). Unique along with osm_id';
COMMENT ON COLUMN osm.vshop_all.operator IS 'Entity in charge of operations. https://wiki.openstreetmap.org/wiki/Key:operator';
COMMENT ON COLUMN osm.vshop_all.website IS 'Official website for the feature. https://wiki.openstreetmap.org/wiki/Key:website';
Expand Down
Loading

0 comments on commit 0883256

Please sign in to comment.