Finland:HSL/HSL bus stop import

From OpenStreetMap Wiki
Jump to navigation Jump to search

Please note that this page is still under construction!


HSL bus stop import is an import of Helsinki Regional Public Transportation Authority (HSL) public transportation stop data covering city of Helsinki in Finland. The import is currently (as of May 21th 2019) at the planning stage.

Goals

  • Update the ref=*-tag of local public transportation stops (bus, commuter train, tram and subway stops) in Helsiki area to include the "H" letter in front of the numeral identifier.
  • Import attribute data for public transportation stops from HSL data for the whole HSL-area. For example if a stop is sheltered or if a name is missing in either Finnish or Swedish.

Schedule

By the end of year 2019.

Import Data

Background

Provide links to your sources.

Data source site: http://data-hslhrt.opendata.arcgis.com/datasets/c3a01a65b7a0467cba2a14935be8c2a2_0
Data license: https://creativecommons.org/licenses/by/4.0/
Type of license (if applicable): CC-BY
Link to permission (if required): https://wiki.openstreetmap.org/w/images/7/75/HSL_permission.pdf
OSM attribution (if required): https://wiki.openstreetmap.org/wiki/Contributors#Helsinki_Regional_Transport_Authority_.2F_Helsingin_Seudun_Liikenne_.28HSL.29
ODbL Compliance verified: yes

Attributes to be imported

Waiting for the final open data release for more details.

  • If a stop is sheltered or not sheltered
  • Finnish and Swedish name for stop

OSM Data Files

Link to your source data files that you have prepared for the import - e.g. the .osm files you have derived from the data sources.

Import Type

Initial import is a one-time import with the main purpose to update the existing ref-tags of Helsinki public transportation stops to within city of Helsinki include the letter H prefix and adding stop attribute data for whole HSL area stops.

JOSM will be used for entering the updated data into the OSM database.

Data Preparation

Data Reduction & Simplification

The import will target public transportation stops within the Helsinki area by updating and adding new tags to existing nodes. The import will not add, edit or remove any geometry. Only tags of matching stops are added / updated. OSM data is considered "master data". Attribute data will not be imported in conflicting cases.

Tagging Plans

Only stops with a matching ref=*-tag will be updated. Following stop types are targeted:

Stop type OSM-tags Example
Bus stops highway=bus_stop https://www.openstreetmap.org/node/4938329537
Tram stops railway=tram_stop https://www.openstreetmap.org/node/313760579
Commuter train and metro stations railway=station with public_transport=station https://www.openstreetmap.org/node/1516867775
https://www.openstreetmap.org/node/146450892
Metro station platforms public_transport=platform with railway=platform that are parts of route=subway-relation https://www.openstreetmap.org/way/489577759
Metro station platform stop position public_transport=stop_position with railway=stop that are part of route=subway-relation https://www.openstreetmap.org/node/5320327937

1. Updating the ref-tag

Public transportation stops are first validated against the source dataset. If a stop exists in the HSL source data, it's identifier is matched with the OSM ref-tag value.

Existing nodes and areas with highway=bus_stop and railway=tram_stop including a ref=*-tag with 4 digits will be updated. The letter "H" is prefixed in front of the existing 4-digit identifier.

2. Updating the attributes of stops

Attribute data is added to each stop after initial matching between the source data set and the existing OSM stops. Following tags are added only if the target OSM stop does not already have it:

  • shelter=yes if the stop is protected from the rain by a shelter
  • shelter=no if the stop is not protected from the rain by a shelter
  • name=*, name:fi=* and name:sv=* for Finnish and Swedish name for the stop.

Changeset Tags

Data Transformation

Postgres database is used for storing the HSL public transport stop data. OSM Data is downloaded via the Overpass API. A Python script is used in the transformation.

Data Transformation Results

Post a link to your OSM XML files.

Data Merge Workflow

Team Approach

Describe if you'll be doing this solo or as a team.

References

List all factors that will be evaluated in the import.

Workflow

Detail the steps you'll take during the actual import.

Information to include:

  • Step by step instructions
  • Changeset size policy
  • Revert plans

Step by step

  • Import HSL stop data from Helsinki to PostGIS-database.
  • Query public_transportation stops with ref=*-tags from HSL area via Overpass Turbo to .OSM XML-file.
try it yourself in overpass-turbo
// define HSL area filter with HSL member municipalities (OSM municipality)
(
  area[name="Helsinki"];
  area[name="Espoo"];
  area[name="Vantaa"];
  area[name="Kirkkonummi"];
  area[name="Kerava"];
  area[name="Kauniainen"];
  area[name="Sipoo"];
  area[name="Tuusula"];
  area[name="Siuntio"];
)->.hsl;

// different public transportation stop types in HSL area

(
  // tram stops
  node["railway"="tram_stop"]["ref"][!"name:sv"](area.hsl);
  way["railway"="tram_stop"]["ref"][!"name:sv"](area.hsl);
  relation["railway"="tram_stop"][!"name:sv"]["ref"](area.hsl);
  
  // bus stops
  node["highway"="bus_stop"]["ref"][!"name:sv"](area.hsl);
  way["highway"="bus_stop"]["ref"][!"name:sv"](area.hsl);
  relation["highway"="bus_stop"]["ref"][!"name:sv"](area.hsl);
    
  // train and subway stations
  node["railway"="station"]["public_transport"="station"]["ref"](area.hsl);
  way["railway"="station"]["public_transport"="station"]["ref"](area.hsl);
  relation["railway"="station"]["public_transport"="station"]["ref"](area.hsl);
  
  // include stop area relations
  relation["public_transport"="stop_area"]["ref"](area.hsl);
)->.hsl_stops;

// nodes part of subway relation in HSL area.
(
  rel(area.hsl)[type=route][route=subway];
)->.metro;

// subway station platforms and stop positions (each subway station has two platforms with unique ref)
(
  way(r.metro)[ref](area.hsl);
  node(r.metro)[ref](area.hsl);
)->.metro_stops;

// output union
(
  .hsl_stops;
  .metro_stops;
);
out body;
>;
out meta;
  • update-tags.py Python scripts manipulates the .OSM file returned by Overpass Turbo and matches OSM-stops to HSL-data with ref=* value.
    • Script takes into account alterations of the ref=*-value and transforms it into 4 digit form if needed. (for example "70" to "0070")
    • Script updates OSM ref=*-value with "H"-prefix if the municipality of the matched Stop is Helsinki.
    • Script adds tag shelter=yes or shelter=no if the OSM stop does not already have shelter=*-value *and* HSL data has shelter info.
    • Script adds name=*, name:fi=* and name:sv=* if the OSM does not already have them.
  • . Upload the modified .OSM file to with JOSM.

Conflation

Identify your approach to conflation here.

QA

Add your QA plan here.

See also

The email to the Imports mailing list was sent on YYYY-MM-DD and can be found in the archives of the mailing list at [1].