English δΈζη
A universal simplification of the main road network in the city, which can be used for non-high precision land division, etc.
- Arcgis Pro
- Python 3.x from Arcgis Pro
- Arcpy from Arcgis Pro
- Encoding utf-8_sig
- 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
-
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.
- Configuration options:
-
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
- The main function start_process in main.py accepts the following parameters:
-
Extract CenterLines
-
load raw data.
-
build buffer for each line.
-
dissolve the buffers.
-
Extract centerlines from merged buffers
Extraction result.
-
-
road optimization:
-
Road Network Spatial Information Re-association:οΌ
Create buffers based on the simplified road network and load the original road network data for information assignment.
For each buffer, the matching rule with the original road network is to select the most representative road within the buffer (largest overlap).
-
output 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.