Skip to content
Permalink
Browse files

Merge pull request #5143 from m-kuhn/nulldatasetparams

QgsVectorFilewriter skip default null options
  • Loading branch information
m-kuhn committed Sep 20, 2017
2 parents e6169d8 + a6dc600 commit b1b21ed25f3933eb32bd6e4c7a9788539e3e6704
Showing with 235 additions and 200 deletions.
  1. +3 −3 python/plugins/processing/algs/qgis/FieldPyculator.py
  2. +0 −31 python/plugins/processing/tests/testdata/expected/buffer_polys_dissolve.gfs
  3. +6 −6 python/plugins/processing/tests/testdata/expected/buffer_polys_dissolve.gml
  4. +43 −0 python/plugins/processing/tests/testdata/expected/buffer_polys_dissolve.xsd
  5. +0 −21 python/plugins/processing/tests/testdata/expected/line_intersection.gfs
  6. +1 −1 python/plugins/processing/tests/testdata/expected/line_intersection.gml
  7. +30 −0 python/plugins/processing/tests/testdata/expected/line_intersection.xsd
  8. +0 −31 python/plugins/processing/tests/testdata/expected/pycalculator_points.gfs
  9. +1 −1 python/plugins/processing/tests/testdata/expected/pycalculator_points.gml
  10. +44 −0 python/plugins/processing/tests/testdata/expected/pycalculator_points.xsd
  11. +0 −15 python/plugins/processing/tests/testdata/expected/single_sided_buffer_line.gfs
  12. +4 −4 python/plugins/processing/tests/testdata/expected/single_sided_buffer_line.gml
  13. +23 −0 python/plugins/processing/tests/testdata/expected/single_sided_buffer_line.xsd
  14. +0 −14 python/plugins/processing/tests/testdata/expected/single_sided_buffer_multiline_bevel.gfs
  15. +3 −3 python/plugins/processing/tests/testdata/expected/single_sided_buffer_multiline_bevel.gml
  16. +23 −0 python/plugins/processing/tests/testdata/expected/single_sided_buffer_multiline_bevel.xsd
  17. +0 −30 python/plugins/processing/tests/testdata/expected/variable_buffer_points.gfs
  18. +0 −30 python/plugins/processing/tests/testdata/expected/variable_buffer_points_dissolved.gfs
  19. +5 −5 python/plugins/processing/tests/testdata/expected/variable_buffer_points_dissolved.gml
  20. +44 −0 python/plugins/processing/tests/testdata/expected/variable_buffer_points_dissolved.xsd
  21. +5 −5 src/core/qgsvectorfilewriter.cpp
@@ -52,7 +52,7 @@ class FieldsPyculator(QgisAlgorithm):
OUTPUT = 'OUTPUT'
RESULT_VAR_NAME = 'value'

TYPES = [QVariant.Int, QVariant.Double, QVariant.String]
TYPES = [QVariant.LongLong, QVariant.Double, QVariant.String]

def group(self):
return self.tr('Vector table')
@@ -97,8 +97,8 @@ def processAlgorithm(self, parameters, context, feedback):
globalExpression = self.parameterAsString(parameters, self.GLOBAL, context)

fields = source.fields()
fields.append(QgsField(field_name, self.TYPES[field_type], '',
width, precision))
field = QgsField(field_name, field_type, '', width, precision)
fields.append(field)
new_ns = {}

(sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context,

This file was deleted.

@@ -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/ buffer_polys_dissolve.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
@@ -12,11 +12,11 @@
</gml:boundedBy>

<gml:featureMember>
<ogr:buffer_polys_dissolve fid="polys.5">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.0,4.5 1.845491502812524,4.524471741852424 1.706107373853762,4.595491502812528 1.595491502812525,4.706107373853764 1.524471741852423,4.845491502812527 1.5,5.0 1.5,6.0 1.524471741852423,6.154508497187474 1.595491502812526,6.293892626146237 1.706107373853764,6.404508497187473 1.845491502812526,6.475528258147577 2.0,6.5 3.0,6.5 3.154508497187474,6.475528258147577 3.293892626146237,6.404508497187473 3.404508497187474,6.293892626146237 3.475528258147577,6.154508497187473 3.5,6.0 3.5,5.0 3.475528258147577,4.845491502812527 3.404508497187474,4.706107373853763 3.293892626146237,4.595491502812527 3.154508497187474,4.524471741852423 3.0,4.5 2.0,4.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.081138830084189,1.5 10.0,1.5 10.154508497187473,1.475528258147577 10.293892626146237,1.404508497187474 10.404508497187473,1.293892626146237 10.475528258147577,1.154508497187474 10.5,1.0 10.5,-3.0 10.475528258147577,-3.154508497187474 10.404508497187473,-3.293892626146237 10.293892626146237,-3.404508497187474 10.154508497187473,-3.475528258147577 10.0,-3.5 6.0,-3.5 5.967204424203256,-3.494805691082312 5.9378741657362,-3.496125367943453 5.896595974946731,-3.483622411364633 5.845491502812524,-3.475528258147576 5.8097507214254,-3.457317420446019 5.776393202250021,-3.447213595499958 1.881966011250105,-1.5 -1.0,-1.5 -1.154508497187476,-1.475528258147576 -1.293892626146238,-1.404508497187473 -1.404508497187475,-1.293892626146235 -1.475528258147577,-1.154508497187473 -1.5,-1.0 -1.5,3.0 -1.475528258147577,3.154508497187474 -1.404508497187474,3.293892626146237 -1.293892626146236,3.404508497187474 -1.154508497187474,3.475528258147577 -1.0,3.5 3.0,3.5 3.154508497187474,3.475528258147577 3.293892626146237,3.404508497187474 3.404508497187474,3.293892626146237 3.475528258147577,3.154508497187474 3.5,3.0 3.5,2.360379610028063 6.081138830084189,1.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7.5,-0.5 7.5,-1.5 8.5,-1.5 8.5,-0.5 7.5,-0.5</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.646446609406726,5.353553390593274 4.773004750130227,5.445503262094184 4.921782767479884,5.493844170297569 5.078217232520116,5.493844170297569 5.226995249869773,5.445503262094184 5.353553390593274,5.353553390593274 6.353553390593274,4.353553390593274 6.440960632174177,4.235698368412999 6.490392640201615,4.097545161008064 6.497592363336098,3.95099142983522 6.461939766255643,3.808658283817455 6.386505226681368,3.682803357918177 6.277785116509802,3.584265193848728 6.145142338627231,3.521529832133896 6.0,3.5 4.0,3.5 3.834860469022414,3.528058334845817 3.688255099070632,3.609084258765987 3.576637900385857,3.733983961742333 3.512536043909088,3.888739533021844 3.503143895053379,4.055982238051655 3.54951556604879,4.21694186955878 3.646446609406726,4.353553390593274 4.646446609406726,5.353553390593274</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:name>elim</ogr:name>
<ogr:intval>2</ogr:intval>
<ogr:floatval>3.33</ogr:floatval>
<ogr:buffer_polys_dissolve fid="buffer_polys_dissolve.0">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.0,4.5 1.84549150281252,4.52447174185242 1.70610737385376,4.59549150281253 1.59549150281253,4.70610737385376 1.52447174185242,4.84549150281253 1.5,5.0 1.5,6.0 1.52447174185242,6.15450849718747 1.59549150281253,6.29389262614624 1.70610737385376,6.40450849718747 1.84549150281253,6.47552825814758 2.0,6.5 3.0,6.5 3.15450849718747,6.47552825814758 3.29389262614624,6.40450849718747 3.40450849718747,6.29389262614624 3.47552825814758,6.15450849718747 3.5,6.0 3.5,5.0 3.47552825814758,4.84549150281253 3.40450849718747,4.70610737385376 3.29389262614624,4.59549150281253 3.15450849718747,4.52447174185242 3.0,4.5 2.0,4.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.08113883008419,1.5 10.0,1.5 10.1545084971875,1.47552825814758 10.2938926261462,1.40450849718747 10.4045084971875,1.29389262614624 10.4755282581476,1.15450849718747 10.5,1.0 10.5,-3.0 10.4755282581476,-3.15450849718747 10.4045084971875,-3.29389262614624 10.2938926261462,-3.40450849718747 10.1545084971875,-3.47552825814758 10.0,-3.5 6.0,-3.5 5.96720442420326,-3.49480569108231 5.9378741657362,-3.49612536794345 5.89659597494673,-3.48362241136463 5.84549150281252,-3.47552825814758 5.8097507214254,-3.45731742044602 5.77639320225002,-3.44721359549996 1.88196601125011,-1.5 -1.0,-1.5 -1.15450849718748,-1.47552825814758 -1.29389262614624,-1.40450849718747 -1.40450849718747,-1.29389262614624 -1.47552825814758,-1.15450849718747 -1.5,-1.0 -1.5,3.0 -1.47552825814758,3.15450849718747 -1.40450849718747,3.29389262614624 -1.29389262614624,3.40450849718747 -1.15450849718747,3.47552825814758 -1.0,3.5 3.0,3.5 3.15450849718747,3.47552825814758 3.29389262614624,3.40450849718747 3.40450849718747,3.29389262614624 3.47552825814758,3.15450849718747 3.5,3.0 3.5,2.36037961002806 6.08113883008419,1.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7.5,-0.5 7.5,-1.5 8.5,-1.5 8.5,-0.5 7.5,-0.5</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.64644660940673,5.35355339059327 4.77300475013023,5.44550326209418 4.92178276747988,5.49384417029757 5.07821723252012,5.49384417029757 5.22699524986977,5.44550326209418 5.35355339059327,5.35355339059327 6.35355339059327,4.35355339059327 6.44096063217418,4.235698368413 6.49039264020162,4.09754516100806 6.4975923633361,3.95099142983522 6.46193976625564,3.80865828381746 6.38650522668137,3.68280335791818 6.2777851165098,3.58426519384873 6.14514233862723,3.5215298321339 6.0,3.5 4.0,3.5 3.83486046902241,3.52805833484582 3.68825509907063,3.60908425876599 3.57663790038586,3.73398396174233 3.51253604390909,3.88873953302184 3.50314389505338,4.05598223805166 3.54951556604879,4.21694186955878 3.64644660940673,4.35355339059327 4.64644660940673,5.35355339059327</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:name xsi:nil="true"/>
<ogr:intval xsi:nil="true"/>
<ogr:floatval xsi:nil="true"/>
</ogr:buffer_polys_dissolve>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -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="buffer_polys_dissolve" type="ogr:buffer_polys_dissolve_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="buffer_polys_dissolve_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" 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>

This file was deleted.

@@ -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/ line_intersection.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
@@ -0,0 +1,30 @@
<?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="line_intersection" type="ogr:line_intersection_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="line_intersection_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="fid_1" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

This file was deleted.

@@ -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/ pycalculator_points.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
@@ -0,0 +1,44 @@
<?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="pycalculator_points" type="ogr:pycalculator_points_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="pycalculator_points_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PointPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="id" 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="id2" 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="new_field" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:long">
<xs:totalDigits value="11"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

This file was deleted.

0 comments on commit b1b21ed

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