GeoGraph provides a tool for analysing habitat fragmentation and related problems in landscape ecology. GeoGraph builds a geospatially referenced graph from land cover or field survey data and enables graph-based landscape ecology analysis as well as interactive visualizations.
Minor linting and type hinting improvements, including making type hints of class labels consistently Union[int, str].
Pin Rasterio to 1.1.8
New _add_nodes function in geograph.
Fix the merge_classes function by detecting neighbouring polygons of the same class and merging them. Closes #44
Support for barrier_classes in add_habitat, with basic pathfinding functionality. This will only detect pathfinding problems if the polygon of the barrier node completely cuts the buffered polygon of the main node in half, preventing all access to the neighbouring polygon. This works by using Shapely's polygon difference function, see the comments for the actual algorithm.
The pathfinding code slows add_habitat down quite a bit, as might be expected, but it seems to make some difference to the final edge count:
When this one is merged I will create the 0.0.2 release, upload it to PyPi and add it to Zenodo.
This PR contains several miscellaneous features:
_add_nodes
function ingeograph
.merge_classes
function by detecting neighbouring polygons of the same class and merging them. Closes #44barrier_classes
inadd_habitat
, with basic pathfinding functionality. This will only detect pathfinding problems if the polygon of the barrier node completely cuts the buffered polygon of the main node in half, preventing all access to the neighbouring polygon. This works by using Shapely's polygon difference function, see the comments for the actual algorithm.The pathfinding code slows![habitats](https://user-images.githubusercontent.com/13484097/118413554-d6809500-b697-11eb-9e9e-96ea918dff2c.jpg)
add_habitat
down quite a bit, as might be expected, but it seems to make some difference to the final edge count:When this one is merged I will create the 0.0.2 release, upload it to PyPi and add it to Zenodo.