GithubHelp home page GithubHelp logo

nkamapper / replace_geometry Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 12 KB

Replaces geometry of chain of ways in OSM file

License: Creative Commons Zero v1.0 Universal

Python 100.00%
openstreetmap railway

replace_geometry's Introduction

replace_geometry

Replaces geometry of chain of ways in OSM file

Usage

python replace_geometry.py [input_filename.osm]

Notes

  • Preparations before running program:

    • The new geometry must be exactly one way market with the tag REPLACE=to, and with the desired direction
    • The ways to get new geometry must be a consecutive chain of ways market with the tag REPLACE=from
    • Start node: The first node of the new way must be identical (already merged) to the first node of the chain of existing ways
    • All ways and relations which are connected in OSM should also be included (use recurse up "<" in Overpass)
  • The program will keep the original position of the following nodes:

    • Nodes which connects the ways to be replaced with another way, e.g. a highway crossing a railway
    • Nodes connecting the chain of ways to be replaced (except if relocation is less than 5 meters), e.g. first and last nodes of bridges and tunnels
  • The resulting OSM file will have several CHECK tags to be inspected before uploading:

    • CHECK=junction - The replaced way is connected to another way with these nodes. The nodes are at their original position and often should be slightly relocated to get in line with the rest of the replaced way.
    • CHECK=split - The replaced ways are connected with each other with these nodes. The nodes are at their original position and often should be slightly relocated to get in line with the rest of the replaced way.
    • CHECK=replace - Same as split, however these nodes have been replaced with the new geometry because the relocation was less than 5 meters
    • CHECK=tags - Other nodes containing tags, e.g. traffic signals
    • CHECK=skip - Old nodes which are not used with the new geometry
    • CHECK=unused - New nodes which have not been used
  • Before uploding please check the following:

    • Search CHECK -skip -unused, put in ToDo plugin and check position of all nodes. Often bridges and tunnels should be adjusted.
    • For railways, you may want to search REPLACE=from tunnel=*, put in ToDo plugin and quickly check geometry of each tunnel
    • Search CHECK=skip -child and delete all surplus/orphan old nodes
    • Search CHECK=unused and delete all new nodes not used
    • Search REPLACE=from and delete this tag
    • Serach CHECK=* and delete this tag
    • Then upload to OSM

replace_geometry's People

Contributors

nkamapper avatar

Watchers

 avatar  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.