Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
\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_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 1070 of file qgeojson.cpp.
References QList< T >::append(), exportFeature(), exportFeatureCollection(), exportGeometryCollection(), exportLineString(), exportMultiLineString(), exportMultiPoint(), exportMultiPolygon(), exportPoint(), exportPolygon(), i, QStringLiteral, QVariant::value(), QMap< Key, T >::value(), and QList< T >::value().
Q_LOCATION_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 935 of file qgeojson.cpp.
References QVariant::fromValue(), i, importFeatureCollection(), importGeometry(), importGeometryCollection(), importLineString(), importMultiLineString(), importMultiPoint(), importMultiPolygon(), importPoint(), importPolygon(), QMap< Key, T >::insert(), QStringLiteral, QVariant::value(), and QMap< Key, T >::value().
Referenced by injectExtra(), and QDeclarativeGeoJsonData::openUrl().
QTextStream & QGeoJson::operator<< | ( | QTextStream & | stream, |
const QGeoCoordinate & | crd ) |
Definition at line 1110 of file qgeojson.cpp.
References QString::number().
QTextStream & QGeoJson::operator<< | ( | QTextStream & | stream, |
const QGeoShape & | shape ) |
Definition at line 1118 of file qgeojson.cpp.
References QGeoCircle::center, QGeoShape::CircleType, QString::number(), QGeoShape::PathType, QGeoShape::PolygonType, QGeoCircle::radius, and QGeoShape::type.
Definition at line 1150 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, QList< T >::size(), and QList< T >::toList().
Referenced by printQvariant(), and toString().
Q_LOCATION_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 1215 of file qgeojson.cpp.
References printQvariant().