Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Dec 14, 2016
1 parent 595ef7f commit 8d8bbabf81b3e967fddd947be7b90a0b9dc6c65b
@@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -47,10 +47,10 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import (OutputNumber,
OutputVector
)
)
from processing.tools import dataobjects, vector

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
@@ -78,13 +78,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Service area (from layer)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
@@ -148,9 +148,9 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoints = dataobjects.getObjectFromUri(
self.getParameterValue(self.START_POINTS))
self.getParameterValue(self.START_POINTS))
strategy = self.getParameterValue(self.STRATEGY)
travelCost = self.getParameterValue(self.TRAVEL_COST)

@@ -237,7 +237,7 @@ def processAlgorithm(self, progress):
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)
for j, v in enumerate(cost):
if v > travelCost and tree[j] != -1:
vertexId = graph.edge(tree [j]).outVertex()
vertexId = graph.edge(tree[j]).outVertex()
if cost[vertexId] <= travelCost:
vertices.append(j)

@@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -48,10 +48,10 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import (OutputNumber,
OutputVector
)
)
from processing.tools import dataobjects

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
@@ -79,13 +79,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Service area (from point)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
@@ -94,7 +94,7 @@ def defineCharacteristics(self):
self.tr('Vector layer representing network'),
[dataobjects.TYPE_VECTOR_LINE]))
self.addParameter(ParameterPoint(self.START_POINT,
self.tr('Start point')))
self.tr('Start point')))
self.addParameter(ParameterSelection(self.STRATEGY,
self.tr('Path type to calculate'),
self.STRATEGIES,
@@ -148,7 +148,7 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoint = self.getParameterValue(self.START_POINT)
strategy = self.getParameterValue(self.STRATEGY)
travelCost = self.getParameterValue(self.TRAVEL_COST)
@@ -205,7 +205,7 @@ def processAlgorithm(self, progress):
vertices = []
for i, v in enumerate(cost):
if v > travelCost and tree[i] != -1:
vertexId = graph.edge(tree [i]).outVertex()
vertexId = graph.edge(tree[i]).outVertex()
if cost[vertexId] <= travelCost:
vertices.append(i)

@@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -49,7 +49,7 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector

@@ -77,13 +77,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Shortest path (layer to point)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
@@ -95,7 +95,7 @@ def defineCharacteristics(self):
self.tr('Vector layer with start points'),
[dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterPoint(self.END_POINT,
self.tr('End point')))
self.tr('End point')))
self.addParameter(ParameterSelection(self.STRATEGY,
self.tr('Path type to calculate'),
self.STRATEGIES,
@@ -143,9 +143,9 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoints = dataobjects.getObjectFromUri(
self.getParameterValue(self.START_POINTS))
self.getParameterValue(self.START_POINTS))
endPoint = self.getParameterValue(self.END_POINT)
strategy = self.getParameterValue(self.STRATEGY)

@@ -226,7 +226,7 @@ def processAlgorithm(self, progress):
route = []

total = 100.0 / count
for i in range(1, count +1):
for i in range(1, count + 1):
idxStart = graph.findVertex(snappedPoints[i])
tree, cost = QgsGraphAnalyzer.dijkstra(graph, idxStart, 0)

@@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -49,7 +49,7 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector

@@ -77,13 +77,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Shortest path (point to layer)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
@@ -92,7 +92,7 @@ def defineCharacteristics(self):
self.tr('Vector layer representing network'),
[dataobjects.TYPE_VECTOR_LINE]))
self.addParameter(ParameterPoint(self.START_POINT,
self.tr('Start point')))
self.tr('Start point')))
self.addParameter(ParameterVector(self.END_POINTS,
self.tr('Vector layer with end points'),
[dataobjects.TYPE_VECTOR_POINT]))
@@ -143,10 +143,10 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoint = self.getParameterValue(self.START_POINT)
endPoints = dataobjects.getObjectFromUri(
self.getParameterValue(self.END_POINTS))
self.getParameterValue(self.END_POINTS))
strategy = self.getParameterValue(self.STRATEGY)

directionFieldName = self.getParameterValue(self.DIRECTION_FIELD)
@@ -227,7 +227,7 @@ def processAlgorithm(self, progress):
route = []

total = 100.0 / count
for i in range(1, count +1):
for i in range(1, count + 1):
idxEnd = graph.findVertex(snappedPoints[i])

if tree[idxEnd] == -1:
@@ -37,7 +37,7 @@
QgsNetworkSpeedStrategy,
QgsGraphBuilder,
QgsGraphAnalyzer
)
)
from qgis.utils import iface

from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -48,10 +48,10 @@
ParameterString,
ParameterTableField,
ParameterSelection
)
)
from processing.core.outputs import (OutputNumber,
OutputVector
)
)
from processing.tools import dataobjects

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]
@@ -79,13 +79,13 @@ def getIcon(self):

def defineCharacteristics(self):
self.DIRECTIONS = OrderedDict([
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])
(self.tr('Forward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Backward direction'), QgsVectorLayerDirector.DirectionForward),
(self.tr('Both directions'), QgsVectorLayerDirector.DirectionForward)])

self.STRATEGIES = [self.tr('Shortest'),
self.tr('Fastest')
]
]

self.name, self.i18n_name = self.trAlgorithm('Shortest path (point to point)')
self.group, self.i18n_group = self.trAlgorithm('Network analysis')
@@ -94,9 +94,9 @@ def defineCharacteristics(self):
self.tr('Vector layer representing network'),
[dataobjects.TYPE_VECTOR_LINE]))
self.addParameter(ParameterPoint(self.START_POINT,
self.tr('Start point')))
self.tr('Start point')))
self.addParameter(ParameterPoint(self.END_POINT,
self.tr('End point')))
self.tr('End point')))
self.addParameter(ParameterSelection(self.STRATEGY,
self.tr('Path type to calculate'),
self.STRATEGIES,
@@ -146,7 +146,7 @@ def defineCharacteristics(self):

def processAlgorithm(self, progress):
layer = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT_VECTOR))
self.getParameterValue(self.INPUT_VECTOR))
startPoint = self.getParameterValue(self.START_POINT)
endPoint = self.getParameterValue(self.END_POINT)
strategy = self.getParameterValue(self.STRATEGY)
@@ -180,7 +180,7 @@ def processAlgorithm(self, progress):

res = False
for predicate in predicates:
res= getattr(inGeom, predicate)(inGeomB)
res = getattr(inGeom, predicate)(inGeomB)
if res:
break

@@ -61,7 +61,7 @@ def processAlgorithm(self, progress):
fieldList = layerA.fields()

writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(fieldList,
QgsWkbTypes.multiType(layerA.wkbType()), layerA.crs())
QgsWkbTypes.multiType(layerA.wkbType()), layerA.crs())

spatialIndex = QgsSpatialIndex()
splitGeoms = {}
@@ -166,7 +166,7 @@ def processAlgorithm(self, progress):
for aGeom in inGeoms:
passed = True

if QgsWkbTypes.geometryType( aGeom.wkbType() ) == QgsWkbTypes.LineGeometry:
if QgsWkbTypes.geometryType(aGeom.wkbType()) == QgsWkbTypes.LineGeometry:
numPoints = aGeom.geometry().numPoints()

if numPoints <= 2:

1 comment on commit 8d8bbab

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson commented on 8d8bbab Dec 15, 2016

@jef-n I think what's happening here is that autopep8 is missing from the qt5 travis environment. That's how these have slipped through.

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