Skip to content

Commit 33e25be

Browse files
committed
[processing] add test for v.net.distance algorithm
(cherry picked from commit dbe2cb7)
1 parent 0da67d2 commit 33e25be

File tree

9 files changed

+120
-0
lines changed

9 files changed

+120
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ end_point.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>1003696.648020304</gml:X><gml:Y>6222370.049363472</gml:Y></gml:coord>
10+
<gml:coord><gml:X>1003696.648020304</gml:X><gml:Y>6222370.049363472</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:point_end fid="point_end.0">
16+
<ogr:geometryProperty><gml:Point srsName="EPSG:32733"><gml:coordinates>1003696.6480203,6222370.04936347</gml:coordinates></gml:Point></ogr:geometryProperty>
17+
</ogr:point_end>
18+
</gml:featureMember>
19+
</ogr:FeatureCollection>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="point_end" type="ogr:point_end_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="point_end_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
</xs:sequence>
20+
</xs:extension>
21+
</xs:complexContent>
22+
</xs:complexType>
23+
</xs:schema>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://ogr.maptools.org/ start_point.xsd"
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>1000993.609479388</gml:X><gml:Y>6220361.983185438</gml:Y></gml:coord>
10+
<gml:coord><gml:X>1000993.609479388</gml:X><gml:Y>6220361.983185438</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:point_start fid="point_start.0">
16+
<ogr:geometryProperty><gml:Point srsName="EPSG:32733"><gml:coordinates>1000993.60947939,6220361.98318544</gml:coordinates></gml:Point></ogr:geometryProperty>
17+
</ogr:point_start>
18+
</gml:featureMember>
19+
</ogr:FeatureCollection>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
4+
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
5+
<xs:complexType name="FeatureCollectionType">
6+
<xs:complexContent>
7+
<xs:extension base="gml:AbstractFeatureCollectionType">
8+
<xs:attribute name="lockId" type="xs:string" use="optional"/>
9+
<xs:attribute name="scope" type="xs:string" use="optional"/>
10+
</xs:extension>
11+
</xs:complexContent>
12+
</xs:complexType>
13+
<xs:element name="point_start" type="ogr:point_start_Type" substitutionGroup="gml:_Feature"/>
14+
<xs:complexType name="point_start_Type">
15+
<xs:complexContent>
16+
<xs:extension base="gml:AbstractFeatureType">
17+
<xs:sequence>
18+
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
19+
</xs:sequence>
20+
</xs:extension>
21+
</xs:complexContent>
22+
</xs:complexType>
23+
</xs:schema>
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PROJCS["WGS_1984_UTM_Zone_33S",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",10000000],UNIT["Meter",1]]
Binary file not shown.
Binary file not shown.

python/plugins/processing/tests/testdata/grass7_algorithms_vector_tests.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,41 @@ tests:
194194
name: expected/grass7/v_net_centrality.shp
195195
type: vector
196196

197+
- algorithm: grass7:v.net.distance
198+
name: v.net.distance
199+
params:
200+
-g: false
201+
-l: false
202+
GRASS_MIN_AREA_PARAMETER: 0.0001
203+
GRASS_OUTPUT_TYPE_PARAMETER: 0
204+
GRASS_SNAP_TOLERANCE_PARAMETER: -1.0
205+
GRASS_VECTOR_DSCO: ''
206+
GRASS_VECTOR_EXPORT_NOCAT: false
207+
GRASS_VECTOR_LCO: ''
208+
arc_type:
209+
- 0
210+
- 1
211+
flayer:
212+
name: custom/grass7/point_start.gml|layername=point_start
213+
type: vector
214+
from_cats: ''
215+
from_where: ''
216+
input:
217+
name: roads.gml|layername=roads
218+
type: vector
219+
threshold: 50.0
220+
tlayer:
221+
name: custom/grass7/point_end.gml|layername=point_end
222+
type: vector
223+
to_cats: ''
224+
to_type:
225+
- 0
226+
to_where: ''
227+
results:
228+
output:
229+
name: expected/grass7/v_net_distance.shp
230+
type: vector
231+
197232
- algorithm: grass7:v.net.salesman
198233
name: v.net.salesman
199234
params:

0 commit comments

Comments
 (0)