内容表

上一话题

QGeoLocation

下一话题

QGeoPolygon

QGeoPath

QGeoPath class defines a geographic path. 更多

Inheritance diagram of PySide2.QtPositioning.QGeoPath

概要

函数

详细描述

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.

注意

A default constructed QGeoPath is both invalid and empty as it does not contain any coordinates.

class QGeoPath

QGeoPath(other)

QGeoPath(other)

QGeoPath(path[, width=0.0])

param path

param other

QGeoPath

param width

qreal

Constructs a new, empty geo path.

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

PySide2.QtPositioning.QGeoPath. addCoordinate ( coordinate )
参数

coordinate QGeoCoordinate

追加 coordinate to the path.

PySide2.QtPositioning.QGeoPath. clearPath ( )

Clears the path.

PySide2.QtPositioning.QGeoPath. containsCoordinate ( coordinate )
参数

coordinate QGeoCoordinate

返回类型

bool

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

PySide2.QtPositioning.QGeoPath. coordinateAt ( index )
参数

index int

返回类型

QGeoCoordinate

Returns the coordinate at index .

PySide2.QtPositioning.QGeoPath. insertCoordinate ( index , coordinate )
参数

插入 coordinate at the specified index .

PySide2.QtPositioning.QGeoPath. length ( [ indexFrom=0 [ , indexTo=-1 ] ] )
参数
  • indexFrom int

  • indexTo int

返回类型

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.

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 .

PySide2.QtPositioning.QGeoPath. __ne__ ( other )
参数

other QGeoPath

返回类型

bool

Returns whether this geo path is not equal to other .

PySide2.QtPositioning.QGeoPath. __eq__ ( other )
参数

other QGeoPath

返回类型

bool

Returns whether this geo path is equal to other .

PySide2.QtPositioning.QGeoPath. path ( )
返回类型

Returns all the elements of the path.

另请参阅

setPath()

PySide2.QtPositioning.QGeoPath. removeCoordinate ( coordinate )
参数

coordinate QGeoCoordinate

PySide2.QtPositioning.QGeoPath. removeCoordinate ( index )
参数

index int

Removes element at position index from the path.

PySide2.QtPositioning.QGeoPath. replaceCoordinate ( index , coordinate )
参数

Replaces the path element at the specified index with coordinate .

PySide2.QtPositioning.QGeoPath. setPath ( path )
参数

path

Sets all the elements of the path .

另请参阅

path()

PySide2.QtPositioning.QGeoPath. setVariantPath ( path )
参数

path

Sets all the elements of the path.

PySide2.QtPositioning.QGeoPath. setWidth ( width )
参数

width qreal

另请参阅

width()

PySide2.QtPositioning.QGeoPath. size ( )
返回类型

int

Returns the number of elements in the path.

PySide2.QtPositioning.QGeoPath. translate ( degreesLatitude , degreesLongitude )
参数
  • degreesLatitude double

  • degreesLongitude double

Translates this geo path by degreesLatitude northwards and degreesLongitude eastwards.

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

PySide2.QtPositioning.QGeoPath. translated ( degreesLatitude , degreesLongitude )
参数
  • degreesLatitude double

  • degreesLongitude double

返回类型

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.

另请参阅

translate()

PySide2.QtPositioning.QGeoPath. variantPath ( )
返回类型

Returns all the elements of the path.

PySide2.QtPositioning.QGeoPath. width ( )
返回类型

qreal

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

另请参阅

setWidth()