Skip to content

Commit

Permalink
Show search results feature data in popup (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddewie authored Jul 27, 2024
1 parent f0b7c0c commit b955a0d
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 13 deletions.
4 changes: 2 additions & 2 deletions api/prepare-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ echo 'Building API container'
docker compose build api

echo 'Cleaning up'
[ -n "$SKIP_CLEANUP" ] || rm -rf api/postgres-data
[ -n "$SKIP_CLEANUP" ] || rm -f api/api.sql
[ -n "${SKIP_CLEANUP:-}" ] || rm -rf api/postgres-data
[ -n "${SKIP_CLEANUP:-}" ] || rm -f api/api.sql
4 changes: 2 additions & 2 deletions api/prepare_facilities.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CREATE TABLE openrailwaymap_ref AS
WHERE
(railway_ref IS NOT NULL OR uic_ref IS NOT NULL)
AND (
railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop')
railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site')
-- TODO support other states as well
);

Expand Down Expand Up @@ -65,7 +65,7 @@ CREATE TABLE openrailwaymap_facilities_for_search AS
way AS geom
FROM stations_with_route_counts
WHERE
railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop')
railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site')
-- TODO support other states as well
) AS organised
) AS duplicated;
Expand Down
2 changes: 1 addition & 1 deletion import/openrailwaymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ end

-- TODO clean up unneeded tags

local railway_station_values = osm2pgsql.make_check_values_func({'station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop'})
local railway_station_values = osm2pgsql.make_check_values_func({'station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site'})
local railway_poi_values = osm2pgsql.make_check_values_func({'crossing', 'level_crossing', 'phone', 'tram_stop', 'border', 'owner_change', 'radio', 'lubricator'})
local railway_signal_values = osm2pgsql.make_check_values_func({'signal', 'buffer_stop', 'derail', 'vacancy_detection'})
local railway_position_values = osm2pgsql.make_check_values_func({'milestone', 'level_crossing', 'crossing'})
Expand Down
4 changes: 2 additions & 2 deletions import/sql/get_station_importance.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CREATE OR REPLACE VIEW station_nodes_stop_positions_rel_count AS
FROM stations AS s
LEFT OUTER JOIN stop_positions_and_their_routes_clustered AS sprc
ON (sprc.stop_name = s.name AND ST_DWithin(s.way, sprc.geom, 400))
WHERE s.railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop');
WHERE s.railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site');

-- Join clustered platforms with station nodes
CREATE OR REPLACE VIEW station_nodes_platforms_rel_count AS
Expand Down Expand Up @@ -74,7 +74,7 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS stations_with_route_counts AS
UNION ALL
SELECT osm_id, name, station, railway_ref, railway, 0 AS route_count, name_tags, way
FROM stations
WHERE railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop')
WHERE railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site')
) AS facilities
-- ORDER BY is required to ensure that the larger route_count is used.
ORDER BY osm_id, name, station, railway_ref, railway, route_count DESC;
Expand Down
Loading

0 comments on commit b955a0d

Please sign in to comment.