QGIS/resources/function_help/json/hausdorff_distance

29 lines
2.7 KiB
Plaintext
Raw Normal View History

{
"name": "hausdorff_distance",
"type": "function",
2020-07-02 01:46:48 +01:00
"groups": ["GeometryGroup"],
"description": "Returns the Hausdorff distance between two geometries. This is basically a measure of how similar or dissimilar 2 geometries are, with a lower distance indicating more similar geometries.<br>The function can be executed with an optional densify fraction argument. If not specified, an approximation to the standard Hausdorff distance is used. This approximation is exact or close enough for a large subset of useful cases. Examples of these are:<br><br><li>computing distance between Linestrings that are roughly parallel to each other, and roughly equal in length. This occurs in matching linear networks.</li><li>Testing similarity of geometries.</li><br><br>If the default approximate provided by this method is insufficient, specify the optional densify fraction argument. Specifying this argument performs a segment densification before computing the discrete Hausdorff distance. The parameter sets the fraction by which to densify each segment. Each segment will be split into a number of equal-length subsegments, whose fraction of the total length is closest to the given fraction. Decreasing the densify fraction parameter will make the distance returned approach the true Hausdorff distance for the geometries.",
"arguments": [{
"arg": "geometry1",
"description": "a geometry"
}, {
"arg": "geometry2",
"description": "a geometry"
}, {
"arg": "densify_fraction",
"description": "densify fraction amount",
"optional": true
}],
"examples": [{
"expression": "hausdorff_distance( geometry1:= geom_from_wkt('LINESTRING (0 0, 2 1)'),geometry2:=geom_from_wkt('LINESTRING (0 0, 2 0)'))",
"returns": "2"
}, {
"expression": "hausdorff_distance( geom_from_wkt('LINESTRING (130 0, 0 0, 0 150)'),geom_from_wkt('LINESTRING (10 10, 10 150, 130 10)'))",
"returns": "14.142135623"
}, {
"expression": "hausdorff_distance( geom_from_wkt('LINESTRING (130 0, 0 0, 0 150)'),geom_from_wkt('LINESTRING (10 10, 10 150, 130 10)'),0.5)",
"returns": "70.0"
}],
"tags": ["distance", "segment", "dissimilar", "densify", "linestrings", "parallel", "other", "matching", "total", "close", "executed", "specifying", "occurs", "equal", "fraction", "testing", "method", "discrete", "linear", "default", "approximate", "sets", "length", "large", "lower", "similar", "similarity", "parameter", "measure", "split", "make", "approach", "closest", "examples", "provided", "performs", "insufficient", "networks", "specify", "optional", "decreasing", "approximation", "cases", "densification", "specified", "computing", "argument", "subsegments", "hausdorff", "exact", "indicating", "subset", "standard"]
}