NKAmapper / replace_geometry

Replaces geometry of chain of ways in OSM file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Replaces geometry of chain of ways in OSM file

License:Creative Commons Zero v1.0 Universal


Languages

Language:Python 100.0%