Skip to content

Commit

Permalink
Delete all non-train platforms from database
Browse files Browse the repository at this point in the history
More than 90% of the platforms in Europe are non-train platforms. These are hundreds of MB of data, and can be removed
  • Loading branch information
hiddewie committed Aug 3, 2024
1 parent 6bd1aeb commit d8b5369
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion import/docker-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ esac
$PSQL -c "update planet_osm_nodes set tags = null where tags is not null;"
$PSQL -c "update planet_osm_ways set tags = null where tags is not null;"
$PSQL -c "update planet_osm_rels set tags = null where tags is not null;"
# Remove platforms which are not near any railway line, and also not part of any railway route
$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));"

echo "Post processing imported data"
$PSQL -f sql/functions.sql
$PSQL -f sql/get_station_importance.sql
$PSQL -f sql/signals_with_azimuth.sql
$PSQL -f sql/get_station_importance.sql
$PSQL -f sql/tile_views.sql

echo "Updating materialized views"
Expand Down

0 comments on commit d8b5369

Please sign in to comment.