![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtLocation \keyword QGeoJson Namespace More...
Functions | |
QVariantList | importGeoJson (const QJsonDocument &geoJson) |
This method imports the geoJson document, expected to contain valid GeoJSON data, into a QVariantList structured like described in the section \l {Importing GeoJSON}. | |
QJsonDocument | exportGeoJson (const QVariantList &geoData) |
This method exports the QVariantList geoData, expected to be structured like described in the section \l {Importing GeoJSON}, to a QJsonDocument containing the data converted to GeoJSON. | |
QTextStream & | operator<< (QTextStream &stream, const QGeoCoordinate &crd) |
QTextStream & | operator<< (QTextStream &stream, const QGeoShape &shape) |
static QString | printQvariant (const QVariant v, int tabs=0) |
QString | toString (const QVariantList &geoData) |
This method accepts the QVariantList geoData, structured as described in \l {Importing GeoJSON}, and returns a string containing the same data in a readable form. | |
\inmodule QtLocation \keyword QGeoJson Namespace
The QGeoJson namespace contains functions to import and export geolocated information from and to GeoJson files.
The methods in the QGeoJson namespace can be used to convert between a GeoJSON document (see the \l {https://en.wikipedia.org/wiki/GeoJSON} {Wikipedia page}, \l {https://tools.ietf.org/html/rfc7946} {RFC}) and a \l QVariantList of \l QVariantMap elements ready to be used as Model in a \l MapItemView.
Q_LOCATION_PRIVATE_EXPORT QJsonDocument QGeoJson::exportGeoJson | ( | const QVariantList & | geoData | ) |
This method exports the QVariantList geoData, expected to be structured like described in the section \l {Importing GeoJSON}, to a QJsonDocument containing the data converted to GeoJSON.
Definition at line 1074 of file qgeojson.cpp.
References QJsonArray::append(), QList< T >::at(), QMap< Key, T >::contains(), exportFeature(), exportFeatureCollection(), exportGeometryCollection(), exportLineString(), exportMultiLineString(), exportMultiPoint(), exportMultiPolygon(), exportPoint(), exportPolygon(), i, QList< T >::isEmpty(), QStringLiteral, QJsonDocument::setObject(), QList< T >::size(), QVariant::value(), and QMap< Key, T >::value().
Q_LOCATION_PRIVATE_EXPORT QVariantList QGeoJson::importGeoJson | ( | const QJsonDocument & | geoJson | ) |
This method imports the geoJson document, expected to contain valid GeoJSON data, into a QVariantList structured like described in the section \l {Importing GeoJSON}.
Definition at line 939 of file qgeojson.cpp.
References QList< T >::append(), QMap< Key, T >::contains(), QVariant::fromValue(), i, importFeatureCollection(), importGeometry(), importGeometryCollection(), importLineString(), importMultiLineString(), importMultiPoint(), importMultiPolygon(), importPoint(), importPolygon(), QMap< Key, T >::insert(), QVariant::isValid(), QJsonDocument::object(), QStringLiteral, QVariant::value(), and QMap< Key, T >::value().
Referenced by injectExtra().
QTextStream & QGeoJson::operator<< | ( | QTextStream & | stream, |
const QGeoCoordinate & | crd | ||
) |
Definition at line 1114 of file qgeojson.cpp.
References QGeoCoordinate::altitude, QGeoCoordinate::latitude, QGeoCoordinate::longitude, and QString::number().
QTextStream & QGeoJson::operator<< | ( | QTextStream & | stream, |
const QGeoShape & | shape | ||
) |
Definition at line 1122 of file qgeojson.cpp.
References QGeoCircle::center, QGeoShape::CircleType, QString::number(), QGeoShape::PathType, QGeoPolygon::perimeter, QGeoShape::PolygonType, QGeoCircle::radius, and QGeoShape::type.
Definition at line 1154 of file qgeojson.cpp.
References QList< T >::at(), QMap< Key, T >::begin(), QGeoShape::CircleType, QMap< Key, T >::contains(), QMap< Key, T >::end(), i, QList< T >::isEmpty(), iter, QMap< Key, T >::keys(), map, QGeoShape::PathType, QGeoShape::PolygonType, printQvariant(), QStringLiteral, QString::remove(), QList< T >::size(), QList< T >::toList(), and QGeoShape::type.
Referenced by printQvariant(), and toString().
Q_LOCATION_PRIVATE_EXPORT QString QGeoJson::toString | ( | const QVariantList & | geoData | ) |
This method accepts the QVariantList geoData, structured as described in \l {Importing GeoJSON}, and returns a string containing the same data in a readable form.
Definition at line 1219 of file qgeojson.cpp.
References QList< T >::first(), QList< T >::isEmpty(), and printQvariant().