内容表

上一话题

QGeoPath

下一话题

QGeoPositionInfo

QGeoPolygon

QGeoPolygon class defines a geographic polygon. 更多 …

Inheritance diagram of PySide2.QtPositioning.QGeoPolygon

New in version 5.10.

概要

函数

详细描述

The polygon is defined by an ordered list of QGeoCoordinates representing its perimeter.

Each two adjacent elements in this list 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 date line 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 .

class QGeoPolygon

QGeoPolygon(other)

QGeoPolygon(other)

QGeoPolygon(path)

param path

param other

QGeoPolygon

Constructs a new, empty geo polygon.

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

coordinate – QGeoCoordinate

追加 coordinate to the polygon.

PySide2.QtPositioning.QGeoPolygon. addHole ( holePath )
参数

holePath –

PySide2.QtPositioning.QGeoPolygon. addHole ( holePath )
参数

holePath – object

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

coordinate – QGeoCoordinate

返回类型

bool

Returns true if the polygon’s perimeter contains coordinate as one of the elements.

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

index – int

返回类型

QGeoCoordinate

Returns the coordinate at index .

PySide2.QtPositioning.QGeoPolygon. hole ( index )
参数

index – int

返回类型

返回 QVariant 包含 QVariant 包含 QList < QGeoCoordinate > which represents the hole at index .

PySide2.QtPositioning.QGeoPolygon. holePath ( index )
参数

index – int

返回类型

返回 QList < QGeoCoordinate > which represents the hole at index .

PySide2.QtPositioning.QGeoPolygon. holesCount ( )
返回类型

int

Returns the number of holes.

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

插入 coordinate at the specified index .

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

  • indexTo – int

返回类型

double

Returns the length of the polygon’s perimeter, 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.

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

other – QGeoPolygon

返回类型

bool

Returns whether this geo polygon is not equal to other .

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

other – QGeoPolygon

返回类型

bool

Returns whether this geo polygon is equal to other .

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

Returns all the elements of the polygon’s boundary.

另请参阅

setPath()

PySide2.QtPositioning.QGeoPolygon. perimeter ( )
返回类型

Returns all the elements of the polygon’s perimeter.

另请参阅

setPerimeter()

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

coordinate – QGeoCoordinate

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

index – int

Removes element at position index from the polygon.

PySide2.QtPositioning.QGeoPolygon. removeHole ( index )
参数

index – int

Removes element at position index from the holes QList .

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

Replaces the path element at the specified index with coordinate .

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

path –

设置 path for the polygon.

另请参阅

path()

PySide2.QtPositioning.QGeoPolygon. setPerimeter ( path )
参数

path –

Sets all the elements of the polygon’s perimeter based on a list of coordinates ( path ). .

另请参阅

perimeter()

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

int

Returns the number of elements in the polygon.

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

  • degreesLongitude – double

Translates this geo polygon by degreesLatitude northwards and degreesLongitude eastwards.

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

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

  • degreesLongitude – double

返回类型

QGeoPolygon

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

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

另请参阅

translate()