6. Must be inside (line) - Maureque/GSoC2020-topology-osgeo-gvsig GitHub Wiki
Rule details.
-
Rule name: TopologyRuleMustBeInsideLine
-
Repository: https://github.com/Maureque/TopologyRuleMustBeInsideLine
-
Description: Lines in one layer must be contained by the polygons in the coverage layer, if the lines are not contained a report of lines error is created, this report is composed by the lines that are not inside of the polygons.
For example, it is useful when lines must be inside of the limits of areas, like when you have streams of water and you want to check if they are within hydrographic basins. Another useful application could be when lines may fully or partially coincide with area boundaries but cannot extend beyond polygons, such as departmental highways that must be within department boundaries.
-
Release: https://github.com/Maureque/TopologyRuleMustBeInsideLine/releases/tag/1.0.0-0
-
Development process: To minimize risks and optimize the development process, is followed by the following methodology:
- Approach the problem.
- Analyze data and classes.
- Algorithm design to solve the problem.
-
The rule requires that the lines in the input layer must be covered by any of the polygons from the coverage layer, if this is not the case the error report is created.
For this rule there are 2 layers, one is taken as the input layer and the other is the coverage layer. The lines of the input layer are taken with a certain tolerance, so a buffer is calculated where the radius of this buffer is the tolerance.
If the type of geometry of the input layer is multiline, the procedure described above is performed for each of the lines that make up the multiline. The geometry type of the second layer does not need to be analyzed since this is done by the intersects function which comes by default implemented.
In conclusion, for this rule lines must be contained by polygons, on the contrary, lines errors report is created.
-
Input data:
- Input, line layer.
- Coverage, polygon layer.
-
Output data:
- Line errors report.
-
Error correction:
-
Delete line action. This action deletes the lines errors, these are the not contained lines by the polygons. Delete the entities that do not comply with the rule, always taking account of the established tolerance. The lines to delete can be selected individually. View example.
-
Mark line action. This action makes a new layer with red line marks which corresponds to the lines selected in the error report. This action marks the errors in a clear visual way, then the user must choose what to do with them. Lines that are not inside are marked by the error report. View example.
-
- Optimize algorithm.
- Codify.
- Test, debug and refactor. The tests were performed with the following input data:
- Dataset:
- Input layer: Name "POINTS" with 18 entities.
- Coverage layer: Name "POLYGONS" with 19 entities.
- Dataset:
- Document throughout the whole process. This activity has continuity from the beginning of the development process until the end of it.
Examples.
Operation of the integrated rule to the topology framework.
Dataset:
Input layer: Name "LINES_1" with 10 entities.
Coverage layer: Name "POLYGONS" with 19 entities.