Skip to content

Commit

Permalink
Merge pull request #5023 from nyalldawson/gdal_test
Browse files Browse the repository at this point in the history
Unblacklist Processing GDAL tests
  • Loading branch information
nyalldawson authored Aug 15, 2017
2 parents 3922efc + aece517 commit 755980f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
1 change: 0 additions & 1 deletion .ci/travis/linux/blacklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ PyQgsAppStartup

# temporary during processing refactoring
ProcessingParametersTest
ProcessingGdalAlgorithmsTest

# code layout tests are run on separate build
qgis_spelling
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def connectParameterSignals(self):
for wrapper in list(self.wrappers.values()):
w = wrapper.widget
self.connectWidgetChangedSignals(w)
for c in w.children():
for c in w.findChildren(QWidget):
self.connectWidgetChangedSignals(c)

def connectWidgetChangedSignals(self, w):
Expand Down
14 changes: 13 additions & 1 deletion python/plugins/processing/algs/gdal/ogr2ogrpointsonlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def group(self):
return self.tr('Vector geoprocessing')

def getConsoleCommands(self, parameters, context, feedback):
fields = self.parameterAsSource(parameters, self.INPUT, context).fields()
ogrLayer, layername = self.getOgrCompatibleSource(self.INPUT, parameters, context, feedback)

distance = str(self.parameterAsDouble(parameters, self.DISTANCE, context))
Expand All @@ -84,6 +85,13 @@ def getConsoleCommands(self, parameters, context, feedback):
output, format = GdalUtils.ogrConnectionStringAndFormat(outFile, context)
options = self.parameterAsString(parameters, self.OPTIONS, context)

other_fields = []
for f in fields:
if f.name() == geometry:
continue

other_fields.append(f.name())

arguments = []
if format:
arguments.append('-f {}'.format(format))
Expand All @@ -94,7 +102,11 @@ def getConsoleCommands(self, parameters, context, feedback):
arguments.append(geometry)
arguments.append(',')
arguments.append(distance)
arguments.append('),*')
arguments.append(')')
arguments.append('AS')
arguments.append(geometry)
arguments.append(',')
arguments.append(','.join(other_fields))
arguments.append('FROM')
arguments.append(layername)
arguments.append('"')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>points_along_lines</Name>
<ElementPath>points_along_lines</ElementPath>
<Name>SELECT</Name>
<ElementPath>SELECT</ElementPath>
<!--POINT-->
<GeometryType>1</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>7</FeatureCount>
<FeatureCount>6</FeatureCount>
<ExtentXMin>-0.50000</ExtentXMin>
<ExtentXMax>7.75000</ExtentXMax>
<ExtentYMin>-3.00000</ExtentYMin>
Expand Down
Original file line number Diff line number Diff line change
@@ -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/ points_along_lines.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
Expand All @@ -12,37 +12,33 @@
</gml:boundedBy>

<gml:featureMember>
<ogr:points_along_lines fid="lines.0">
<ogr:SELECT fid="lines.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7.70710678118655,2.0</gml:coordinates></gml:Point></ogr:geometryProperty>
</ogr:points_along_lines>
</ogr:SELECT>
</gml:featureMember>
<gml:featureMember>
<ogr:points_along_lines fid="lines.1">
<ogr:SELECT fid="lines.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-0.5,-1.0</gml:coordinates></gml:Point></ogr:geometryProperty>
</ogr:points_along_lines>
</ogr:SELECT>
</gml:featureMember>
<gml:featureMember>
<ogr:points_along_lines fid="lines.2">
<ogr:SELECT fid="lines.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2,1</gml:coordinates></gml:Point></ogr:geometryProperty>
</ogr:points_along_lines>
</ogr:SELECT>
</gml:featureMember>
<gml:featureMember>
<ogr:points_along_lines fid="lines.3">
<ogr:SELECT fid="lines.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3.5,1.0</gml:coordinates></gml:Point></ogr:geometryProperty>
</ogr:points_along_lines>
</ogr:SELECT>
</gml:featureMember>
<gml:featureMember>
<ogr:points_along_lines fid="lines.4">
<ogr:SELECT fid="lines.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7.75,-3.0</gml:coordinates></gml:Point></ogr:geometryProperty>
</ogr:points_along_lines>
</ogr:SELECT>
</gml:featureMember>
<gml:featureMember>
<ogr:points_along_lines fid="lines.5">
<ogr:SELECT fid="lines.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7,-2</gml:coordinates></gml:Point></ogr:geometryProperty>
</ogr:points_along_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:points_along_lines fid="lines.6">
</ogr:points_along_lines>
</ogr:SELECT>
</gml:featureMember>
</ogr:FeatureCollection>
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ tests:
OUTPUT:
name: expected/gdal/points_along_lines.gml
type: vector
pk: fid
compare:
ignore_crs_check: true

Expand Down

0 comments on commit 755980f

Please sign in to comment.