PyANGKernel.GKRoute

class GKRoute

Inheritance diagram of PyANGKernel.GKRoute

Inherited by: GKSubPath, GKPublicLine, GKODRoute

Synopsis

Methods

Virtual methods

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

A continuous route between two points of the network specified as a ordered collection of sections.

__init__()
__init__(route)
Parameters:

routeGKRoute

add(section[, after=None])
Parameters:

Adds a section to the route either to the end (after == nullptr or after is not in the route) or after the section “after” (as many times as after is in the route).

static add(routeItems, section[, after=None])
Parameters:
Return type:

int

Adds a section to the route either to the end (after == nullptr or after is not in the route) or after the section “after” (as many times as after is in the route).

Returns the position where the section have been added.

clear()

Clear the route

getMiddleSection()
Return type:

GKSection

Get the middle section of the route

getRoute()
Return type:

.list of GKSection

Returns all sections that are part of a route (in route order).

getRouteIds()
Return type:

.std.vectoruint

Returns all sections IDs that are part of a route (in route order).

getSection(pos)
Parameters:

pos – int

Return type:

GKSection

Returns the section at position “pos” or NULL is the index is incorrect.

getSectionAppearancePositions(section)
Parameters:

sectionGKSection

Return type:

.list of int

Returns a list of all the appearances of the given section and the position in the route (being 0 the first section and Number of sections in the route - 1 if it is the last section

getTurnsInRoute()
Return type:

.list of GKTurning

returns the turns in the route

insert(pos, section)
Parameters:

Inserts a section in the route immediately before pos

isCorrect([errorID=None[, indexSection=None[, previousSection=None[, scenario=None]]]])
Parameters:
  • errorID – int

  • indexSection – int

  • previousSection – int

  • scenarioGKGenericScenario

Return type:

bool

Returns true if the route is connected (we can go from section to section from the beginning of the route to the end and in the same order as specified in the route). If the route is not complete the ID of first section that is not connected is returned in the errorID if it has been supplied. Also, the previous section to the error one and its position in the list of sections are returned.

isOnlyMicro(aMicroObjects)
Parameters:

aMicroObjects – .QSetGKGeoObject

Return type:

bool

length3D()
Return type:

float

Returns total length of the route (including all sections and turns)

prepend(section[, before=None])
Parameters:

Adds a section to the route either as the first section of the route (before == nullptr or before is not in the route) or before the section “before” (as many times as before is in the route).

static prepend(routeItems, section[, before=None])
Parameters:
remove(section)
Parameters:

sectionGKSection

Return type:

.list of GKSection

Removes a section from the route and return the sections that was before the section (a section can be N times in a line).

setRoute(sections)
Parameters:

sections – .list of GKSection

Sets the sections used by this route. No check is done on the sections navegability.

setSection(pos, section)
Parameters:

Changes the section at position “pos”.

use(section)
Parameters:

sectionGKSection

Return type:

bool

Returns true if section is in the route

use(turning)
Parameters:

turningGKTurning

Return type:

bool

Returns true if turning is in the route (connects two consecutive sections of the route).