コード例 #1
0
def larger_area(larger_network_area: ogr.Geometry,
                project_area: ogr.Geometry) -> ogr.Geometry:
    """
    The area in which the network will only cover main roads,
    defaults to the project area, if no larger_network_area is given
    """
    dummy_geom = dummy_polygon()
    # compare the geometry to the default dummy_area
    if larger_network_area.SymmetricDifference(dummy_geom).Area():
        #  if its different, the area of the symmetric difference is > 0
        return larger_network_area
    #  otherwise, use the project_area instead
    return project_area
コード例 #2
0
def detailed_area(detailed_network_area: ogr.Geometry,
                  project_area: ogr.Geometry) -> ogr.Geometry:
    """
    The area in which the network will be detailed,
    defaults to the project area, if no detailed_network_area is given
    """
    dummy_geom = dummy_polygon()
    # compare the geometry to the default dummy_area
    if detailed_network_area.SymmetricDifference(dummy_geom).Area():
        #  if its different, the area of the symmetric difference is > 0
        return detailed_network_area
    #  otherwise, use the project_area instead
    return project_area