8. Topological Rule: Must not intersect with (line) - Maureque/GSoC2020-topology-osgeo-gvsig GitHub Wiki

Rule details.

Rule image

  • Rule name: TopologyRuleMustNotIntersectWithLine

  • Repository: https://github.com/Maureque/TopologyRuleMustNotIntersectWithLine

  • Description: The rule requires that the lines in the input layer must not cross or overlap any part of the lines in the coverage layer. Lines errors are created if the lines cross or overlap with lines in the other layer and point errors are created where lines cross.

    For example, is useful when lines should never occupy the same space with lines in the other layer like local roads cannot cross or overlap with routes.

  • Release: https://github.com/Maureque/TopologyRuleMustNotIntersectWithLine/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 entities in the input layer not cross or overlap with lines in 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. The buffer is a polygon where if it intersects any of the boundaries of the polygons from the coverage layer, the lines will be intersected.

      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, if the lines are cross or overlap will be created an error report, this will be a report of error lines, which contains the lines of the input layer that are intersected or overlapped by any of the lines of the coverage layer.

    • Input data:

      • Input, lines layer.
      • Coverage, lines layer.
    • Output data:

      • Lines errors report.
    • Error correction:

      • Delete line action. This action deletes line errors. This action is useful to delete the entities of the input layer that do not comply with the rule, always taking account of the established tolerance. The entities to delete can be selected individually. View example.

      • Mark line action. This action makes a new layer with red lines, which corresponds to the entities of the input layer, which were selected in the error report. Line errors are created if the lines overlap. This action marks the errors in a clear visual way, then the user must choose what to do with them. The entities to mark can be selected individually.

      • Mark point action. This action makes a new layer with red points, which corresponds to the entities of the input layer, which were selected in the error report. Point errors are created if the lines cross, where the points correspond to the intersections. This action marks the errors in a clear visual way, then the user must choose what to do with them. The entities to mark can be selected individually. View example.

    • Optimize algorithm.
    • Codify.
    • Test, debug, and refactor.
    • 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 "Layer1_Rails" with 124 entities.

Coverage layer: Name "Layer2_Routes" with 4531 entities.

Input Data:

Input Data

Create plan:

Create plan

Defining the dataset:

Defining the dataset

Setting the rule:

Setting the rule

Executing topology plan:

Executing topology plan

Result:

Result

Delete line action:

Action execution:

Delete line action

Delete line action executed

Mark point action:

Action execution:

Mark point action executed