Git Product home page Git Product logo

osm-stop-import-1's Introduction

osm-stop-import

This repo consists of tools for one-time OSM import for importing attributes of HSL public transportation stop data into OSM. Further details: https://wiki.openstreetmap.org/wiki/Finland:HSL/HSL_bus_stop_import.

The import has two goals:

  1. Add "H"-prefix to OSM public transportation stops ref-tag within Helsinki.
  2. Add attributes from HSL stop data to OSM public transportation stops within whole HSL area: name, finnish name, swedish name and info if stop is sheltered.

Requirements:

Python 3.8 (or you can run it with Docker )

jOSM

Get data

This repo has example data tagged as EXAMPLE for testing purposes. To use up-to-date data follow these steps.

Get OSM stop data via Overpass API query hsl-osm-stops-overpassturbo-query.txt using jOSM:

  1. Open jOSM > Preferences (F12) > Enable "Expert mode" by ticking box in bottom left corner of the Settings dialog.
  2. Download map data (Ctrl + Shift + Down) > Choose tab "Download from Overpass API" > Copy and paste the content of hsl-osm-stops-overpassturbo-query.txt > Download data
  3. Save the resulting data set: File > Save as > Save as hsl-osm-stops.osm

Get HSL public transportation stop data from HSL ArcGIS Online portal

  1. Choose APIs > GeoJSON
  2. Save the resulting .geojson-file, for example hsl-stop-data.geojson

Run the script

python update-tags.py hsl-osm-stops.osm hsl-stop-data.geojson output.osm

usage: update-tags.py [-h] input.osm input.geojson output.osm

Finds HSL public transport stops from a jOSM-file (.osm) and modifies it's OSM-tags
with HSL (JORE) stop data (.geojson) using 'ref'-tag value as an identifier.

Following transformations are made for the output jOSM-file:
 - 'ref'-tag values of stops in Helsinki are prefixed with the letter 'H'.
 - Adds 'shelter'-tag with value 'yes' or 'no'.
 - Adds 'name', 'name:fi', and 'name:sv'-tag if missing.

positional arguments:
  input.osm      Source .OSM-file
  input.geojson  HSL stop data in GeoJSON-format
  output.osm     The ouput .OSM-file with transformed ref-tags, name and shelter info.

optional arguments:
  -h, --help     show this help message and exit

Run with Docker

Build image

docker build -t osm-stop-import .

Run the container with current directory containing the necessary data as bind mount and pass the files as required command line parameters.:

docker run -it -v $PWD:/osm-stop-import/ osm-stop-import input.osm stops.csv output.osm

Validate results

Inspect log files:

update-tags.log General output, matches, errors, stats
osm_refs_missing_jore_match.csv OSM-stops that are missing a JORE stop match
shelter_conflicts.csv OSM-stops where shelter info is in conflict with JORE data
matched_stops_exceeding_max_distance_limit.csv OSM-stops that have a JORE match, but the distance between the two stops exceeds max distance limit (default 100m)

Open the output.osm in JOSM and eyball and validate the changes.

Please see https://wiki.openstreetmap.org/wiki/Finland:HSL/HSL_bus_stop_import

osm-stop-import-1's People

Contributors

juusokor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.