cesium-native 0.50.0
Loading...
Searching...
No Matches
CesiumVectorData::GeoJsonDocument Class Reference

A vector document parsed from GeoJSON. More...

#include <CesiumVectorData/GeoJsonDocument.h>

Public Member Functions

 GeoJsonDocument (GeoJsonObject &&rootObject, std::vector< VectorDocumentAttribution > &&attributions)
 Creates a new GeoJsonDocument directly from a GeoJsonObject.
 

Static Public Member Functions

static CesiumUtility::Result< GeoJsonDocumentfromGeoJson (const std::span< const std::byte > &bytes, std::vector< VectorDocumentAttribution > &&attributions={})
 Attempts to parse a GeoJsonDocument from the provided GeoJSON.
 
static CesiumUtility::Result< GeoJsonDocumentfromGeoJson (const rapidjson::Document &document, std::vector< VectorDocumentAttribution > &&attributions={})
 Attempts to parse a GeoJsonDocument from the provided JSON document.
 
static CesiumAsync::Future< CesiumUtility::Result< GeoJsonDocument > > fromCesiumIonAsset (const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, int64_t ionAssetID, const std::string &ionAccessToken, const std::string &ionAssetEndpointUrl="https://api.cesium.com/")
 Attempts to load a GeoJsonDocument from a Cesium ion asset.
 
static CesiumAsync::Future< CesiumUtility::Result< GeoJsonDocument > > fromUrl (const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &headers={})
 Attempts to load a GeoJsonDocument from the provided URL.
 

Public Attributes

GeoJsonObject rootObject = GeoJsonObject{GeoJsonPoint{glm::dvec3(0, 0, 0)}}
 The root object of the parsed GeoJSON.
 
std::vector< VectorDocumentAttributionattributions
 Attribution information for this document.
 

Detailed Description

A vector document parsed from GeoJSON.

The document is represented as a hierarchy of GeoJsonObject values starting with the root object.

Definition at line 39 of file GeoJsonDocument.h.

Member Function Documentation

◆ fromCesiumIonAsset()

static CesiumAsync::Future< CesiumUtility::Result< GeoJsonDocument > > CesiumVectorData::GeoJsonDocument::fromCesiumIonAsset ( const CesiumAsync::AsyncSystem & asyncSystem,
const std::shared_ptr< CesiumAsync::IAssetAccessor > & pAssetAccessor,
int64_t ionAssetID,
const std::string & ionAccessToken,
const std::string & ionAssetEndpointUrl = "https://api.cesium.com/" )
static

Attempts to load a GeoJsonDocument from a Cesium ion asset.

Parameters
asyncSystemThe CesiumAsync::AsyncSystem.
pAssetAccessorThe CesiumAsync::IAssetAccessor.
ionAssetIDThe ID of the Cesium ion asset to load. This asset must be a GeoJSON document.
ionAccessTokenThe access token that has access to the given asset.
ionAssetEndpointUrlThe base URL of the ion REST API server, if different from https://api.cesium.com/.
Returns
A future that resolves into a CesiumUtility::Result containing the parsed GeoJsonDocument or any errors and warnings that came up while loading or parsing the data.

◆ fromGeoJson() [1/2]

static CesiumUtility::Result< GeoJsonDocument > CesiumVectorData::GeoJsonDocument::fromGeoJson ( const rapidjson::Document & document,
std::vector< VectorDocumentAttribution > && attributions = {} )
static

Attempts to parse a GeoJsonDocument from the provided JSON document.

Parameters
documentThe GeoJSON JSON document.
attributionsAny attributions to attach to the document.
Returns
A CesiumUtility::Result containing the parsed GeoJsonDocument or any errors and warnings that came up while parsing.

◆ fromGeoJson() [2/2]

static CesiumUtility::Result< GeoJsonDocument > CesiumVectorData::GeoJsonDocument::fromGeoJson ( const std::span< const std::byte > & bytes,
std::vector< VectorDocumentAttribution > && attributions = {} )
static

Attempts to parse a GeoJsonDocument from the provided GeoJSON.

Parameters
bytesThe GeoJSON data to parse.
attributionsAny attributions to attach to the document.
Returns
A CesiumUtility::Result containing the parsed GeoJsonDocument or any errors and warnings that came up while parsing.

◆ fromUrl()

static CesiumAsync::Future< CesiumUtility::Result< GeoJsonDocument > > CesiumVectorData::GeoJsonDocument::fromUrl ( const CesiumAsync::AsyncSystem & asyncSystem,
const std::shared_ptr< CesiumAsync::IAssetAccessor > & pAssetAccessor,
const std::string & url,
const std::vector< CesiumAsync::IAssetAccessor::THeader > & headers = {} )
static

Attempts to load a GeoJsonDocument from the provided URL.

Parameters
asyncSystemThe CesiumAsync::AsyncSystem.
pAssetAccessorThe CesiumAsync::IAssetAccessor.
urlThe URL that this method will attempt to get a GeoJSON document from.
headersAny additional headers to attach to the HTTP request to obtain the GeoJSON document.
Returns
A future that resolves into a CesiumUtility::Result containing the parsed GeoJsonDocument or any errors and warnings that came up while loading or parsing the data.

Member Data Documentation

◆ attributions

std::vector<VectorDocumentAttribution> CesiumVectorData::GeoJsonDocument::attributions

Attribution information for this document.

Definition at line 125 of file GeoJsonDocument.h.

◆ rootObject

GeoJsonObject CesiumVectorData::GeoJsonDocument::rootObject = GeoJsonObject{GeoJsonPoint{glm::dvec3(0, 0, 0)}}

The root object of the parsed GeoJSON.

Definition at line 120 of file GeoJsonDocument.h.


The documentation for this class was generated from the following file: