Skip to content
Permalink
Browse files

Merge branch 'master' into segment_intersection

  • Loading branch information
lbartoletti committed Dec 16, 2017
2 parents c5d9663 + 252f080 commit 972e7890bc11adb5549ead9ad9981f7a9cc0b23a
Showing 1,433 changed files with 6,066 additions and 19,539 deletions.
@@ -34,8 +34,6 @@ Writes the grid file.
An optional ``feedback`` object can be set for progress reports and cancelation support

:return: 0 in case of success
:rtype: int

%End

};
@@ -48,8 +48,6 @@ The default is a coefficient of 2.

Point values are weighted by 1 / ( distance ^ coefficient ).

:rtype: float

.. seealso:: :py:func:`setDistanceCoefficient()`

.. versionadded:: 3.0
@@ -100,14 +100,13 @@ Source type
virtual int interpolatePoint( double x, double y, double &result, QgsFeedback *feedback = 0 ) = 0;
%Docstring
Calculates interpolation value for map coordinates x, y

:param x: x-coordinate (in map units)
:param y: y-coordinate (in map units)
:param result: out: interpolation result
:param feedback: optional feedback object for progress and cancelation support

:return: 0 in case of success*
:rtype: int

%End


@@ -122,8 +121,6 @@ An optional ``feedback`` argument may be specified to allow cancelation and
progress reports from the cache operation.

:return: Success in case of success
:rtype: Result

%End


@@ -46,8 +46,6 @@ Returns the fields output by features when saving the triangulation.
These fields should be used when creating
a suitable feature sink for setTriangulationSink()

:rtype: QgsFields

.. seealso:: :py:func:`setTriangulationSink()`

.. versionadded:: 3.0
@@ -32,33 +32,26 @@ Constructor for QgsGraphEdge.
QVariant cost( int strategyIndex ) const;
%Docstring
Returns edge cost calculated using specified strategy
:param strategyIndex: strategy index

:rtype: QVariant
:param strategyIndex: strategy index
%End

QVector< QVariant > strategies() const;
%Docstring
Returns array of available strategies

:rtype: list of QVariant
%End

int toVertex() const;
%Docstring
Returns the index of the vertex at the end of this edge.

:rtype: int

.. seealso:: :py:func:`fromVertex()`
%End

int fromVertex() const;
%Docstring
Returns the index of the vertex at the start of this edge.

:rtype: int

.. seealso:: :py:func:`toVertex()`
%End

@@ -95,25 +88,19 @@ This constructor initializes QgsGraphVertex object and associates a vertex with
%Docstring
Returns the incoming edge ids, i.e. edges which end at this node.

:rtype: QgsGraphEdgeIds

.. seealso:: :py:func:`outgoingEdges()`
%End

QgsGraphEdgeIds outgoingEdges() const;
%Docstring
Returns outgoing edge ids, i.e. edges which start at this node.

:rtype: QgsGraphEdgeIds

.. seealso:: :py:func:`incomingEdges()`
%End

QgsPointXY point() const;
%Docstring
Returns point associated with graph vertex.

:rtype: QgsPointXY
%End

};
@@ -141,53 +128,39 @@ Constructor for QgsGraph.
int addVertex( const QgsPointXY &pt );
%Docstring
Add a vertex to the graph

:rtype: int
%End

int addEdge( int fromVertexIdx, int toVertexIdx, const QVector< QVariant > &strategies );
%Docstring
Add an edge to the graph, going from the ``fromVertexIdx``
to ``toVertexIdx``.

:rtype: int
%End

int vertexCount() const;
%Docstring
Returns number of graph vertices

:rtype: int
%End

const QgsGraphVertex &vertex( int idx ) const;
%Docstring
Returns vertex at given index

:rtype: QgsGraphVertex
%End

int edgeCount() const;
%Docstring
Returns number of graph edges

:rtype: int
%End

const QgsGraphEdge &edge( int idx ) const;
%Docstring
Returns edge at given index

:rtype: QgsGraphEdge
%End

int findVertex( const QgsPointXY &pt ) const;
%Docstring
Find vertex by associated point

:return: vertex index
:rtype: int

%End

};
@@ -26,6 +26,7 @@ points using different strategies with Dijkstra algorithm
static SIP_PYLIST dijkstra( const QgsGraph *source, int startVertexIdx, int criterionNum, QVector<int> *resultTree = 0, QVector<double> *resultCost = 0 );
%Docstring
Solve shortest path problem using Dijkstra algorithm

:param source: source graph
:param startVertexIdx: index of the start vertex
:param criterionNum: index of the optimization strategy
@@ -65,11 +66,10 @@ Solve shortest path problem using Dijkstra algorithm
static QgsGraph *shortestTree( const QgsGraph *source, int startVertexIdx, int criterionNum );
%Docstring
Returns shortest path tree with root-node in startVertexIdx

:param source: source graph
:param startVertexIdx: index of the start vertex
:param criterionNum: index of the optimization strategy

:rtype: QgsGraph
%End
};

@@ -41,8 +41,6 @@ MANDATORY BUILDER PROPERTY DECLARATION
QgsGraph *graph() /Factory/;
%Docstring
Returns generated QgsGraph

:rtype: QgsGraph
%End

};
@@ -34,6 +34,7 @@ QgsGraphBuilder and QgsGraphDirector both use a "builder" design pattern
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem &crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString &ellipsoidID = "WGS84" );
%Docstring
Default constructor

:param crs: Coordinate reference system for new graph vertex
:param ctfEnabled: enable coordinate transform from source graph CRS to CRS graph
:param topologyTolerance: sqrt distance between source point as one graph vertex
@@ -45,34 +46,27 @@ Default constructor
QgsCoordinateReferenceSystem destinationCrs() const;
%Docstring
Returns destinaltion CRS

:rtype: QgsCoordinateReferenceSystem
%End

bool coordinateTransformationEnabled();
%Docstring
Returns coordinate transformation enabled

:rtype: bool
%End

double topologyTolerance();
%Docstring
Returns topology tolerance

:rtype: float
%End

QgsDistanceArea *distanceArea();
%Docstring
Returns measurement tool

:rtype: QgsDistanceArea
%End

virtual void addVertex( int id, const QgsPointXY &pt );
%Docstring
Add vertex to the graph

:param id: vertex identifier
:param pt: vertex coordinates

@@ -84,6 +78,7 @@ Add vertex to the graph
virtual void addEdge( int pt1id, const QgsPointXY &pt1, int pt2id, const QgsPointXY &pt2, const QVector< QVariant > &strategies );
%Docstring
Add edge to the graph

:param pt1id: first vertex identificator
:param pt1: first vertex coordinates
:param pt2id: second vertex identificator
@@ -32,8 +32,6 @@ using "builder" design patter.
%End
public:

virtual ~QgsGraphDirector();

virtual void makeGraph( QgsGraphBuilderInterface *builder,
const QVector< QgsPointXY > &additionalPoints,
QVector< QgsPointXY > &snappedPoints /Out/,
@@ -59,8 +57,6 @@ Add optimization strategy
virtual QString name() const = 0;
%Docstring
Returns director name

:rtype: str
%End

protected:
@@ -22,6 +22,7 @@ used for finding shortest path between two points.
%End
public:
virtual QVariant cost( double distance, const QgsFeature & ) const;

};

/************************************************************************
@@ -50,15 +50,11 @@ Default constructor
%Docstring
Returns a list of the source layer attributes needed for cost calculation.
This is method called by QgsGraphDirector.

:rtype: set of int
%End

virtual QVariant cost( double distance, const QgsFeature &f ) const = 0;
%Docstring
Returns edge cost

:rtype: QVariant
%End
};

@@ -39,6 +39,7 @@ class QgsVectorLayerDirector : QgsGraphDirector
);
%Docstring
Default constructor

:param source: feature source representing network
:param directionFieldId: field containing direction value
:param directDirectionValue: value for direct one-way road
@@ -48,8 +49,6 @@ Default constructor
attribute value is not set or does not equal to the given values
%End

virtual ~QgsVectorLayerDirector();

virtual void makeGraph( QgsGraphBuilderInterface *builder,
const QVector< QgsPointXY > &additionalPoints,
QVector< QgsPointXY> &snappedPoints /Out/,

0 comments on commit 972e789

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