Skip to content
Permalink
Browse files

GML is too fragile, but shapefiles, you've never let me down...

  • Loading branch information
nyalldawson committed Nov 29, 2017
1 parent f8bad49 commit 62dbf4ce26e673e54250ab9d0157db2b321bd3b1
Showing with 96 additions and 15 deletions.
  1. +24 −4 python/plugins/processing/tests/testdata/expected/lines_split_with_lines.gml
  2. +12 −2 python/plugins/processing/tests/testdata/expected/lines_split_with_same_lines.gml
  3. BIN python/plugins/processing/tests/testdata/expected/split_lines_with_lines.dbf
  4. +1 −0 python/plugins/processing/tests/testdata/expected/split_lines_with_lines.prj
  5. +1 −0 python/plugins/processing/tests/testdata/expected/split_lines_with_lines.qpj
  6. BIN python/plugins/processing/tests/testdata/expected/split_lines_with_lines.shp
  7. BIN python/plugins/processing/tests/testdata/expected/split_lines_with_lines.shx
  8. BIN python/plugins/processing/tests/testdata/expected/split_lines_with_lines_same.dbf
  9. +2 −2 python/plugins/processing/tests/testdata/expected/split_lines_with_lines_same.gml
  10. +1 −0 python/plugins/processing/tests/testdata/expected/split_lines_with_lines_same.prj
  11. +1 −0 python/plugins/processing/tests/testdata/expected/split_lines_with_lines_same.qpj
  12. BIN python/plugins/processing/tests/testdata/expected/split_lines_with_lines_same.shp
  13. BIN python/plugins/processing/tests/testdata/expected/split_lines_with_lines_same.shx
  14. BIN python/plugins/processing/tests/testdata/expected/split_lines_with_same2.dbf
  15. +1 −0 python/plugins/processing/tests/testdata/expected/split_lines_with_same2.prj
  16. +1 −0 python/plugins/processing/tests/testdata/expected/split_lines_with_same2.qpj
  17. BIN python/plugins/processing/tests/testdata/expected/split_lines_with_same2.shp
  18. BIN python/plugins/processing/tests/testdata/expected/split_lines_with_same2.shx
  19. BIN python/plugins/processing/tests/testdata/expected/split_polys_with_lines.dbf
  20. +3 −3 python/plugins/processing/tests/testdata/expected/split_polys_with_lines.gml
  21. +1 −0 python/plugins/processing/tests/testdata/expected/split_polys_with_lines.prj
  22. +1 −0 python/plugins/processing/tests/testdata/expected/split_polys_with_lines.qpj
  23. BIN python/plugins/processing/tests/testdata/expected/split_polys_with_lines.shp
  24. BIN python/plugins/processing/tests/testdata/expected/split_polys_with_lines.shx
  25. +43 −0 python/plugins/processing/tests/testdata/expected/split_polys_with_lines.xsd
  26. +4 −4 python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
@@ -23,22 +23,42 @@
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.2">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>2,0 2.0,1.86331771490359</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>2.0,1.86331771490359 2,2 3,2 3,3</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>2,0 2.0,1.86331771490359</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.2">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>2.0,1.86331771490359 2,2 3,2 3,3</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.3">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>3,1 4.21601489757914,1.0</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.3">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>3,1 4.21601489757914,1.0</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>4.21601489757914,1.0 5,1</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>4.21601489757914,1.0 5,1</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.4">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>7,-3 8.5655671605538,-3.0</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>8.5655671605538,-3.0 10,-3</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>7,-3 8.5655671605538,-3.0</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.4">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>8.5655671605538,-3.0 10,-3</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.5">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>6,-3 6.91202704418487,-2.08797295581513</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_lines fid="lines.5">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>6,-3 6.91202704418487,-2.08797295581513</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>6.91202704418487,-2.08797295581513 10,1</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>6.91202704418487,-2.08797295581513 10,1</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_lines>
</gml:featureMember>
<gml:featureMember>
@@ -13,12 +13,22 @@

<gml:featureMember>
<ogr:lines_split_with_same_lines fid="lines2.0">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>5.44573945756429,-1.47253129614036 5.70391061452514,-1.99162011173184 8.57234636871508,-2.22039106145251 8.55474860335196,-4.24413407821229</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>0.776536312849161,2.17905027932961 4.04972067039106,1.33435754189944 5.44573945756429,-1.47253129614035</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>5.44573945756429,-1.47253129614036 5.70391061452514,-1.99162011173184 8.57234636871508,-2.22039106145251 8.55474860335196,-4.24413407821229</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_same_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_same_lines fid="lines2.0">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>0.776536312849161,2.17905027932961 4.04972067039106,1.33435754189944 5.44573945756429,-1.47253129614035</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_same_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_same_lines fid="lines2.1">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>7.95642458100559,0.683240223463688 5.44573945756429,-1.47253129614036</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_same_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines_split_with_same_lines fid="lines2.1">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>7.95642458100559,0.683240223463688 5.44573945756429,-1.47253129614036</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>5.44573945756429,-1.47253129614036 4.59525139664804,-2.20279329608939</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>5.44573945756429,-1.47253129614036 4.59525139664804,-2.20279329608939</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:lines_split_with_same_lines>
</gml:featureMember>
</ogr:FeatureCollection>
Binary file not shown.
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
@@ -0,0 +1 @@
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
xsi:schemaLocation="http://ogr.maptools.org/ split_lines_with_lines_same.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
@@ -10,7 +10,7 @@
<gml:coord><gml:X>8.572346368715085</gml:X><gml:Y>2.179050279329609</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:split_lines_with_lines_same fid="lines2.0">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>5.44573945756429,-1.47253129614036 5.70391061452514,-1.99162011173184 8.57234636871508,-2.22039106145251 8.55474860335196,-4.24413407821229</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
@@ -0,0 +1 @@
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
@@ -0,0 +1 @@
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -42,20 +42,20 @@
</ogr:split_polys_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:split_polys_with_lines fid="polys.4">
<ogr:split_polys_with_lines fid="polys.3">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>7,-2 6,-3 6,1 10,1 9,0 7,0 7,-2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:name>ASDF</ogr:name>
<ogr:intval>0</ogr:intval>
</ogr:split_polys_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:split_polys_with_lines fid="polys.5">
<ogr:split_polys_with_lines fid="polys.4">
<ogr:intval>120</ogr:intval>
<ogr:floatval>-100291.43213</ogr:floatval>
</ogr:split_polys_with_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:split_polys_with_lines fid="polys.6">
<ogr:split_polys_with_lines fid="polys.5">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><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></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:name>elim</ogr:name>
<ogr:intval>2</ogr:intval>
@@ -0,0 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
@@ -0,0 +1 @@
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,43 @@
<?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="split_polys_with_lines" type="ogr:split_polys_with_lines_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="split_polys_with_lines_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="name" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="5"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="intval" 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="floatval" 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>
@@ -1986,7 +1986,7 @@ tests:
type: vector
results:
OUTPUT:
name: expected/split_polys_with_lines.gml
name: expected/split_polys_with_lines.shp
type: vector
compare:
geometry:
@@ -2005,7 +2005,7 @@ tests:
type: vector
results:
OUTPUT:
name: expected/split_lines_with_lines_same.gml
name: expected/split_lines_with_same2.shp
type: vector
compare:
geometry:
@@ -2026,7 +2026,7 @@ tests:
type: vector
results:
OUTPUT:
name: expected/lines_split_with_lines.gml
name: expected/split_lines_with_lines.shp
type: vector
compare:
geometry:
@@ -2046,7 +2046,7 @@ tests:
type: vector
results:
OUTPUT:
name: expected/lines_split_with_same_lines.gml
name: expected/split_lines_with_lines_same.shp
type: vector
compare:
geometry:

0 comments on commit 62dbf4c

Please sign in to comment.
You can’t perform that action at this time.