Skip to content

Commit 38d88df

Browse files
committed
transform yard data
1 parent dc686c9 commit 38d88df

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

import/docker-startup.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ function reduce_data() {
7777
$PSQL -c "delete from platforms p where not exists(select * from routes r where r.platform_ref_ids @> Array[p.osm_id]) and not exists(select * from railway_line l where st_dwithin(p.way, l.way, 20));"
7878
}
7979

80+
function transform_data() {
81+
# Yard nodes which are contained in a landuse=railway area, assume the landuse area as yard geometry.
82+
$PSQL -c "update stations s set way = l.way from landuse l where ST_Within(s.way, l.way) and feature = 'yard' and GeometryType(s.way) = 'POINT' and s.osm_type = 'N';"
83+
}
84+
8085
function create_update_functions_views() {
8186
echo "Post processing imported data"
8287
$PSQL -f sql/tile_functions.sql
@@ -108,6 +113,7 @@ import)
108113
enable_disable_extensions
109114
import_db
110115
reduce_data
116+
transform_data
111117
create_update_functions_views
112118
print_summary
113119

0 commit comments

Comments
 (0)