GithubHelp home page GithubHelp logo

kingsley0107 / road_regularization Goto Github PK

View Code? Open in Web Editor NEW
25.0 1.0 4.0 5.18 MB

πŸš€ Road network simplification, batch conversion of OSM road multi-lines to single lines πŸš€ Detection and export of dead-end roads πŸš€ Parcel division πŸš€ Road network optimization πŸš€ Block divide, cartography, export dead-end roads, and so on...

Python 100.00%
arcpy geopandas gis osm

road_regularization's Introduction

English δΈ­ζ–‡η‰ˆ

road_geo_regularization

A universal simplification of the main road network in the city, which can be used for non-high precision land division, etc.

Performance:

raw road data

  • overview

simplified road data

  • overview

Environment:

  • Arcgis Pro
  • Python 3.x from Arcgis Pro
  • Arcpy from Arcgis Pro
  • Encoding utf-8_sig

Required Data:

  • Road network data
  • Boundary data
  • Data needs to be placed in the path specified in config.py in advance, pay attention to the naming format

User Manual:

  1. Specify directories manually in config/config.py

    • Configuration options:
      • ./config/config.py needs to be manually specified:
      • GDB file path (automatically created if it doesn't exist), GDB will be automatically cleared if all steps are executed successfully
      • Road network data root directory (pay attention to the naming conventions of road network data)
      • Boundary data root directory (pay attention to the naming conventions)
    • Road types:
      • Currently, road types are selected mainly for the purpose of parcel division. The road network categories involved in the simplification are filtered based on the ROAD_TYPE_FIELD in config.py. You can add a new category in config.py for customized fine road network processing.
  2. Execute main.py

    • The main function start_process in main.py accepts the following parameters:
      • CITY: City name, ensure the naming is the same as the suffix of the road network (see comments for details)
      • MODE: Simplification mode, must be 'mixed'
      • smooth_level: Level of simplification, the higher the value, the smoother the result (distortion)
      • extend_distance: Distance of extending dead-end roads, the higher the value, the more closed road networks (but may extend a road where it does not exist)
      • spike_keep: Threshold for cleaning small spikes, roads with a length lower than this threshold will be removed, the higher the value, the more regular the roads, but it may remove roads that are actually dead-ends

Road Network Simplification Principle:

  1. Extract CenterLines

    • load data

      load raw data.

    • buffer road

      build buffer for each line.

    • dissolve road

      dissolve the buffers.

    •  extract

      Extract centerlines from merged buffers

    •  res

    Extraction result.

  2. road optimization:

    •  res

      Extension of non-closed roads (in blue).

    •  res

      Extraction of dead-end roads (points).

    •  res

      Filtering small spikes (in red) with a length below the threshold.

  3. Road Network Spatial Information Re-association::

    •  res

    Create buffers based on the simplified road network and load the original road network data for information assignment.

    •  res

    For each buffer, the matching rule with the original road network is to select the most representative road within the buffer (largest overlap).

    •  res

      eg. The most representative road within this buffer is enclosed.

  4. output result

    • result

A Hidden Parameter:

There is a hidden parameter called keep_spike in the clean_spike function in simplify.py, which is not commonly used.

It may be useful when plotting data related to dead-end roads. If needed, you can manually set keep_spike to True.

The data for dead-end points and dead-end lines will be output to the result path, named 'err_points.shp' and 'err_lines.shp', respectively.

road_regularization's People

Contributors

kingsley0107 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.