mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
changed check for validity from isGeosValid() to validateGeometry() in dissolve.py
This commit is contained in:
parent
53d40e893c
commit
c445828f9e
@ -31,6 +31,7 @@ from PyQt.QtGui import QIcon
|
||||
|
||||
from qgis.core import QgsFeature, QgsGeometry
|
||||
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
from processing.core.GeoAlgorithm import GeoAlgorithm
|
||||
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
|
||||
from processing.core.parameters import ParameterVector
|
||||
@ -86,15 +87,31 @@ class Dissolve(GeoAlgorithm):
|
||||
if first:
|
||||
attrs = inFeat.attributes()
|
||||
tmpInGeom = QgsGeometry(inFeat.geometry())
|
||||
if tmpInGeom.isGeosEmpty() or not tmpInGeom.isGeosValid():
|
||||
if tmpInGeom.isGeosEmpty():
|
||||
continue
|
||||
errors = tmpInGeom.validateGeometry()
|
||||
if len(errors) != 0:
|
||||
for error in errors:
|
||||
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
|
||||
self.tr('ValidateGeometry() error: One or '
|
||||
'more input features have invalid '
|
||||
'geometry: ') + error.what())
|
||||
continue
|
||||
outFeat.setGeometry(tmpInGeom)
|
||||
first = False
|
||||
else:
|
||||
tmpInGeom = QgsGeometry(inFeat.geometry())
|
||||
if tmpInGeom.isGeosEmpty() or not tmpInGeom.isGeosValid():
|
||||
if tmpInGeom.isGeosEmpty():
|
||||
continue
|
||||
tmpOutGeom = QgsGeometry(outFeat.geometry())
|
||||
errors = tmpInGeom.validateGeometry()
|
||||
if len(errors) != 0:
|
||||
for error in errors:
|
||||
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
|
||||
self.tr('ValidateGeometry() error: One or '
|
||||
'more input features have invalid '
|
||||
'geometry: ') + error.what())
|
||||
continue
|
||||
try:
|
||||
tmpOutGeom = QgsGeometry(tmpOutGeom.combine(tmpInGeom))
|
||||
outFeat.setGeometry(tmpOutGeom)
|
||||
@ -119,8 +136,15 @@ class Dissolve(GeoAlgorithm):
|
||||
attrs = inFeat.attributes()
|
||||
tempItem = attrs[fieldIdx]
|
||||
tmpInGeom = QgsGeometry(inFeat.geometry())
|
||||
if tmpInGeom.isGeosEmpty() or not tmpInGeom.isGeosValid():
|
||||
if tmpInGeom.isGeosEmpty():
|
||||
continue
|
||||
errors = tmpInGeom.validateGeometry()
|
||||
if len(errors) != 0:
|
||||
for error in errors:
|
||||
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
|
||||
self.tr('ValidateGeometry() error: One or '
|
||||
'more input features have invalid '
|
||||
'geometry: ') + error.what())
|
||||
|
||||
if attrDict[unicode(tempItem).strip()] is None:
|
||||
# keep attributes of first feature
|
||||
|
14
python/plugins/processing/tests/testdata/PolygonDissolveTest.gfs
vendored
Normal file
14
python/plugins/processing/tests/testdata/PolygonDissolveTest.gfs
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
<GMLFeatureClassList>
|
||||
<GMLFeatureClass>
|
||||
<Name>PolygonDissolveTest</Name>
|
||||
<ElementPath>PolygonDissolveTest</ElementPath>
|
||||
<SRSName>EPSG:3003</SRSName>
|
||||
<DatasetSpecificInfo>
|
||||
<FeatureCount>5</FeatureCount>
|
||||
<ExtentXMin>1754260.45566</ExtentXMin>
|
||||
<ExtentXMax>1757508.42502</ExtentXMax>
|
||||
<ExtentYMin>5078929.55554</ExtentYMin>
|
||||
<ExtentYMax>5080666.09361</ExtentYMax>
|
||||
</DatasetSpecificInfo>
|
||||
</GMLFeatureClass>
|
||||
</GMLFeatureClassList>
|
39
python/plugins/processing/tests/testdata/PolygonDissolveTest.gml
vendored
Normal file
39
python/plugins/processing/tests/testdata/PolygonDissolveTest.gml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
<?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>1754260.455664067</gml:X><gml:Y>5078929.555537455</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>1757508.425015694</gml:X><gml:Y>5080666.093606642</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:PolygonDissolveTest fid="PolygonDissolveTest.0">
|
||||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3003"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1754299.045398937771097,5080010.068113837391138 1754260.45566406683065,5078929.555537454783916 1755411.716087712906301,5078993.87176223937422 1755450.305822583613917,5080010.068113837391138 1754299.045398937771097,5080010.068113837391138</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>1754684.942747645778582,5079585.581030257977545 1754665.647880210541189,5079263.999906335026026 1755135.156321138609201,5079263.999906335026026 1755141.587943617254496,5079643.465632564388216 1754684.942747645778582,5079585.581030257977545</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1755450.305822583613917,5080010.068113837391138 1756402.185949397273362,5080010.068113837391138 1756389.322704440215603,5080640.36711672693491 1755456.737445062259212,5080640.36711672693491 1755450.305822583613917,5080010.068113837391138</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
|
||||
</ogr:PolygonDissolveTest>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:PolygonDissolveTest fid="PolygonDissolveTest.1">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:3003"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1755450.305822583613917,5080010.068113837391138 1755411.716087712906301,5078993.87176223937422 1756337.869724612450227,5078974.576894803903997 1756402.185949397273362,5080010.068113837391138 1755958.403998382855207,5079984.341623923741281 1755778.318568985676393,5079727.076724784448743 1756164.215917693683878,5079637.034010086208582 1755849.066416248911992,5079958.615134009160101 1755450.305822583613917,5080010.068113837391138</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>1755887.656151119619608,5079373.33748846873641 1755868.361283684149384,5079109.640966851264238 1756074.173202995210886,5079103.209344373084605 1756080.60482547362335,5079309.021263684146106 1755887.656151119619608,5079373.33748846873641</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:PolygonDissolveTest>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:PolygonDissolveTest fid="PolygonDissolveTest.2">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:3003"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1756337.869724612450227,5078974.576894803903997 1756402.185949397273362,5080010.068113837391138 1757399.087433559820056,5080003.636491358280182 1757289.749851425876841,5078981.008517282083631 1756337.869724612450227,5078974.576894803903997</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:PolygonDissolveTest>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:PolygonDissolveTest fid="PolygonDissolveTest.3">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:3003"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1755450.305822583613917,5080010.068113837391138 1755456.737445062259212,5080640.36711672693491 1754318.34026637300849,5080666.093606641516089 1754299.045398937771097,5080010.068113837391138 1755450.305822583613917,5080010.068113837391138</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>1754774.985462344484404,5080447.418442373163998 1754762.122217387426645,5080260.90139049757272 1754935.776024306192994,5080254.469768019393086 1754942.207646784605458,5080402.397085024043918 1754774.985462344484404,5080447.418442373163998</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:PolygonDissolveTest>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:PolygonDissolveTest fid="PolygonDissolveTest.4">
|
||||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3003"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1756402.185949397273362,5080010.068113837391138 1756389.322704440215603,5080640.36711672693491 1757341.202831253642216,5080633.935494248755276 1757399.087433559820056,5080003.636491358280182 1756402.185949397273362,5080010.068113837391138</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1757476.266903301468119,5080350.944105195812881 1757193.275514248991385,5080344.512482717633247 1757173.980646813521162,5080106.542451013810933 1757508.425015693763271,5080125.837318449281156 1757476.266903301468119,5080350.944105195812881</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
|
||||
</ogr:PolygonDissolveTest>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
36
python/plugins/processing/tests/testdata/custom/innerRingTouchesOuterRing.gfs
vendored
Normal file
36
python/plugins/processing/tests/testdata/custom/innerRingTouchesOuterRing.gfs
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<GMLFeatureClassList>
|
||||
<GMLFeatureClass>
|
||||
<Name>innerRingTouchesOuterRing</Name>
|
||||
<ElementPath>innerRingTouchesOuterRing</ElementPath>
|
||||
<!--MULTIPOLYGON-->
|
||||
<GeometryType>6</GeometryType>
|
||||
<SRSName>EPSG:3003</SRSName>
|
||||
<DatasetSpecificInfo>
|
||||
<FeatureCount>19</FeatureCount>
|
||||
<ExtentXMin>1754447.79750</ExtentXMin>
|
||||
<ExtentXMax>1757996.40354</ExtentXMax>
|
||||
<ExtentYMin>5078658.22018</ExtentYMin>
|
||||
<ExtentYMax>5080667.30082</ExtentYMax>
|
||||
</DatasetSpecificInfo>
|
||||
<PropertyDefn>
|
||||
<Name>DN</Name>
|
||||
<ElementPath>DN</ElementPath>
|
||||
<Type>Integer</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>area2</Name>
|
||||
<ElementPath>area2</ElementPath>
|
||||
<Type>Real</Type>
|
||||
</PropertyDefn>
|
||||
</GMLFeatureClass>
|
||||
</GMLFeatureClassList>
|
185
python/plugins/processing/tests/testdata/custom/innerRingTouchesOuterRing.gml
vendored
Normal file
185
python/plugins/processing/tests/testdata/custom/innerRingTouchesOuterRing.gml
vendored
Normal file
File diff suppressed because one or more lines are too long
19
python/plugins/processing/tests/testdata/expected/PolygonDissolveTest_output.gml
vendored
Normal file
19
python/plugins/processing/tests/testdata/expected/PolygonDissolveTest_output.gml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ PolygonDissolveTest_output.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>1754260.455664067</gml:X><gml:Y>5078929.555537455</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>1757399.08743356</gml:X><gml:Y>5080666.093606642</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:PolygonDissolveTest_output fid="PolygonDissolveTest.0">
|
||||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3003"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1755450.305822583613917,5080010.068113837391138 1755411.71608771267347,5078993.87176223937422 1754260.45566406683065,5078929.555537454783916 1754299.045398937538266,5080010.068113837391138 1754318.34026637324132,5080666.093606641516089 1755456.737445062026381,5080640.36711672693491 1756389.322704440215603,5080640.36711672693491 1756402.185949397040531,5080010.068113837391138 1755450.305822583613917,5080010.068113837391138</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>1754684.94274764531292,5079585.581030257046223 1754665.647880210541189,5079263.999906335957348 1755135.156321138842031,5079263.999906335957348 1755141.587943617487326,5079643.465632563456893 1754684.94274764531292,5079585.581030257046223</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>1754774.985462343785912,5080447.418442373163998 1754762.122217387426645,5080260.90139049757272 1754935.776024306192994,5080254.469768019393086 1754942.207646784605458,5080402.397085024043918 1754774.985462343785912,5080447.418442373163998</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1756337.869724612915888,5078974.576894803903997 1756402.185949397040531,5080010.068113837391138 1757399.087433559587225,5080003.636491358280182 1757289.74985142564401,5078981.008517282083631 1756337.869724612915888,5078974.576894803903997</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
|
||||
</ogr:PolygonDissolveTest_output>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
23
python/plugins/processing/tests/testdata/expected/PolygonDissolveTest_output.xsd
vendored
Normal file
23
python/plugins/processing/tests/testdata/expected/PolygonDissolveTest_output.xsd
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="PolygonDissolveTest_output" type="ogr:PolygonDissolveTest_output_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="PolygonDissolveTest_output_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
23
python/plugins/processing/tests/testdata/expected/innerRingTouchesOuterRing_output.gml
vendored
Normal file
23
python/plugins/processing/tests/testdata/expected/innerRingTouchesOuterRing_output.gml
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ innerRingTouchesOuterRing_output.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>1754447.797502899</gml:X><gml:Y>5078658.220182008</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>1757996.403537979</gml:X><gml:Y>5080667.300822261</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:innerRingTouchesOuterRing_output fid="innerRingtouchesOuterRing.0">
|
||||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3003"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1756000.153752481099218,5078705.956589923240244 1754455.495129873743281,5078742.894078725017607 1754447.79750289930962,5080667.300822260789573 1755877.226238435367122,5080654.843926962465048 1756000.153752481099218,5080653.772663222625852 1756184.545023549813777,5080652.16576761752367 1757981.008284030715004,5080636.510314363986254 1757996.403537979349494,5078658.220182008109987 1756368.936294619226828,5078697.137876959517598 1756061.617509504081681,5078704.48680442944169 1756000.153752481099218,5078705.956589923240244</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
|
||||
<ogr:DN>2</ogr:DN>
|
||||
<ogr:AREA>45333.519531</ogr:AREA>
|
||||
<ogr:PERIMETER>1106.347626</ogr:PERIMETER>
|
||||
<ogr:area2>45333.52</ogr:area2>
|
||||
</ogr:innerRingTouchesOuterRing_output>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
48
python/plugins/processing/tests/testdata/expected/innerRingTouchesOuterRing_output.xsd
vendored
Normal file
48
python/plugins/processing/tests/testdata/expected/innerRingTouchesOuterRing_output.xsd
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="innerRingTouchesOuterRing_output" type="ogr:innerRingTouchesOuterRing_output_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="innerRingTouchesOuterRing_output_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="DN" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:integer">
|
||||
<xs:totalDigits value="10"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="AREA" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="PERIMETER" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="area2" nillable="true" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:decimal">
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
19
python/plugins/processing/tests/testdata/expected/nullgeometries_output.gml
vendored
Normal file
19
python/plugins/processing/tests/testdata/expected/nullgeometries_output.gml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ogr:FeatureCollection
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ogr.maptools.org/ nullgeometries_output.xsd"
|
||||
xmlns:ogr="http://ogr.maptools.org/"
|
||||
xmlns:gml="http://www.opengis.net/gml">
|
||||
<gml:boundedBy>
|
||||
<gml:Box>
|
||||
<gml:coord><gml:X>1754831.111262239</gml:X><gml:Y>5078864.273510087</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>1758058.328737603</gml:X><gml:Y>5080811.88216704</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:nullgeometries_output fid="nullGeometryDissolve.0">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:3003"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1756812.050985608249903,5080657.52322755753994 1758058.328737602569163,5080656.446172921918333 1758032.602247689384967,5078868.455123908817768 1756869.935587913962081,5078877.136755040846765 1755007.051325645996258,5078864.273510087281466 1754831.111262238584459,5080811.882167040370405 1756812.050985608249903,5080657.52322755753994</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:nullgeometries_output>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
23
python/plugins/processing/tests/testdata/expected/nullgeometries_output.xsd
vendored
Normal file
23
python/plugins/processing/tests/testdata/expected/nullgeometries_output.xsd
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
|
||||
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
|
||||
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
|
||||
<xs:complexType name="FeatureCollectionType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureCollectionType">
|
||||
<xs:attribute name="lockId" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="scope" type="xs:string" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:element name="nullgeometries_output" type="ogr:nullgeometries_output_Type" substitutionGroup="gml:_Feature"/>
|
||||
<xs:complexType name="nullgeometries_output_Type">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="gml:AbstractFeatureType">
|
||||
<xs:sequence>
|
||||
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
|
||||
</xs:sequence>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
16
python/plugins/processing/tests/testdata/nullGeometryDissolve.gfs
vendored
Normal file
16
python/plugins/processing/tests/testdata/nullGeometryDissolve.gfs
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<GMLFeatureClassList>
|
||||
<GMLFeatureClass>
|
||||
<Name>nullGeometryDissolve</Name>
|
||||
<ElementPath>nullGeometryDissolve</ElementPath>
|
||||
<!--POLYGON-->
|
||||
<GeometryType>3</GeometryType>
|
||||
<SRSName>EPSG:3003</SRSName>
|
||||
<DatasetSpecificInfo>
|
||||
<FeatureCount>3</FeatureCount>
|
||||
<ExtentXMin>1754831.11126</ExtentXMin>
|
||||
<ExtentXMax>1758058.32874</ExtentXMax>
|
||||
<ExtentYMin>5078864.27351</ExtentYMin>
|
||||
<ExtentYMax>5080811.88217</ExtentYMax>
|
||||
</DatasetSpecificInfo>
|
||||
</GMLFeatureClass>
|
||||
</GMLFeatureClassList>
|
28
python/plugins/processing/tests/testdata/nullGeometryDissolve.gml
vendored
Normal file
28
python/plugins/processing/tests/testdata/nullGeometryDissolve.gml
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?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>1754831.111262239</gml:X><gml:Y>5078864.273510087</gml:Y></gml:coord>
|
||||
<gml:coord><gml:X>1758058.328737603</gml:X><gml:Y>5080811.88216704</gml:Y></gml:coord>
|
||||
</gml:Box>
|
||||
</gml:boundedBy>
|
||||
|
||||
<gml:featureMember>
|
||||
<ogr:nullGeometryDissolve fid="nullGeometryDissolve.0">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:3003"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1756812.050985608249903,5080657.52322755753994 1756869.935587913962081,5078877.136755041778088 1758032.602247689384967,5078868.455123908817768 1758058.328737603034824,5080656.446172922849655 1756812.050985608249903,5080657.52322755753994</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:nullGeometryDissolve>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:nullGeometryDissolve fid="nullGeometryDissolve.1">
|
||||
</ogr:nullGeometryDissolve>
|
||||
</gml:featureMember>
|
||||
<gml:featureMember>
|
||||
<ogr:nullGeometryDissolve fid="nullGeometryDissolve.2">
|
||||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:3003"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1755007.051325645996258,5078864.273510087281466 1756869.935587913962081,5078877.136755041778088 1756812.050985608249903,5080657.52322755753994 1754831.111262238817289,5080811.882167040370405 1755007.051325645996258,5078864.273510087281466</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
|
||||
</ogr:nullGeometryDissolve>
|
||||
</gml:featureMember>
|
||||
</ogr:FeatureCollection>
|
@ -187,3 +187,44 @@ tests:
|
||||
type: vector
|
||||
|
||||
|
||||
- name: dissolve
|
||||
algorithm: qgis:dissolve
|
||||
#input is valid as validateGeometry(), but invalid in isGeosValid()
|
||||
params:
|
||||
- type: vector
|
||||
name: custom/innerRingTouchesOuterRing.gml
|
||||
- True # Dissolve all
|
||||
- None # unique ID field
|
||||
results:
|
||||
OUTPUT:
|
||||
type: vector
|
||||
name: expected/innerRingTouchesOuterRing_output.gml
|
||||
|
||||
- name: dissolve
|
||||
algorithm: qgis:dissolve
|
||||
#input contains NULL geometries
|
||||
params:
|
||||
- type: vector
|
||||
name: nullGeometryDissolve.gml
|
||||
- True # Dissolve all
|
||||
- None # unique ID field
|
||||
results:
|
||||
OUTPUT:
|
||||
type: vector
|
||||
name: expected/nullGeometryDissolve_output.gml
|
||||
|
||||
- name: dissolve
|
||||
algorithm: qgis:dissolve
|
||||
#input contains invalid geometries
|
||||
params:
|
||||
- type: vector
|
||||
name: PolygonDissolveTest.gml
|
||||
- True # Dissolve all
|
||||
- None # unique ID field
|
||||
results:
|
||||
OUTPUT:
|
||||
type: vector
|
||||
name: expected/PolygonDissolveTest_output.gml
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user