Skip to content
Permalink
Browse files

Add 5 tests to remove NULL geometries alg with the remove EMPTY geome…

…tries option
  • Loading branch information
gacarrillor authored and nyalldawson committed Mar 14, 2020
1 parent 766b1e4 commit f6ee3e81ce88cb8dd224a2775d34f8f3a8041f9e
Binary file not shown.
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ multi_polys_non_null_non_empty.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>1152380.710241179</gml:X><gml:Y>991995.6506176119</gml:Y><gml:Z>0</gml:Z></gml:coord>
<gml:coord><gml:X>1155226.440646131</gml:X><gml:Y>994672.9721792523</gml:Y><gml:Z>0</gml:Z></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:multi_polys_non_null_non_empty fid="1">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3116"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1153212.63507019,991995.873315548,0 1153206.63873892,991995.650617612,0 1153206.28716221,992005.149060725,0 1153209.30632804,992005.260950644,0 1153212.28369425,992005.371359061,0 1153212.63507019,991995.873315548,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multi_polys_non_null_non_empty>
</gml:featureMember>
<gml:featureMember>
<ogr:multi_polys_non_null_non_empty fid="2">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3116"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1155221.09556005,994660.22300975,0 1155225.70703642,994665.492121154,0 1155226.44064613,994664.81215781,0 1155221.82916974,994659.543046403,0 1155221.09556005,994660.22300975,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multi_polys_non_null_non_empty>
</gml:featureMember>
<gml:featureMember>
<ogr:multi_polys_non_null_non_empty fid="3">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3116"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1155218.1610862,994662.942992519,0 1155216.84296042,994661.436981518,0 1155213.8673808,994664.195071552,0 1155215.22680442,994665.662838767,0 1155215.66683585,994665.25490937,0 1155218.1610862,994662.942992519,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multi_polys_non_null_non_empty>
</gml:featureMember>
<gml:featureMember>
<ogr:multi_polys_non_null_non_empty fid="4">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3116"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1155215.66683187,994665.254893728,0 1155215.22680937,994665.662853824,0 1155213.02579582,994667.703152789,0 1155215.0023435,994669.961178547,0 1155217.6433796,994667.512919493,0 1155215.66683187,994665.254893728,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multi_polys_non_null_non_empty>
</gml:featureMember>
<gml:featureMember>
<ogr:multi_polys_non_null_non_empty fid="5">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3116"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1155222.77277049,994668.212047819,0 1155218.16109298,994662.943021336,0 1155215.66683187,994665.254893728,0 1155217.6433796,994667.512919493,0 1155215.0023435,994669.961178547,0 1155217.63747314,994672.972179252,0 1155222.77277049,994668.212047819,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multi_polys_non_null_non_empty>
</gml:featureMember>
<gml:featureMember>
<ogr:multi_polys_non_null_non_empty fid="6">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3116"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1155216.84296042,994661.436981518,0 1155218.1610862,994662.942992519,0 1155218.30792385,994662.806888921,0 1155216.94851719,994661.339140047,0 1155216.84296042,994661.436981518,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multi_polys_non_null_non_empty>
</gml:featureMember>
<gml:featureMember>
<ogr:multi_polys_non_null_non_empty fid="7">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3116"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1155218.1610862,994662.942992519,0 1155222.77280779,994668.212065019,0 1155223.08625704,994667.921518022,0 1155225.47071869,994665.711277663,0 1155225.70703642,994665.492121158,0 1155221.09556006,994660.223009752,0 1155218.30792385,994662.806888921,0 1155218.1610862,994662.942992519,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multi_polys_non_null_non_empty>
</gml:featureMember>
<gml:featureMember>
<ogr:multi_polys_non_null_non_empty fid="8">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3116"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1152391.40704313,992267.107529733,0 1152383.73923598,992267.815575151,0 1152380.71024118,992271.79589533,0 1152385.61043835,992275.260519417,0 1152391.40704313,992267.107529733,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multi_polys_non_null_non_empty>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,23 @@
<?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="multi_polys_non_null_non_empty" type="ogr:multi_polys_non_null_non_empty_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="multi_polys_non_null_non_empty_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
Binary file not shown.
Binary file not shown.
@@ -184,7 +184,7 @@ tests:
type: rasterhash

- algorithm: native:removenullgeometries
name: Remove null geometries
name: Remove null geometries (do not remove empty)
params:
INPUT:
name: polys.gml
@@ -194,6 +194,75 @@ tests:
name: expected/remove_null_polys.gml
type: vector

- algorithm: native:removenullgeometries
name: Remove null geometries (remove empty)
params:
INPUT:
name: polys.gml
type: vector
REMOVE_EMPTY: true
results:
OUTPUT:
name: expected/remove_null_polys.gml
type: vector

- algorithm: native:removenullgeometries
name: Remove null geometries (do not remove empty, but there is empty data)
params:
INPUT:
name: custom/multi_polys_with_empty_geoms.gpkg|layername=multi_polys_with_empty_geoms
type: vector
results:
OUTPUT:
name: ogr:dbname='expected/multi_polys_non_null_one_empty.gpkg' table="output" (geom) sql=
uri: expected/multi_polys_non_null_one_empty.gpkg|layername=multi_polys_non_null_one_empty
type: vector

- algorithm: native:removenullgeometries
name: Remove null geometries (remove empty, and there is empty data)
params:
INPUT:
name: custom/multi_polys_with_empty_geoms.gpkg|layername=multi_polys_with_empty_geoms
type: vector
REMOVE_EMPTY: true
results:
OUTPUT:
name: expected/multi_polys_non_null_non_empty.gml
type: vector

- algorithm: native:removenullgeometries
name: Remove null geometries, 2 outputs (do not remove empty, but there is empty data)
params:
INPUT:
name: custom/multi_polys_with_empty_geoms.gpkg|layername=multi_polys_with_empty_geoms
type: vector
results:
OUTPUT:
name: ogr:dbname='expected/results_remove_null_geometries.gpkg' table="output" (geom) sql=
uri: expected/results_remove_null_geometries.gpkg|layername=do_not_remove_empty_non_null
type: vector
NULL_OUTPUT:
name: ogr:dbname='expected/results_remove_null_geometries.gpkg' table="output" (geom) sql=
uri: expected/results_remove_null_geometries.gpkg|layername=do_not_remove_empty_null
type: vector

- algorithm: native:removenullgeometries
name: Remove null geometries, 2 outputs (remove empty, and there is empty data)
params:
INPUT:
name: custom/multi_polys_with_empty_geoms.gpkg|layername=multi_polys_with_empty_geoms
type: vector
REMOVE_EMPTY: true
results:
OUTPUT:
name: ogr:dbname='expected/results_remove_null_geometries.gpkg' table="output" (geom) sql=
uri: expected/results_remove_null_geometries.gpkg|layername=remove_empty_non_null
type: vector
NULL_OUTPUT:
name: ogr:dbname='expected/results_remove_null_geometries.gpkg' table="output" (geom) sql=
uri: expected/results_remove_null_geometries.gpkg|layername=remove_empty_null
type: vector

- algorithm: native:extractbyexpression
name: Extract by Expression
params:

0 comments on commit f6ee3e8

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