-
Notifications
You must be signed in to change notification settings - Fork 7
CleaningGISData
Ha Dang Hoang edited this page Oct 31, 2024
·
1 revision
The clean_network
operator can be used used for cleaning and optimizing road networks. It helps deal with issues in GIS data such as disconnected segments, overlapping roads, and imprecise geometry.
clean_network(
list<geometry> geometries,
float tolerance,
bool split_lines,
bool keepMainConnectedComponent
)
- What it is: Collection of geometries (usually road segments) to clean
- How to get it:
road collect each.shape
orroad_shapefile.contents
- Example:
list<geometry> road_geometries <- road collect each.shape;
list<geometry> road_geometries <- road_shapefile.contents;
- What it is: Maximum distance between points to be considered for merging
- Recommended values:
- Small networks: 0.1 to 1.0 (e.g., urban network)
- Large networks: 1.0 to 5.0 (e.g., rural network, highway network)
- Effects:
- Lower values (e.g., 0.1): More precise, less merging
- Higher values (e.g., 5.0): More aggressive merging
- Example scenarios:
- For precise road networks:
tolerance <- 0.5
- For rough networks:
tolerance <- 2.0
- For precise road networks:
- What it is: Whether to split roads at intersection points
- Values:
- true: Split roads at intersections (recommended for navigation)
- false: Keep roads as continuous lines
- When to use:
- true: For routing and navigation purposes
- false: For visualization or analysis only
- What it is: Whether to keep only the main connected network
- Values:
- true: Remove isolated road segments
- false: Keep all road segments
- When to use:
- true: For ensuring network connectivity
- false: When isolated segments are important
// Basic cleaning with default values
list<geometry> clean_lines <- clean_network(
road collect each.shape,
1.0, // moderate tolerance
true, // split at intersections
true // keep only main network
);
global {
// Network cleaning parameters
float tolerance <- 1.0;
bool split_lines <- true;
bool keep_main_connected <- true;
init {
// Create initial roads
create road from: road_shapefile;
// Clean the network
list<geometry> clean_lines <- clean_network(
road collect each.shape,
tolerance,
split_lines,
keep_main_connected
);
// Remove old roads
ask road {
do die;
}
// Create new roads
loop clean_geom over: clean_lines {
create road {
shape <- clean_geom;
}
}
// Create network graph
road_network <- as_edge_graph(road);
}
}
- Installation and Launching
- Workspace, Projects and Models
- Editing Models
- Running Experiments
- Running Headless
- Preferences
- Troubleshooting
- Introduction
- Manipulate basic Species
- Global Species
- Defining Advanced Species
- Defining GUI Experiment
- Exploring Models
- Optimizing Models
- Multi-Paradigm Modeling
- Manipulate OSM Data
- Cleaning OSM Data
- Diffusion
- Using Database
- Using FIPA ACL
- Using BDI with BEN
- Using Driving Skill
- Manipulate dates
- Manipulate lights
- Using comodel
- Save and restore Simulations
- Using network
- Headless mode
- Using Headless
- Writing Unit Tests
- Ensure model's reproducibility
- Going further with extensions
- Built-in Species
- Built-in Skills
- Built-in Architecture
- Statements
- Data Type
- File Type
- Expressions
- Exhaustive list of GAMA Keywords
- Installing the GIT version
- Developing Extensions
- Introduction to GAMA Java API
- Using GAMA flags
- Creating a release of GAMA
- Documentation generation