mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
processing qgis count points weighted
This commit is contained in:
parent
590abf0a44
commit
94856b59b1
21
python/plugins/processing/tests/testdata/custom/points_weighted.gfs
vendored
Normal file
21
python/plugins/processing/tests/testdata/custom/points_weighted.gfs
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<GMLFeatureClassList>
|
||||
<GMLFeatureClass>
|
||||
<Name>points_wighted</Name>
|
||||
<ElementPath>points_wighted</ElementPath>
|
||||
<!--POINT-->
|
||||
<GeometryType>1</GeometryType>
|
||||
<SRSName>EPSG:4326</SRSName>
|
||||
<DatasetSpecificInfo>
|
||||
<FeatureCount>10</FeatureCount>
|
||||
<ExtentXMin>-0.42606</ExtentXMin>
|
||||
<ExtentXMax>9.09096</ExtentXMax>
|
||||
<ExtentYMin>-2.61064</ExtentYMin>
|
||||
<ExtentYMax>4.22553</ExtentYMax>
|
||||
</DatasetSpecificInfo>
|
||||
<PropertyDefn>
|
||||
<Name>id</Name>
|
||||
<ElementPath>id</ElementPath>
|
||||
<Type>Integer</Type>
|
||||
</PropertyDefn>
|
||||
</GMLFeatureClass>
|
||||
</GMLFeatureClassList>
|
74
python/plugins/processing/tests/testdata/custom/points_weighted.gml
vendored
Normal file
74
python/plugins/processing/tests/testdata/custom/points_weighted.gml
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
<?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>-0.4260638297872343</gml:X><gml:Y>-2.61063829787234</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>9.090957446808511</gml:X><gml:Y>4.225531914893617</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.0">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-0.426063829787234,2.19255319148936</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>5</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.1">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1.45053191489362,1.96914893617021</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>5</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.2">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1.40585106382979,0.807446808510639</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>5</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.3">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0.199468085106383,-0.443617021276596</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>5</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.4">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3.63989361702128,0.315957446808511</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>4</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.5">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4.28776595744681,-0.823404255319149</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>1</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.6">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5.04734042553191,0.070212765957447</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>4</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.7">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>6.90159574468085,0.40531914893617</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>5</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.8">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>9.09095744680851,-2.61063829787234</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>6</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:points_wighted fid="points_wighted.9">
|
||||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5.04734042553191,4.22553191489362</gml:coordinates></gml:Point></ogr:geometryProperty>
|
||||
<ogr:id>8</ogr:id>
|
||||
</ogr:points_wighted>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
37
python/plugins/processing/tests/testdata/expected/count_points_weighted.gfs
vendored
Normal file
37
python/plugins/processing/tests/testdata/expected/count_points_weighted.gfs
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<GMLFeatureClassList>
|
||||
<GMLFeatureClass>
|
||||
<Name>count_points_weighted</Name>
|
||||
<ElementPath>count_points_weighted</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>name</Name>
|
||||
<ElementPath>name</ElementPath>
|
||||
<Type>String</Type>
|
||||
<Width>5</Width>
|
||||
</PropertyDefn>
|
||||
<PropertyDefn>
|
||||
<Name>intval</Name>
|
||||
<ElementPath>intval</ElementPath>
|
||||
<Type>Integer</Type>
|
||||
</PropertyDefn>
|
||||
<PropertyDefn>
|
||||
<Name>floatval</Name>
|
||||
<ElementPath>floatval</ElementPath>
|
||||
<Type>Real</Type>
|
||||
</PropertyDefn>
|
||||
<PropertyDefn>
|
||||
<Name>NUMPOINTS</Name>
|
||||
<ElementPath>NUMPOINTS</ElementPath>
|
||||
<Type>Integer</Type>
|
||||
</PropertyDefn>
|
||||
</GMLFeatureClass>
|
||||
</GMLFeatureClassList>
|
64
python/plugins/processing/tests/testdata/expected/count_points_weighted.gml
vendored
Normal file
64
python/plugins/processing/tests/testdata/expected/count_points_weighted.gml
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
<?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:count_points_weighted 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,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:name>aaaaa</ogr:name>
|
||||
<ogr:intval>33</ogr:intval>
|
||||
<ogr:floatval>44.123456</ogr:floatval>
|
||||
<ogr:NUMPOINTS>20</ogr:NUMPOINTS>
|
||||
</ogr:count_points_weighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:count_points_weighted fid="polys.1">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,5 6,4 4,4 5,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:name>Aaaaa</ogr:name>
|
||||
<ogr:intval>-33</ogr:intval>
|
||||
<ogr:floatval>0</ogr:floatval>
|
||||
<ogr:NUMPOINTS>8</ogr:NUMPOINTS>
|
||||
</ogr:count_points_weighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:count_points_weighted fid="polys.2">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,5 2,6 3,6 3,5 2,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:name>bbaaa</ogr:name>
|
||||
<ogr:floatval>0.123</ogr:floatval>
|
||||
<ogr:NUMPOINTS>0</ogr:NUMPOINTS>
|
||||
</ogr:count_points_weighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:count_points_weighted fid="polys.3">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:name>ASDF</ogr:name>
|
||||
<ogr:intval>0</ogr:intval>
|
||||
<ogr:NUMPOINTS>11</ogr:NUMPOINTS>
|
||||
</ogr:count_points_weighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:count_points_weighted fid="polys.4">
|
||||
<ogr:intval>120</ogr:intval>
|
||||
<ogr:floatval>-100291.43213</ogr:floatval>
|
||||
<ogr:NUMPOINTS>0</ogr:NUMPOINTS>
|
||||
</ogr:count_points_weighted>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:count_points_weighted fid="polys.5">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
<ogr:name>elim</ogr:name>
|
||||
<ogr:intval>2</ogr:intval>
|
||||
<ogr:floatval>3.33</ogr:floatval>
|
||||
<ogr:NUMPOINTS>9</ogr:NUMPOINTS>
|
||||
</ogr:count_points_weighted>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
@ -2147,7 +2147,7 @@ tests:
|
||||
results: {}
|
||||
|
||||
- algorithm: qgis:countuniquepointsinpolygon
|
||||
name: Test (qgis:countuniquepointsinpolygon)
|
||||
name: standard count unique points in polygon
|
||||
params:
|
||||
CLASSFIELD: id2
|
||||
FIELD: NUMPOINTS
|
||||
@ -2161,3 +2161,19 @@ tests:
|
||||
OUTPUT:
|
||||
name: expected/count_unique_points.gml
|
||||
type: vector
|
||||
|
||||
- algorithm: qgis:countpointsinpolygonweighted
|
||||
name: standard count points in polygon wighted
|
||||
params:
|
||||
FIELD: NUMPOINTS
|
||||
POINTS:
|
||||
name: custom/points_weighted.gml
|
||||
type: vector
|
||||
POLYGONS:
|
||||
name: polys.gml
|
||||
type: vector
|
||||
WEIGHT: id
|
||||
results:
|
||||
OUTPUT:
|
||||
name: expected/count_points_weighted.gml
|
||||
type: vector
|
||||
|
Loading…
x
Reference in New Issue
Block a user