Skip to content

Commit

Permalink
Update transport toml files
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Apr 11, 2024
1 parent 189dec7 commit c81de1e
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 55 deletions.
4 changes: 3 additions & 1 deletion images/tiler-server/config/config.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ max_connections = 50
[['providers/landuse_lines.toml']]
[['providers/landuse_points.toml']]

###### Transport lines from ways
###### Transport lines, points and areas from ways
[['providers/transport_points.toml']]
[['providers/transport_lines.toml']]
[['providers/transport_areas.toml']]

###### Amenities areas and points
[['providers/amenity_areas.toml']]
Expand Down
23 changes: 23 additions & 0 deletions images/tiler-server/config/providers/transport_areas.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[[providers.layers]]
name = "transport_areas"
geometry_fieldname = "geometry"
geometry_type = "multipolygon"
id_fieldname = "id"
sql = """
SELECT
ST_AsMVTGeom(geometry, !BBOX!) AS geometry,
id,
osm_id,
name,
class,
type,
area,
tags->'start_date' AS start_date,
tags->'end_date' AS end_date,
isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate,
isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate
FROM
osm_transport_areas
WHERE
geometry && !BBOX!
"""
76 changes: 22 additions & 54 deletions images/tiler-server/config/providers/transport_lines.toml
Original file line number Diff line number Diff line change
@@ -1,52 +1,3 @@
# Layer configuration for transport points
[[providers.layers]]
name = "transport_points"
geometry_fieldname = "geometry"
geometry_type = "point"
id_fieldname = "id"
sql = """
SELECT
ST_AsMVTGeom(geometry, !BBOX!) AS geometry,
id,
osm_id,
name,
class,
type,
tags->'start_date' AS start_date,
tags->'end_date' AS end_date,
isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate,
isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate
FROM
osm_transport_points
WHERE
geometry && !BBOX!
"""

# Layer configuration for transport areas
[[providers.layers]]
name = "transport_areas"
geometry_fieldname = "geometry"
geometry_type = "multipolygon"
id_fieldname = "id"
sql = """
SELECT
ST_AsMVTGeom(geometry, !BBOX!) AS geometry,
id,
osm_id,
name,
class,
type,
area,
tags->'start_date' AS start_date,
tags->'end_date' AS end_date,
isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate,
isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate
FROM
osm_transport_areas
WHERE
geometry && !BBOX!
"""

# Layer configuration for transport lines gen0
[[providers.layers]]
name = "transport_lines_gen0"
Expand All @@ -60,7 +11,8 @@ SELECT
type,
tunnel,
bridge,
ref,
ref,
service,
tags->'electrified' AS electrified,
tags->'highspeed' AS highspeed,
tags->'usage' AS usage,
Expand All @@ -71,7 +23,7 @@ SELECT
FROM
osm_transport_lines_gen0
WHERE
type IN ('motorway', 'trunk', 'motorway_link', 'trunk_link', 'primary', 'service')
type IN ('motorway', 'trunk', 'motorway_link', 'trunk_link', 'primary')
AND tunnel = 0
AND bridge = 0
AND geometry && !BBOX!
Expand All @@ -90,6 +42,7 @@ SELECT
ref,
class,
type,
service,
tags->'electrified' AS electrified,
tags->'highspeed' AS highspeed,
tags->'usage' AS usage,
Expand All @@ -105,7 +58,7 @@ WHERE
'motorway_link', 'trunk_link', 'rail', 'subway', 'light_rail',
'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature',
'funicular', 'taxiway', 'runway', 'proposed', 'construction',
'disused', 'abandoned', 'razed', 'ferry', 'service'
'disused', 'abandoned', 'razed', 'ferry'
)
AND geometry && !BBOX!
"""
Expand Down Expand Up @@ -140,7 +93,14 @@ SELECT
FROM
osm_transport_lines
WHERE
type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', 'funicular', 'taxiway', 'runway', 'proposed', 'construction', 'disused', 'abandoned', 'razed', 'apron', 'ferry')
type IN (
'motorway', 'motorway_link', 'trunk', 'trunk_link',
'primary', 'primary_link', 'secondary', 'secondary_link',
'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail',
'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature',
'funicular', 'taxiway', 'runway', 'proposed', 'construction',
'disused', 'abandoned', 'razed', 'apron', 'ferry'
)
AND geometry && !BBOX!
"""

Expand Down Expand Up @@ -175,7 +135,15 @@ SELECT
FROM
osm_transport_lines
WHERE
type IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail', 'tram', 'narrow_gauge', 'monorail', 'preserved', 'miniature', 'funicular', 'taxiway', 'runway', 'residential', 'taxiway', 'runway', 'proposed', 'construction', 'disused', 'abandoned', 'razed', 'apron', 'ferry')
type IN (
'motorway', 'motorway_link', 'trunk', 'trunk_link',
'primary', 'primary_link', 'secondary', 'secondary_link',
'tertiary', 'tertiary_link', 'rail', 'subway', 'light_rail',
'tram', 'narrow_gauge', 'monorail', 'preserved',
'miniature', 'funicular', 'taxiway', 'runway', 'residential',
'taxiway', 'runway', 'proposed', 'construction', 'disused',
'abandoned', 'razed', 'apron', 'ferry'
)
AND geometry && !BBOX!
"""

Expand Down
23 changes: 23 additions & 0 deletions images/tiler-server/config/providers/transport_points.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Layer configuration for transport points
[[providers.layers]]
name = "transport_points"
geometry_fieldname = "geometry"
geometry_type = "point"
id_fieldname = "id"
sql = """
SELECT
ST_AsMVTGeom(geometry, !BBOX!) AS geometry,
id,
osm_id,
name,
class,
type,
tags->'start_date' AS start_date,
tags->'end_date' AS end_date,
isodatetodecimaldate(pad_date(tags->'start_date', 'start'), FALSE) AS start_decdate,
isodatetodecimaldate(pad_date(tags->'end_date', 'end'), FALSE) AS end_decdate
FROM
osm_transport_points
WHERE
geometry && !BBOX!
"""

0 comments on commit c81de1e

Please sign in to comment.