3. Must be covered by boundary of - Maureque/GSoC2020-topology-osgeo-gvsig GitHub Wiki
Rule details.
-
Rule name: TopologyRuleMustBeCoveredByBoundaryOfPoint
-
Repository: https://github.com/Maureque/TopologyRuleMustBeCoveredByBoundaryOfPoint
-
Description: Points in one layer must be covered by boundaries of polygons in another layer, if are not coincident a report of points error is created, this report is composed by the points from the first layer that are not covered by boundaries of polygons from the second layer.
-
Release: https://github.com/Maureque/TopologyRuleMustBeCoveredByBoundaryOfPoint/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 points in the input layer must be covered by the boundary of 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 points of the input layer are taken with a certain tolerance, so a buffer is calculated where the radius of this buffer is the tolerance. The buffer is a polygon where if it intersects any of the boundaries of the polygons from the coverage layer, the points will be covered.
If the type of geometry of the input layer is multipoint, the procedure described above is performed for each of the points that make up the multipoint. 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, if the points are not covered by any boundary will be created an error report, this will be a report of error points, which contains the points of the input layer that are not covered by any of the boundaries of the coverage layer.
-
Input data:
- Input, point layer.
- Coverage, polygon layer.
-
Output data:
- Point errors report.
-
Error correction:
- Delete point action. This action deletes the point errors, these are the not covered points. Delete the entities that do not comply with the rule, always taking account of the established tolerance. The points to delete can be selected individually.
- Mark Point Action. This action makes a new layer with red dot marks which corresponds to the points 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.
- Optimize algorithm.
- Codify.
- Test, debug and refactor. The tests were performed with the following input data:
- Dataset 1:
- Input layer: Name "POINTS" with 18 entities.
- Coverage layer: Name "POLYGONS" with 19 entities.
- View the example.
- Dataset 2:
- Input layer: Name "POINTS" with 37 entities.
- Coverage layer: Name "POLYGONS" with 19 entities.
- View the example.
- Dataset 1:
- Document throughout the whole process. This activity has continuity from the beginning of the development process until the end of it.
Examples.
Example 1
Input layer: Name "POINTS" with 18 entities.
Coverage layer: Name "POLYGONS" with 19 entities.
Input Data:
Create plan:
Defining the dataset:
Setting the rule:
Executing topology plan:
Result:
Delete point action:
Selecting the action:
Action execution:
Example 2.
Input layer: Name "POINTS" with 37 entities.
Coverage layer: Name "POLYGONS" with 19 entities.