Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[processing] Fix Rectangles/Ovals/...(variable) chokes on angle value…
…s of 0 Change the test to a NULL test instead, as angle values of 0 are valid
- Loading branch information
Showing
with
156 additions
and 7 deletions.
- +26 −7 python/plugins/processing/algs/qgis/RectanglesOvalsDiamondsVariable.py
- +77 −0 python/plugins/processing/tests/testdata/expected/rectanglesovalsdiamondsvariable.gml
- +37 −0 python/plugins/processing/tests/testdata/expected/rectanglesovalsdiamondsvariable.xsd
- +16 −0 python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://ogr.maptools.org/ rectanglesovalsdiamondsvariable.xsd" | ||
xmlns:ogr="http://ogr.maptools.org/" | ||
xmlns:gml="http://www.opengis.net/gml"> | ||
<gml:boundedBy> | ||
<gml:Box> | ||
<gml:coord><gml:X>-4.5</gml:X><gml:Y>-8</gml:Y></gml:coord> | ||
<gml:coord><gml:X>11.5</gml:X><gml:Y>4.068580647443193</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:rectanglesovalsdiamondsvariable fid="points.0"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0.482854838139202,0.517754334841703 0.517754334841703,1.5171451618608 1.5171451618608,1.4822456651583 1.4822456651583,0.482854838139202 0.482854838139202,0.517754334841703</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:id>1</ogr:id> | ||
<ogr:id2>2</ogr:id2> | ||
</ogr:rectanglesovalsdiamondsvariable> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:rectanglesovalsdiamondsvariable fid="points.1"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1.98269989840633,2.01760471128089 2.01760471128089,4.01730010159367 4.01730010159367,3.98239528871911 3.98239528871911,1.98269989840633 1.98269989840633,2.01760471128089</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:id>2</ogr:id> | ||
<ogr:id2>1</ogr:id2> | ||
</ogr:rectanglesovalsdiamondsvariable> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:rectanglesovalsdiamondsvariable fid="points.2"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0.5,0.5 0.5,3.5 3.5,3.5 3.5,0.5 0.5,0.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:id>3</ogr:id> | ||
<ogr:id2>0</ogr:id2> | ||
</ogr:rectanglesovalsdiamondsvariable> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:rectanglesovalsdiamondsvariable fid="points.3"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.93141935255681,0.07101733936681 3.07101733936681,4.06858064744319 7.06858064744319,3.92898266063319 6.92898266063319,-0.068580647443194 2.93141935255681,0.07101733936681</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:id>4</ogr:id> | ||
<ogr:id2>2</ogr:id2> | ||
</ogr:rectanglesovalsdiamondsvariable> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:rectanglesovalsdiamondsvariable fid="points.4"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1.45674974601581,-1.45598822179777 1.54401177820223,3.54325025398419 6.54325025398419,3.45598822179777 6.45598822179777,-1.54325025398419 1.45674974601581,-1.45598822179777</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:id>5</ogr:id> | ||
<ogr:id2>1</ogr:id2> | ||
</ogr:rectanglesovalsdiamondsvariable> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:rectanglesovalsdiamondsvariable fid="points.5"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-3,-8 -3,-2 3,-2 3,-8 -3,-8</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:id>6</ogr:id> | ||
<ogr:id2>0</ogr:id2> | ||
</ogr:rectanglesovalsdiamondsvariable> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:rectanglesovalsdiamondsvariable fid="points.6"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.5,-4.5 4.5,2.5 11.5,2.5 11.5,-4.5 4.5,-4.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:id>7</ogr:id> | ||
<ogr:id2>0</ogr:id2> | ||
</ogr:rectanglesovalsdiamondsvariable> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:rectanglesovalsdiamondsvariable fid="points.7"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,-5 3,3 11,3 11,-5 3,-5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:id>8</ogr:id> | ||
<ogr:id2>0</ogr:id2> | ||
</ogr:rectanglesovalsdiamondsvariable> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:rectanglesovalsdiamondsvariable fid="points.8"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-4.5,-5.5 -4.5,3.5 4.5,3.5 4.5,-5.5 -4.5,-5.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:id>9</ogr:id> | ||
<ogr:id2>0</ogr:id2> | ||
</ogr:rectanglesovalsdiamondsvariable> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
@@ -0,0 +1,37 @@ | ||
<?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="rectanglesovalsdiamondsvariable" type="ogr:rectanglesovalsdiamondsvariable_Type" substitutionGroup="gml:_Feature"/> | ||
<xs:complexType name="rectanglesovalsdiamondsvariable_Type"> | ||
<xs:complexContent> | ||
<xs:extension base="gml:AbstractFeatureType"> | ||
<xs:sequence> | ||
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/> | ||
<xs:element name="id" 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="id2" nillable="true" minOccurs="0" maxOccurs="1"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:integer"> | ||
<xs:totalDigits value="10"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
</xs:sequence> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
</xs:schema> |