QGeoPath¶
Synopsis¶
Functions¶
def
__eq__
(other)def
__ne__
(other)def
addCoordinate
(coordinate)def
clearPath
()def
containsCoordinate
(coordinate)def
coordinateAt
(index)def
insertCoordinate
(index, coordinate)def
length
([indexFrom=0[, indexTo=-1]])def
path
()def
removeCoordinate
(coordinate)def
removeCoordinate
(index)def
replaceCoordinate
(index, coordinate)def
setPath
(path)def
setVariantPath
(path)def
setWidth
(width)def
size
()def
translate
(degreesLatitude, degreesLongitude)def
translated
(degreesLatitude, degreesLongitude)def
variantPath
()def
width
()
Detailed Description¶
The path is defined by an ordered list of QGeoCoordinates.
Each two adjacent elements in the path are intended to be connected together by the shortest line segment of constant bearing passing through both elements. This type of connection can cross the dateline in the longitudinal direction, but never crosses the poles.
This is relevant for the calculation of the bounding box returned by
boundingGeoRectangle()
for this shape, which will have the latitude of the top left corner set to the maximum latitude in the path point set. Similarly, the latitude of the bottom right corner will be the minimum latitude in the path point set.This class is a
Q_GADGET
. It can be directly used from C++ and QML .A
QGeoPath
is both invalid and empty if it contains no coordinate.Note
A default constructed
QGeoPath
is both invalid and empty as it does not contain any coordinates.
- class PySide2.QtPositioning.QGeoPath¶
PySide2.QtPositioning.QGeoPath(other)
PySide2.QtPositioning.QGeoPath(other)
PySide2.QtPositioning.QGeoPath(path[, width=0.0])
- param path:
- param other:
- param width:
float
Constructs a new, empty geo path.
Constructs a new geo path from a list of coordinates (
path
andwidth
).
- PySide2.QtPositioning.QGeoPath.addCoordinate(coordinate)¶
- Parameters:
coordinate –
PySide2.QtPositioning.QGeoCoordinate
Appends
coordinate
to the path.
- PySide2.QtPositioning.QGeoPath.clearPath()¶
Clears the path.
- PySide2.QtPositioning.QGeoPath.containsCoordinate(coordinate)¶
- Parameters:
coordinate –
PySide2.QtPositioning.QGeoCoordinate
- Return type:
bool
Returns true if the path contains
coordinate
as one of the elements.
- PySide2.QtPositioning.QGeoPath.coordinateAt(index)¶
- Parameters:
index – int
- Return type:
Returns the coordinate at
index
.
- PySide2.QtPositioning.QGeoPath.insertCoordinate(index, coordinate)¶
- Parameters:
index – int
coordinate –
PySide2.QtPositioning.QGeoCoordinate
Inserts
coordinate
at the specifiedindex
.
- PySide2.QtPositioning.QGeoPath.length([indexFrom=0[, indexTo=-1]])¶
- Parameters:
indexFrom – int
indexTo – int
- Return type:
double
Returns the length of the path, in meters, from the element
indexFrom
to the elementindexTo
. The length is intended to be the sum of the shortest distances for each pair of adjacent points.If
indexTo
is -1 (the default value), the length will be including the distance between last coordinate and the first (closed loop). To retrieve the length for the path, use 0 forindexFrom
andsize()
- 1 forindexTo
.
- PySide2.QtPositioning.QGeoPath.__ne__(other)¶
- Parameters:
other –
PySide2.QtPositioning.QGeoPath
- Return type:
bool
Returns whether this geo path is not equal to
other
.
- PySide2.QtPositioning.QGeoPath.__eq__(other)¶
- Parameters:
other –
PySide2.QtPositioning.QGeoPath
- Return type:
bool
Returns whether this geo path is equal to
other
.
- PySide2.QtPositioning.QGeoPath.path()¶
- Return type:
Returns all the elements of the path.
See also
- PySide2.QtPositioning.QGeoPath.removeCoordinate(coordinate)¶
- Parameters:
coordinate –
PySide2.QtPositioning.QGeoCoordinate
- PySide2.QtPositioning.QGeoPath.removeCoordinate(index)
- Parameters:
index – int
Removes element at position
index
from the path.
- PySide2.QtPositioning.QGeoPath.replaceCoordinate(index, coordinate)¶
- Parameters:
index – int
coordinate –
PySide2.QtPositioning.QGeoCoordinate
Replaces the path element at the specified
index
withcoordinate
.
- PySide2.QtPositioning.QGeoPath.setPath(path)¶
- Parameters:
path –
Sets all the elements of the
path
.See also
- PySide2.QtPositioning.QGeoPath.setVariantPath(path)¶
- Parameters:
path –
This property holds This property holds the list of coordinates for the geo path..
Note
The coordinates cannot be processed in place. To change the value of this property, retrieve the complete list of coordinates, process them, and assign the new value to the property.
- PySide2.QtPositioning.QGeoPath.setWidth(width)¶
- Parameters:
width – float
This property holds the width of the path in meters..
- PySide2.QtPositioning.QGeoPath.size()¶
- Return type:
int
Returns the number of elements in the path.
- PySide2.QtPositioning.QGeoPath.translate(degreesLatitude, degreesLongitude)¶
- Parameters:
degreesLatitude –
double
degreesLongitude –
double
Translates this geo path by
degreesLatitude
northwards anddegreesLongitude
eastwards.Negative values of
degreesLatitude
anddegreesLongitude
correspond to southward and westward translation respectively.
- PySide2.QtPositioning.QGeoPath.translated(degreesLatitude, degreesLongitude)¶
- Parameters:
degreesLatitude –
double
degreesLongitude –
double
- Return type:
Returns a copy of this geo path translated by
degreesLatitude
northwards anddegreesLongitude
eastwards.Negative values of
degreesLatitude
anddegreesLongitude
correspond to southward and westward translation respectively.See also
- PySide2.QtPositioning.QGeoPath.variantPath()¶
- Return type:
This property holds This property holds the list of coordinates for the geo path..
Note
The coordinates cannot be processed in place. To change the value of this property, retrieve the complete list of coordinates, process them, and assign the new value to the property.
- PySide2.QtPositioning.QGeoPath.width()¶
- Return type:
float
This property holds the width of the path in meters..
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.