このページでは

QGeoPolygon Class

QGeoPolygon クラスは、地理的なポリゴンを定義します。詳細...

ヘッダー: #include <QGeoPolygon>
CMake: find_package(Qt6 REQUIRED COMPONENTS Positioning)
target_link_libraries(mytarget PRIVATE Qt6::Positioning)
qmake: QT += positioning
継承元: QGeoShape

プロパティ

公開関数

QGeoPolygon()
QGeoPolygon(const QGeoShape &other)
QGeoPolygon(const QList<QGeoCoordinate> &path)
QGeoPolygon(const QGeoPolygon &other)
~QGeoPolygon()
void addCoordinate(const QGeoCoordinate &coordinate)
void addHole(const QList<QGeoCoordinate> &holePath)
void addHole(const QVariant &holePath)
bool containsCoordinate(const QGeoCoordinate &coordinate) const
QGeoCoordinate coordinateAt(qsizetype index) const
const QVariantList hole(qsizetype index) const
const QList<QGeoCoordinate> holePath(qsizetype index) const
qsizetype holesCount() const
void insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
double length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const
(since QtPositioning 5.12) const QList<QGeoCoordinate> &perimeter() const
void removeCoordinate(const QGeoCoordinate &coordinate)
void removeCoordinate(qsizetype index)
void removeHole(qsizetype index)
void replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
(since QtPositioning 5.12) void setPerimeter(const QList<QGeoCoordinate> &path)
qsizetype size() const
QString toString() const
void translate(double degreesLatitude, double degreesLongitude)
QGeoPolygon translated(double degreesLatitude, double degreesLongitude) const
QGeoPolygon &operator=(const QGeoPolygon &other)

詳細な説明

ポリゴンは、その周縁を表すQGeoCoordinate オブジェクトの順序付きリストによって定義されます。

このリスト内の隣接する 2 つの要素は、両方の要素を通る、方位角が一定で最短の線分によって接続されることを想定しています。この種の接続は、経線方向で日付変更線を横切ることができますが、極点は決して横切ることがありません。

これは、この形状に対して `QGeoShape::boundingGeoRectangle()` が返すバウンディングボックスの計算に関連しており、その左上隅の緯度は、パスポイントセット内の最大緯度に設定されます。同様に、右下隅の緯度は、パスポイントセット内の最小緯度になります。

このクラスは、QML でも `geoPolygon` として利用可能です。

プロパティのドキュメント

perimeter : QList<QGeoCoordinate>

このプロパティには、ポリゴンの周長の座標が格納されています。

アクセス関数:

const QList<QGeoCoordinate> &perimeter() const
void setPerimeter(const QList<QGeoCoordinate> &path)

メンバ関数のドキュメント

QGeoPolygon::QGeoPolygon()

新しい空のジオポリゴンを生成します。

QGeoPolygon::QGeoPolygon(const QGeoShape &other)

other の内容から、新しいジオポリゴンを生成します。

QGeoPolygon::QGeoPolygon(const QList<QGeoCoordinate> &path)

path で指定された座標から、新しいジオポリゴンを生成します。

QGeoPolygon::QGeoPolygon(const QGeoPolygon &other)

other の内容から、新しいジオポリゴンを生成します。

[noexcept] QGeoPolygon::~QGeoPolygon()

このポリゴンを削除します。

[invokable] void QGeoPolygon::addCoordinate(const QGeoCoordinate &coordinate)

ポリゴンに「coordinate 」を追加します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

void QGeoPolygon::addHole(const QList<QGeoCoordinate> &holePath)

オーバーロードされたメソッド。ポリゴン内の穴のholePath を設定します。穴はQList<QGeoCoordinate>です。

[invokable] void QGeoPolygon::addHole(const QVariant &holePath)

ポリゴン内の穴のholePath を設定します。この穴は、QList<QGeoCoordinate> を含むQVariant です。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] bool QGeoPolygon::containsCoordinate(const QGeoCoordinate &coordinate) const

ポリゴンの周縁に、coordinate が要素の一つとして含まれている場合、true を返します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] QGeoCoordinate QGeoPolygon::coordinateAt(qsizetype index) const

index における座標を返します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] const QVariantList QGeoPolygon::hole(qsizetype index) const

index にある穴を表すQList<QGeoCoordinate> を含むQVariant を返します。

注:この関数は 、メタオブジェクトシステムを介して、およびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

const QList<QGeoCoordinate> QGeoPolygon::holePath(qsizetype index) const

index にある穴を表す、QList<QGeoCoordinate> を返します。

[invokable] qsizetype QGeoPolygon::holesCount() const

穴の数を返します。

注:この関数は 、メタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] void QGeoPolygon::insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate)

指定されたindex にcoordinate を挿入します。

注:この関数は 、メタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] double QGeoPolygon::length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const

要素 `indexFrom ` から要素 `indexTo` までの多角形の周長をメートル単位で返します。この長さは、隣接する各点間の最短距離の合計となるよう設計されています。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[since QtPositioning 5.12] const QList<QGeoCoordinate> &QGeoPolygon::perimeter() const

ポリゴンの周長のすべての要素を返します。

注: プロパティ perimeterのゲッター 関数です。

この関数は QtPositioning 5.12 で導入されました。

関連項目: setPerimeter()。

[invokable] void QGeoPolygon::removeCoordinate(const QGeoCoordinate &coordinate)

ポリゴンから「coordinate 」の最後の出現箇所を削除します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] void QGeoPolygon::removeCoordinate(qsizetype index)

index の位置にある要素をポリゴンから削除します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] void QGeoPolygon::removeHole(qsizetype index)

index の位置にある要素をホールのリストから削除します。

注:この関数は 、メタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] void QGeoPolygon::replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate)

指定されたindex にあるpath要素を、coordinate に置き換えます。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[since QtPositioning 5.12] void QGeoPolygon::setPerimeter(const QList<QGeoCoordinate> &path)

座標のリストpath に基づいて、ポリゴンの境界を設定します。

注: プロパティ `perimeter`のセッター 関数です。

この関数は QtPositioning 5.12 で導入されました。

perimeter()も参照してください 。

[invokable] qsizetype QGeoPolygon::size() const

ポリゴンの要素数を返します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] QString QGeoPolygon::toString() const

ジオポリゴンのプロパティを文字列として返します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] void QGeoPolygon::translate(double degreesLatitude, double degreesLongitude)

このジオポリゴンを、degreesLatitude だけ北方向へ、degreesLongitude だけ東方向へ平行移動させます。

degreesLatitude およびdegreesLongitude の負の値は、それぞれ南方向および西方向への平行移動に対応します。

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[invokable] QGeoPolygon QGeoPolygon::translated(double degreesLatitude, double degreesLongitude) const

このジオポリゴンのコピーを、degreesLatitude を北方向に、degreesLongitude を東方向に変位させたものを返します。

degreesLatitude およびdegreesLongitude の負の値は、それぞれ南方向および西方向への平行移動に対応します。

注:この関数は 、メタオブジェクトシステムおよび QML から呼び出すことができます。Q_INVOKABLE を参照してください。

translate()も参照してください 。

QGeoPolygon &QGeoPolygon::operator=(const QGeoPolygon &other)

このジオポリゴンにother を割り当て、このジオポリゴンへの参照を返します。

© 2026 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.