[processing] fix test for clip vector by mask algorithms

This commit is contained in:
Alexander Bruy 2017-09-27 10:59:34 +03:00
parent f65de2caa9
commit 4ac442f5a3
5 changed files with 77 additions and 68 deletions

View File

@ -6,24 +6,33 @@
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>2</gml:X><gml:Y>1</gml:Y></gml:coord>
<gml:coord><gml:X>2</gml:X><gml:Y>-1</gml:Y></gml:coord>
<gml:coord><gml:X>8</gml:X><gml:Y>3</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:clip_lines_by_multipolygon fid="lines.0">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>7,2 8,2</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:clip_lines_by_multipolygon>
<ogr:lines fid="lines.0">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,2 8,2</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:clip_lines_by_multipolygon fid="lines.2">
<ogr:lines fid="lines.2">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>2,1 2,2</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>2,2 3,2</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>3,2 3,3</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:clip_lines_by_multipolygon>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:clip_lines_by_multipolygon fid="lines.3">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>3,1 4,1</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:clip_lines_by_multipolygon>
<ogr:lines fid="lines.3">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>3,1 4,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines fid="lines.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8,-1</gml:coordinates></gml:Point></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines fid="lines.6">
</ogr:lines>
</gml:featureMember>
</ogr:FeatureCollection>

View File

@ -10,12 +10,12 @@
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="clip_lines_by_multipolygon" type="ogr:clip_lines_by_multipolygon_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="clip_lines_by_multipolygon_Type">
<xs:element name="lines" type="ogr:lines_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="lines_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:MultiLineStringPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="geometryProperty" type="gml:LineStringPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>

View File

@ -12,22 +12,22 @@
</gml:boundedBy>
<gml:featureMember>
<ogr:clip_lines_by_polygon fid="lines.1">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>-1,-1 1,-1</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:clip_lines_by_polygon>
<ogr:lines fid="lines.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1,-1 1,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:clip_lines_by_polygon fid="lines.4">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>7,-3 10,-3</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:clip_lines_by_polygon>
<ogr:lines fid="lines.4">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,-3 10,-3</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:clip_lines_by_polygon fid="lines.5">
<ogr:lines fid="lines.5">
<ogr:geometryProperty><gml:MultiLineString srsName="EPSG:4326"><gml:lineStringMember><gml:LineString><gml:coordinates>6,-3 7,-2</gml:coordinates></gml:LineString></gml:lineStringMember><gml:lineStringMember><gml:LineString><gml:coordinates>9,0 10,1</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString></ogr:geometryProperty>
</ogr:clip_lines_by_polygon>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:clip_lines_by_polygon fid="lines.6">
</ogr:clip_lines_by_polygon>
<ogr:lines fid="lines.6">
</ogr:lines>
</gml:featureMember>
</ogr:FeatureCollection>

View File

@ -10,12 +10,12 @@
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="clip_lines_by_polygon" type="ogr:clip_lines_by_polygon_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="clip_lines_by_polygon_Type">
<xs:element name="lines" type="ogr:lines_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="lines_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:MultiLineStringPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="geometryProperty" type="gml:LineStringPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>

View File

@ -563,50 +563,50 @@ tests:
name: expected/gdal/clip_polygons.gml
type: vector
#~ - algorithm: gdal:clipvectorbypolygon
#~ name: Clip lines by polygons
#~ params:
#~ INPUT:
#~ name: lines.gml
#~ type: vector
#~ MASK:
#~ name: polys.gml
#~ type: vector
#~ OPTIONS: ''
#~ results:
#~ OUTPUT:
#~ name: expected/gdal/clip_lines_by_polygon.gml
#~ type: vector
- algorithm: gdal:clipvectorbypolygon
name: Clip points by polygons
params:
INPUT:
name: points.gml
type: vector
MASK:
name: polys.gml
type: vector
OPTIONS: ''
results:
OUTPUT:
name: expected/gdal/clip_points_by_polygon.gml
type: vector
#~ - algorithm: gdal:clipvectorbypolygon
#~ name: Clip lines by multipolygons
#~ params:
#~ INPUT:
#~ name: lines.gml
#~ type: vector
#~ MASK:
#~ name: multipolys.gml
#~ type: vector
#~ OPTIONS: ''
#~ results:
#~ OUTPUT:
#~ name: expected/gdal/clip_lines_by_multipolygon.gml
#~ type: vector
- algorithm: gdal:clipvectorbypolygon
name: Clip lines by polygons
params:
INPUT:
name: lines.gml
type: vector
MASK:
name: polys.gml
type: vector
OPTIONS: ''
results:
OUTPUT:
name: expected/gdal/clip_lines_by_polygon.gml
type: vector
#~ - algorithm: gdal:clipvectorbypolygon
#~ name: Clip points by polygons
#~ params:
#~ INPUT:
#~ name: points.gml
#~ type: vector
#~ MASK:
#~ name: polys.gml
#~ type: vector
#~ OPTIONS: ''
#~ results:
#~ OUTPUT:
#~ name: expected/gdal/clip_points_by_polygon.gml
#~ type: vector
- algorithm: gdal:clipvectorbypolygon
name: Clip lines by multipolygons
params:
INPUT:
name: lines.gml
type: vector
MASK:
name: multipolys.gml
type: vector
OPTIONS: ''
results:
OUTPUT:
name: expected/gdal/clip_lines_by_multipolygon.gml
type: vector
#~ - algorithm: gdal:executesql
#~ name: Execute SQL