QGIS plugin with a map tool to reshape a continuous segment topogically.
Project description
segment-reshape-qgis-plugin
QGIS plugin with a map tool to reshape a continuous segment topogically.
Plugin
Segment reshape tool
plugin is available from the QGIS plugin repository. It provides a simple toolbar with one action. Action will activate a segment reshape map tool, with which a common segment portion can be clicked and a new segment can be digitized. After digitizing the features are edited to match the new common segment.
Library
To use this library as an external dependency in your plugin or other Python code, install it using pip install segment-reshape-qgis-plugin
and use imports from the provided segment_reshape
package. If used in a plugin, library must be installed in the runtime QGIS environment or use qgis-plugin-dev-tools to bundle your plugin with runtime dependencies included.
API documentation
Simple use case can be seen in integration test.
Finding common segment
segment_reshape.topology.find_related.find_segment_to_reshape
calculates the line segment between features that share equal sequence of vertices along their edges at the trigger location. By default all QGIS project layers are used to find connected features if topological editing is enabled. Custom list of layers can also be passed as an argument.
Return values are:
- Common segment (
None
if not found) - Features that share the common segment (and relevant vertex indices)
- Features that share the end points of the common segment (and relevant vertex index)
Editing geometries partially
segment_reshape.geometry.reshape.make_reshape_edits
reshapes the provided common parts and edges, so that common part shared vertex indices are replaced and edges are moved to match the reshaped geometry. Output of find_segment_to_reshape
(common parts & edges) can be used as input for this function.
Map tool
Map tool is found in segment_reshape.map_tool.segment_reshape_tool.SegmentReshapeTool
, it can be subclassed or used as is in custom plugins.
Development of segment-reshape-qgis-plugin
See development readme.
License & copyright
Licensed under GNU GPL v3.0.
Copyright (C) 2022 National Land Survey of Finland.
CHANGELOG
0.0.3 - 2022-11-17
- Fix: Fix missing toolbar icon by including resource files in setuptools build
0.0.2 - 2022-11-09
- Feat: Implement a QGIS plugin with a simple toolbar
- Feat: Add map tool for selecting and drawing the reshape geometry
- Feat: Support complex calculation for the common segment
- Feat: Add snapping support when drawing the reshape geometry
0.0.1 - 2022-10-28
- Initial release: API for finding common segments and making reshape edits
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for segment-reshape-qgis-plugin-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c47bc468ec6661b8c5a1706c07f3f55641e2c60b0edc3cdc4c45ca9cf2e4f8c |
|
MD5 | d3c4b7ac8cf567748fe1fee6ac660657 |
|
BLAKE2b-256 | 8f489db346a0f15037108e2a101909bbd80cdf3a23ab1e8eb7c675594565d3f5 |
Hashes for segment_reshape_qgis_plugin-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e07646730d7d0a36511d9e90abf1fd538d625d64d9e053e1282a6fd4bd70fe46 |
|
MD5 | 73bd5e26ac4d6000c247525085c3bde0 |
|
BLAKE2b-256 | d4a3f2d071f8083857da7ac3f011fec3c1b8e82c4d0e12af9e0d1f3e03e85fa4 |