QGeoPath#

The QGeoPath class defines a geographic path. More

Inheritance diagram of PySide6.QtPositioning.QGeoPath

Synopsis#

Properties#

  • path - This property holds the list of coordinates for the geo path

  • width - The width of the path in meters

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#

The path is defined by an ordered list of QGeoCoordinate objects.

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 PySide6.QtPositioning.QGeoPath#

PySide6.QtPositioning.QGeoPath(other)

PySide6.QtPositioning.QGeoPath(other)

PySide6.QtPositioning.QGeoPath(path[, width=0.0])

Parameters:

Constructs a new, empty geo path.

Constructs a new geo path from the contents of other.

Constructs a new geo path from the contents of other.

Constructs a new geo path from a list of coordinates (path and width).

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.QtPositioning.QGeoPath.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.

Access functions:
property PᅟySide6.QtPositioning.QGeoPath.width: float#

This property holds the width of the path in meters..

Access functions:
PySide6.QtPositioning.QGeoPath.addCoordinate(coordinate)#
Parameters:

coordinatePySide6.QtPositioning.QGeoCoordinate

Appends coordinate to the path.

PySide6.QtPositioning.QGeoPath.clearPath()#

Clears the path.

PySide6.QtPositioning.QGeoPath.containsCoordinate(coordinate)#
Parameters:

coordinatePySide6.QtPositioning.QGeoCoordinate

Return type:

bool

Returns true if the path contains coordinate as one of the elements.

PySide6.QtPositioning.QGeoPath.coordinateAt(index)#
Parameters:

indexqsizetype

Return type:

PySide6.QtPositioning.QGeoCoordinate

Returns the coordinate at index .

PySide6.QtPositioning.QGeoPath.insertCoordinate(index, coordinate)#
Parameters:

Inserts coordinate at the specified index.

PySide6.QtPositioning.QGeoPath.length([indexFrom=0[, indexTo=-1]])#
Parameters:
  • indexFromqsizetype

  • indexToqsizetype

Return type:

double

Returns the length of the path, in meters, from the element indexFrom to the element indexTo. 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 for indexFrom and size() - 1 for indexTo.

PySide6.QtPositioning.QGeoPath.path()#

Returns all the elements of the path.

See also

setPath()

PySide6.QtPositioning.QGeoPath.removeCoordinate(coordinate)#
Parameters:

coordinatePySide6.QtPositioning.QGeoCoordinate

Removes the last occurrence of coordinate from the path.

PySide6.QtPositioning.QGeoPath.removeCoordinate(index)
Parameters:

indexqsizetype

Removes element at position index from the path.

PySide6.QtPositioning.QGeoPath.replaceCoordinate(index, coordinate)#
Parameters:

Replaces the path element at the specified index with coordinate.

PySide6.QtPositioning.QGeoPath.setPath(path)#
Parameters:

path

Sets all the elements of the path.

See also

path()

PySide6.QtPositioning.QGeoPath.setVariantPath(path)#
Parameters:

path

Setter of property path .

PySide6.QtPositioning.QGeoPath.setWidth(width)#
Parameters:

width – float

See also

width()

Setter of property width .

PySide6.QtPositioning.QGeoPath.size()#
Return type:

qsizetype

Returns the number of elements in the path.

PySide6.QtPositioning.QGeoPath.translate(degreesLatitude, degreesLongitude)#
Parameters:
  • degreesLatitudedouble

  • degreesLongitudedouble

Translates this geo path by degreesLatitude northwards and degreesLongitude eastwards.

Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively.

PySide6.QtPositioning.QGeoPath.translated(degreesLatitude, degreesLongitude)#
Parameters:
  • degreesLatitudedouble

  • degreesLongitudedouble

Return type:

PySide6.QtPositioning.QGeoPath

Returns a copy of this geo path translated by degreesLatitude northwards and degreesLongitude eastwards.

Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively.

See also

translate()

PySide6.QtPositioning.QGeoPath.variantPath()#

Getter of property path .

PySide6.QtPositioning.QGeoPath.width()#
Return type:

float

Returns the width of the path, in meters. This information is used in the contains method. The default value is 0.

See also

setWidth()

Getter of property width .