Skip to content
Permalink
Browse files

Add filter feature processing test

  • Loading branch information
m-kuhn committed Apr 9, 2018
1 parent ef676cf commit af18f46c8587ea46794ee2053e930a49a9d6fbf9
@@ -1,102 +1,80 @@
<!DOCTYPE model>
<Option type="Map">
<Option type="Map" name="children">
<Option type="Map" name="native:filter_1">
<Option value="true" type="bool" name="active"/>
<Option type="Map" name="alg_config">
<Option type="List" name="outputs">
<Option name="children" type="Map">
<Option name="native:filter_1" type="Map">
<Option name="active" value="true" type="bool"/>
<Option name="alg_config" type="Map">
<Option name="outputs" type="List">
<Option type="Map">
<Option value="1" type="QString" name="expression"/>
<Option value="true" type="bool" name="isModelOutput"/>
<Option value="all" type="QString" name="name"/>
<Option name="expression" value="&quot;id2&quot; &lt; 1" type="QString"/>
<Option name="isModelOutput" value="true" type="bool"/>
<Option name="name" value="small" type="QString"/>
</Option>
<Option type="Map">
<Option value="0" type="QString" name="expression"/>
<Option value="true" type="bool" name="isModelOutput"/>
<Option value="nothing" type="QString" name="name"/>
<Option name="expression" value="&quot;id2&quot; >= 1" type="QString"/>
<Option name="isModelOutput" value="true" type="bool"/>
<Option name="name" value="big" type="QString"/>
</Option>
</Option>
</Option>
<Option value="native:filter" type="QString" name="alg_id"/>
<Option value="Filter" type="QString" name="component_description"/>
<Option value="623" type="double" name="component_pos_x"/>
<Option value="347" type="double" name="component_pos_y"/>
<Option name="alg_id" value="native:filter" type="QString"/>
<Option name="component_description" value="Filter" type="QString"/>
<Option name="component_pos_x" value="623" type="double"/>
<Option name="component_pos_y" value="347" type="double"/>
<Option name="dependencies"/>
<Option value="native:filter_1" type="QString" name="id"/>
<Option type="Map" name="outputs">
<Option type="Map" name="OUTPUT_all">
<Option value="native:filter_1" type="QString" name="child_id"/>
<Option value="OUTPUT_all" type="QString" name="component_description"/>
<Option value="823" type="double" name="component_pos_x"/>
<Option value="392" type="double" name="component_pos_y"/>
<Option value="OUTPUT_all" type="QString" name="name"/>
<Option value="OUTPUT_all" type="QString" name="output_name"/>
<Option name="id" value="native:filter_1" type="QString"/>
<Option name="outputs" type="Map">
<Option name="OUTPUT_big" type="Map">
<Option name="child_id" value="native:filter_1" type="QString"/>
<Option name="component_description" value="OUTPUT_big" type="QString"/>
<Option name="component_pos_x" value="823" type="double"/>
<Option name="component_pos_y" value="392" type="double"/>
<Option name="name" value="OUTPUT_big" type="QString"/>
<Option name="output_name" value="OUTPUT_big" type="QString"/>
</Option>
<Option type="Map" name="OUTPUT_nothing">
<Option value="native:filter_1" type="QString" name="child_id"/>
<Option value="OUTPUT_nothing" type="QString" name="component_description"/>
<Option value="823" type="double" name="component_pos_x"/>
<Option value="422" type="double" name="component_pos_y"/>
<Option value="OUTPUT_nothing" type="QString" name="name"/>
<Option value="OUTPUT_nothing" type="QString" name="output_name"/>
<Option name="OUTPUT_small" type="Map">
<Option name="child_id" value="native:filter_1" type="QString"/>
<Option name="component_description" value="OUTPUT_small" type="QString"/>
<Option name="component_pos_x" value="823" type="double"/>
<Option name="component_pos_y" value="422" type="double"/>
<Option name="name" value="OUTPUT_small" type="QString"/>
<Option name="output_name" value="OUTPUT_small" type="QString"/>
</Option>
</Option>
<Option value="false" type="bool" name="outputs_collapsed"/>
<Option value="false" type="bool" name="parameters_collapsed"/>
<Option type="Map" name="params">
<Option type="List" name="INPUT">
<Option name="outputs_collapsed" value="false" type="bool"/>
<Option name="parameters_collapsed" value="false" type="bool"/>
<Option name="params" type="Map">
<Option name="INPUT" type="List">
<Option type="Map">
<Option value="layer" type="QString" name="parameter_name"/>
<Option value="0" type="int" name="source"/>
<Option name="parameter_name" value="layer" type="QString"/>
<Option name="source" value="0" type="int"/>
</Option>
</Option>
</Option>
</Option>
</Option>
<Option name="help"/>
<Option value="filter" type="QString" name="model_group"/>
<Option value="filtertest" type="QString" name="model_name"/>
<Option type="Map" name="parameterDefinitions">
<Option type="Map" name="layer">
<Option type="List" name="data_types">
<Option name="model_group" value="filter" type="QString"/>
<Option name="model_name" value="filtertest" type="QString"/>
<Option name="parameterDefinitions" type="Map">
<Option name="layer" type="Map">
<Option name="data_types" type="List">
<Option value="5" type="int"/>
</Option>
<Option value="" type="Unknown" name="default"/>
<Option value="layer" type="QString" name="description"/>
<Option value="0" type="int" name="flags"/>
<Option name="default" value="" type="Unknown"/>
<Option name="description" value="layer" type="QString"/>
<Option name="flags" value="0" type="int"/>
<Option name="metadata"/>
<Option value="layer" type="QString" name="name"/>
<Option value="vector" type="QString" name="parameter_type"/>
</Option>
<Option type="Map" name="native:filter_1:OUTPUT_all">
<Option value="true" type="bool" name="create_by_default"/>
<Option value="-1" type="int" name="data_type"/>
<Option value="" type="Unknown" name="default"/>
<Option value="OUTPUT_all" type="QString" name="description"/>
<Option value="20" type="int" name="flags"/>
<Option name="metadata"/>
<Option value="native:filter_1:OUTPUT_all" type="QString" name="name"/>
<Option value="sink" type="QString" name="parameter_type"/>
<Option value="true" type="bool" name="supports_non_file_outputs"/>
</Option>
<Option type="Map" name="native:filter_1:OUTPUT_nothing">
<Option value="true" type="bool" name="create_by_default"/>
<Option value="-1" type="int" name="data_type"/>
<Option value="" type="Unknown" name="default"/>
<Option value="OUTPUT_nothing" type="QString" name="description"/>
<Option value="20" type="int" name="flags"/>
<Option name="metadata"/>
<Option value="native:filter_1:OUTPUT_nothing" type="QString" name="name"/>
<Option value="sink" type="QString" name="parameter_type"/>
<Option value="true" type="bool" name="supports_non_file_outputs"/>
<Option name="name" value="layer" type="QString"/>
<Option name="parameter_type" value="vector" type="QString"/>
</Option>
</Option>
<Option type="Map" name="parameters">
<Option type="Map" name="layer">
<Option value="layer" type="QString" name="component_description"/>
<Option value="208" type="double" name="component_pos_x"/>
<Option value="291" type="double" name="component_pos_y"/>
<Option value="layer" type="QString" name="name"/>
<Option name="parameters" type="Map">
<Option name="layer" type="Map">
<Option name="component_description" value="layer" type="QString"/>
<Option name="component_pos_x" value="208" type="double"/>
<Option name="component_pos_y" value="291" type="double"/>
<Option name="name" value="layer" type="QString"/>
</Option>
</Option>
</Option>
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ filter_points_big.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>1</gml:X><gml:Y>1</gml:Y></gml:coord>
<gml:coord><gml:X>5</gml:X><gml:Y>3</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:filter_points_big fid="points.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>1</ogr:id>
<ogr:id2>2</ogr:id2>
</ogr:filter_points_big>
</gml:featureMember>
<gml:featureMember>
<ogr:filter_points_big fid="points.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3,3</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>2</ogr:id>
<ogr:id2>1</ogr:id2>
</ogr:filter_points_big>
</gml:featureMember>
<gml:featureMember>
<ogr:filter_points_big fid="points.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5,2</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>4</ogr:id>
<ogr:id2>2</ogr:id2>
</ogr:filter_points_big>
</gml:featureMember>
<gml:featureMember>
<ogr:filter_points_big fid="points.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,1</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>5</ogr:id>
<ogr:id2>1</ogr:id2>
</ogr:filter_points_big>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ filter_points_small.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>0</gml:X><gml:Y>-5</gml:Y></gml:coord>
<gml:coord><gml:X>8</gml:X><gml:Y>2</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:filter_points_small fid="points.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2,2</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>3</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:filter_points_small>
</gml:featureMember>
<gml:featureMember>
<ogr:filter_points_small fid="points.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>6</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:filter_points_small>
</gml:featureMember>
<gml:featureMember>
<ogr:filter_points_small fid="points.6">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8,-1</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>7</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:filter_points_small>
</gml:featureMember>
<gml:featureMember>
<ogr:filter_points_small fid="points.7">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7,-1</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>8</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:filter_points_small>
</gml:featureMember>
<gml:featureMember>
<ogr:filter_points_small fid="points.8">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-1</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>9</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:filter_points_small>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -5176,3 +5176,19 @@ tests:
OUTPUT:
name: expected/swap_xy.gml
type: vector

- algorithm: model:filtertest
name: Test (model:filtertest)
params:
layer:
name: points.gml
type: vector
results:
native:filter_1:OUTPUT_small:
name: expected/filter_points_small.gml
type: vector
native:filter_1:OUTPUT_big:
name: expected/filter_points_big.gml
type: vector

# See ../README.md for a description of the file format

0 comments on commit af18f46

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