GithubHelp home page GithubHelp logo

nkamapper / nsr2osm Goto Github PK

View Code? Open in Web Editor NEW
2.0 10.0 1.0 112 KB

Extracts public transportation stops from the National Stop Register at ENTUR

License: Creative Commons Zero v1.0 Universal

Python 100.00%
entur nasjonalt-stoppestedsregister nsr openstreetmap public-transport

nsr2osm's Introduction

nsr2osm

Extracts public transportation stops from the Norwegian National Stop Register (NSR) NeTEx feed at Entur.

Run nsr2osm_dump.py every morning

  • Github action is run every morning to produce nsr_current.osm and upload as artifact to Github + upload to Google Drive folder.

Usage

nsr2osm

python nsr2osm.py [-upload|-manual]

  • This program is used for updating (coordinates, name and ID of) bus stops and bus stations (only) after the initial import.
    • Creates a nsr_update.osm file with updated stop places which may be uploaded to OSM.
    • Creates a nsr_update_log.txt file with log of modifications done to OSM file.
    • Only bus stops and stations last edited by nsr2osm in OSM are updated.
    • If edited by someone else in OSM, the NSR stop place is included as a reference (if location differs by 1 meter or more, or if the NSR tags name, ref etc. have been modified).
    • Bus stops which have not been used by any route for one year are removed.
  • Options:
    • The -upload option uploads directly to OSM from the nsr2osm import account.
    • The -manual option just creates the two local files for manual insepction in JOSM.
  • Examples of useful searches in JOSM:
    • new -NSR_REFERENCE - New stops to be uploaded.
    • modified -new -NSR_REFERENCE - Modified stops to be uploaded.
    • DELETE - Stops to be deleted (manual deletion in JOSM).
    • EDIT > 2019-03-30 - Stops edited by a user other than the importing user nsr2osm after given date. Contains tags with distance moved from NSR position (if any) and name in NSR (if different than name given by user).
    • TOUCH > 2019-03-30 - Stops edited by a user other than the importing user nsr2osm after given date. The user did not edit coordiante nor name. Only in manual mode. The stops will be touched by nsr2osm during next upload.
    • OTHER > 2010 - Stops not in NSR with last edit after given date.
    • NSR_REFERENCE - Stops in NSR which have been edited by a user other than the importing user nsr2osm. Note that a search for "EDIT" is usually better.
  • Manual uploading:
    • Before uploading you may want to use the Download parent ways and relations function in JOSM to avoid conflicts.
    • Use Upload selection or Purge functions in JOSM to avoid uploading all elements to JOSM.
    • Please remember to remove the extra information tags in capital letters before uploading to OSM.

nsr2osm_dump

python nsr2osm_dump.py [county]

  • This program is used for generating a complete OSM file from the NSR NeTEx files, for the initial import or later inspection.
    • Creates a nsr_current.osm file with all stop places in Norway, or for given county.
    • The ROUTE tag contains information about each route for a given stop, including operator and inbound/outbound information.
  • Mandatory input parameter:
    • Use name of county to produce OSM file for that county, e.g. "Rogaland".
    • Use "Norge" to produce OSM file for the whole country.

Changelog

nsr2osm.py

  • 2.0: Use ElementTree for changeset + improve bus stop history handling.
  • 1.7: Keep bus stops for one year after last used by route.
  • 1.6: Delete bus stops not used by any route.
  • 1.5: Code converted to Python 3.

nsr2osm_dump.py

  • 1.0: Code converted to Python 3. Also fix bug in source data regarding short/long route names.

Notes

nsr2osm's People

Contributors

comradekingu avatar johanentur avatar mathiash98 avatar nkamapper avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

johanentur

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.