-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Split minimum enclosing geometry algs into separate
feature based algorithms Instead of algorithms which handle both whole layers/groups of features/individual features, we leave the whole layer and group of features handling to the "Minimum bounding geometry" algorithm. The feature-by-feature algorithms are now native c++ algorithms. This affects: - bounding boxes - convex hulls - minimum enclosing circle - minimum oriented rectangles
- Loading branch information
1 parent
b6e3542
commit 85cd1c1
Showing
9 changed files
with
471 additions
and
83 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
python/plugins/processing/tests/testdata/expected/convex_hull_by_feature.gfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<GMLFeatureClassList> | ||
<GMLFeatureClass> | ||
<Name>convex_hull_by_feature</Name> | ||
<ElementPath>convex_hull_by_feature</ElementPath> | ||
<!--POLYGON--> | ||
<GeometryType>3</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>6</FeatureCount> | ||
<ExtentXMin>-1.00000</ExtentXMin> | ||
<ExtentXMax>10.00000</ExtentXMax> | ||
<ExtentYMin>-3.00000</ExtentYMin> | ||
<ExtentYMax>6.00000</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
<PropertyDefn> | ||
<Name>intval</Name> | ||
<ElementPath>intval</ElementPath> | ||
<Type>Integer</Type> | ||
</PropertyDefn> | ||
<PropertyDefn> | ||
<Name>floatval</Name> | ||
<ElementPath>floatval</ElementPath> | ||
<Type>Real</Type> | ||
</PropertyDefn> | ||
<PropertyDefn> | ||
<Name>area</Name> | ||
<ElementPath>area</ElementPath> | ||
<Type>Real</Type> | ||
</PropertyDefn> | ||
<PropertyDefn> | ||
<Name>perimeter</Name> | ||
<ElementPath>perimeter</ElementPath> | ||
<Type>Real</Type> | ||
</PropertyDefn> | ||
<PropertyDefn> | ||
<Name>name</Name> | ||
<ElementPath>name</ElementPath> | ||
<Type>String</Type> | ||
<Width>5</Width> | ||
</PropertyDefn> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
71 changes: 71 additions & 0 deletions
71
python/plugins/processing/tests/testdata/expected/convex_hull_by_feature.gml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="" | ||
xmlns:ogr="http://ogr.maptools.org/" | ||
xmlns:gml="http://www.opengis.net/gml"> | ||
<gml:boundedBy> | ||
<gml:Box> | ||
<gml:coord><gml:X>-1</gml:X><gml:Y>-3</gml:Y></gml:coord> | ||
<gml:coord><gml:X>10</gml:X><gml:Y>6</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:convex_hull_by_feature fid="polys.4"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,-3 2.4,-1.0 3.8,2.2 6,1 6,-3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:intval>120</ogr:intval> | ||
<ogr:floatval>-100291.43213</ogr:floatval> | ||
<ogr:area>11.560000</ogr:area> | ||
<ogr:perimeter>14.117095</ogr:perimeter> | ||
</ogr:convex_hull_by_feature> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:convex_hull_by_feature fid="polys.1"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.2,3.8 4,4 5.4,5.0 6,4 5.2,3.8</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:intval>-33</ogr:intval> | ||
<ogr:floatval>0</ogr:floatval> | ||
<ogr:name>Aaaaa</ogr:name> | ||
<ogr:area>1.200000</ogr:area> | ||
<ogr:perimeter>4.927829</ogr:perimeter> | ||
</ogr:convex_hull_by_feature> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:convex_hull_by_feature fid="polys.0"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:intval>33</ogr:intval> | ||
<ogr:floatval>44.12346</ogr:floatval> | ||
<ogr:name>aaaaa</ogr:name> | ||
<ogr:area>14.500000</ogr:area> | ||
<ogr:perimeter>15.162278</ogr:perimeter> | ||
</ogr:convex_hull_by_feature> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:convex_hull_by_feature fid="polys.3"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.4,-3.0 6.8,1.8 10,1 9.6,-2.2 6.4,-3.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:intval>0</ogr:intval> | ||
<ogr:name>ASDF</ogr:name> | ||
<ogr:area>12.800000</ogr:area> | ||
<ogr:perimeter>14.638510</ogr:perimeter> | ||
</ogr:convex_hull_by_feature> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:convex_hull_by_feature fid="polys.2"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1.6,4.8 2,6 3,6 1.6,4.8</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:floatval>0.123</ogr:floatval> | ||
<ogr:name>bbaaa</ogr:name> | ||
<ogr:area>0.600000</ogr:area> | ||
<ogr:perimeter>4.108820</ogr:perimeter> | ||
</ogr:convex_hull_by_feature> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:convex_hull_by_feature fid="polys.5"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,-3 2.4,-1.0 3.8,2.2 6,1 6,-3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:intval>2</ogr:intval> | ||
<ogr:floatval>3.33</ogr:floatval> | ||
<ogr:name>elim</ogr:name> | ||
<ogr:area>11.560000</ogr:area> | ||
<ogr:perimeter>14.117095</ogr:perimeter> | ||
</ogr:convex_hull_by_feature> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.