Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ca71862
Record string metadata
timoore Jun 23, 2026
610ff00
record scalar GeoJson properties
timoore Jun 24, 2026
0e714fc
Change variable name after PR review
timoore Jun 24, 2026
97232b3
Merge branch 'main' into maxar-feature-properties
timoore Jun 24, 2026
5a58575
Fix up clang-tidy and documentation complaints
timoore Jun 24, 2026
1aebd45
Merge branch 'maxar-geojson-schema' into maxar-feature-properties
j9liu Jun 24, 2026
485870d
Fix bugs in schema conversion
timoore Jun 24, 2026
a0b897b
Merge remote-tracking branch 'origin/maxar-feature-properties' into m…
timoore Jun 24, 2026
101c9d5
Don't keep a reference to invalidated memory
timoore Jun 24, 2026
cce3626
Merge remote-tracking branch 'origin/main' into maxar-feature-properties
timoore Jun 24, 2026
da19ae4
Add unit test for GeoJSON metadata and fix exposed problems
timoore Jun 25, 2026
9afa2a2
Respond to PR feedback
timoore Jun 25, 2026
daeb090
Fix shadowing error on Windows
timoore Jun 25, 2026
cf4cecf
More shadowing stuff plus make schema optional
timoore Jun 25, 2026
08d92ee
Use sizeof(uint64_t) instead of sizeof(size_t)
timoore Jun 25, 2026
70a3338
Try again for 32 bit platforms
timoore Jun 26, 2026
6d93a36
Missed a size_t
timoore Jun 26, 2026
ebc4085
Resolve more byte vs size confusion in offsets
timoore Jun 26, 2026
2ed9f01
Merge branch 'maxar-geojson-schema' into maxar-feature-properties
timoore Jun 28, 2026
7014ee8
Include file for clang-tidy
timoore Jun 28, 2026
79feaca
Verify GeoJSON property types against schema
timoore Jun 28, 2026
354cf70
Resolve a clang-tidy warning about unchecked optional value use
timoore Jun 29, 2026
04ba613
Do a better job of validating GeoJSON features against the schema
timoore Jun 29, 2026
369d548
Be liberal in converting GeoJSON values based on the schema
timoore Jun 29, 2026
2a68267
Fix clang-tidy and Windows compilation
timoore Jun 29, 2026
20193c3
Pass intrusive pointer to schema as a reference
timoore Jun 29, 2026
c4fcd3e
Pass external schema to child tileset loaders
timoore Jun 30, 2026
614a01d
Fix CI complaints
timoore Jun 30, 2026
0e4c626
Respond to PR feedback
timoore Jun 30, 2026
c62bb92
Formatting
timoore Jun 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- Modified `resolveProperty.js` to correctly generate struct names when the property name would include invalid characters.
- Added `ExtensionMetadataEntityMaxarContentGeoJson` class to parse the metadata extension part of `MAXAR_content_geojson`.
- Added `ExtensionSchemaMaxarContentGeoJson` class to parse GeoJson tileset schemas.
- Added conversion of GeoJSON feature properties to glTF structural metadata.

### v0.61.0 - 2026-06-01

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include <optional>
#include <vector>

namespace CesiumGltf {
struct Schema;
};

namespace Cesium3DTilesSelection {
class Tile;
class ITilesetHeightSampler;
Expand Down Expand Up @@ -202,6 +206,22 @@ class CESIUM3DTILESSELECTION_API TilesetContentLoader {
*/
void setOwner(TilesetContentManager& owner) noexcept;

/**
* @brief Store a glTF schema object that will be used to parse metadata in a
* loader and its children.
*
* @param schema pointer to Schema.
*/
virtual void setExternalSchema(CesiumGltf::Schema* schema);

/**
* @brief Get the external glTF schema object.
*
* @return A pointer to the Schema.
*/
virtual CesiumUtility::IntrusivePointer<CesiumGltf::Schema>
getExternalSchema();

protected:
/**
* @brief Called by {@link setOwner} to allow the loader to apply the new
Expand Down
8 changes: 8 additions & 0 deletions Cesium3DTilesSelection/src/TilesetContentLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <CesiumAsync/IAssetRequest.h>
#include <CesiumGeometry/Axis.h>
#include <CesiumGeospatial/Ellipsoid.h>
#include <CesiumGltf/Schema.h>
#include <CesiumUtility/IntrusivePointer.h>

#include <spdlog/logger.h>

Expand Down Expand Up @@ -102,4 +104,10 @@ void TilesetContentLoader::setOwner(TilesetContentManager& owner) noexcept {
void TilesetContentLoader::setOwnerOfNestedLoaders(
TilesetContentManager& /*owner*/) noexcept {}

void TilesetContentLoader::setExternalSchema(CesiumGltf::Schema*) {}

CesiumUtility::IntrusivePointer<CesiumGltf::Schema>
TilesetContentLoader::getExternalSchema() {
return nullptr;
}
} // namespace Cesium3DTilesSelection
37 changes: 27 additions & 10 deletions Cesium3DTilesSelection/src/TilesetJsonLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@
#include <CesiumGeospatial/Ellipsoid.h>
#include <CesiumGeospatial/S2CellBoundingVolume.h>
#include <CesiumGeospatial/S2CellID.h>
#include <CesiumGltf/Schema.h>
#include <CesiumGltfReader/GltfReader.h>
#include <CesiumJsonReader/JsonReader.h>
#include <CesiumUtility/Assert.h>
#include <CesiumUtility/ErrorList.h>
#include <CesiumUtility/IntrusivePointer.h>
#include <CesiumUtility/JsonHelpers.h>
#include <CesiumUtility/Result.h>
#include <CesiumUtility/Uri.h>
Expand Down Expand Up @@ -885,7 +887,8 @@ TileLoadResult parseJsonContentInWorkerThread(
const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
std::shared_ptr<CesiumAsync::IAssetRequest>&& pCompletedRequest,
ExternalContentInitializer&& externalContentInitializer,
const CesiumGeospatial::Ellipsoid& ellipsoid) {
const CesiumGeospatial::Ellipsoid& ellipsoid,
const IntrusivePointer<CesiumGltf::Schema>& pExternalSchema) {
const CesiumAsync::IAssetResponse* pResponse = pCompletedRequest->response();
const auto& responseData = pResponse->data();

Expand Down Expand Up @@ -913,7 +916,10 @@ TileLoadResult parseJsonContentInWorkerThread(
std::move(pCompletedRequest));
} else {
CesiumVectorData::ConverterResult converterResult =
CesiumVectorData::GltfConverter::convert(*geoJson.value, ellipsoid);
CesiumVectorData::GltfConverter::convert(
*geoJson.value,
ellipsoid,
pExternalSchema);
if (converterResult.value.has_value() &&
!converterResult.errors.hasErrors()) {
return TileLoadResult{
Expand Down Expand Up @@ -1159,8 +1165,8 @@ TilesetJsonLoader::createLoader(
CesiumVectorData::ConvertSchemaResult schemaResult =
CesiumVectorData::GltfConverter::convertSchema(
*schemaReadResult.value);
if (schemaResult.value) {
result.pLoader->_externalSchema = *schemaResult.value;
if (schemaResult.pValue) {
result.pLoader->_pExternalSchema = schemaResult.pValue;
} else {
SPDLOG_LOGGER_ERROR(
pLogger,
Expand Down Expand Up @@ -1203,6 +1209,7 @@ TilesetJsonLoader::loadTileContent(const TileLoadInput& loadInput) {
const auto& pSharedAssetSystem = loadInput.pSharedAssetSystem;
const auto& requestHeaders = loadInput.requestHeaders;
const auto& contentOptions = loadInput.contentOptions;
const auto& pExternalSchema = this->_pExternalSchema;

// If the URL is empty, this tile is empty content and we don't need to make a
// web request to complete the loading process (in fact, a web request would
Expand Down Expand Up @@ -1236,8 +1243,9 @@ TilesetJsonLoader::loadTileContent(const TileLoadInput& loadInput) {
pAssetAccessor,
asyncSystem,
pSharedAssetSystem,
requestHeaders](std::shared_ptr<CesiumAsync::IAssetRequest>&&
pCompletedRequest) mutable {
requestHeaders,
pExternalSchema](std::shared_ptr<CesiumAsync::IAssetRequest>&&
pCompletedRequest) mutable {
auto pResponse = pCompletedRequest->response();
const std::string& tileUrl = pCompletedRequest->url();
if (!pResponse) {
Expand Down Expand Up @@ -1324,7 +1332,8 @@ TilesetJsonLoader::loadTileContent(const TileLoadInput& loadInput) {
pAssetAccessor,
std::move(pCompletedRequest),
std::move(externalContentInitializer),
ellipsoid));
ellipsoid,
pExternalSchema));
}
});
}
Expand All @@ -1348,17 +1357,17 @@ CesiumGeometry::Axis TilesetJsonLoader::getUpAxis() const noexcept {
return _upAxis;
}

const CesiumGltf::Schema&
const CesiumUtility::IntrusivePointer<CesiumGltf::Schema>&
TilesetJsonLoader::getExternalSchema() const noexcept {
return _externalSchema;
return _pExternalSchema;
}

void TilesetJsonLoader::addChildLoader(
std::unique_ptr<TilesetContentLoader> pLoader) {
if (this->getOwner() != nullptr) {
pLoader->setOwner(*this->getOwner());
}

pLoader->setExternalSchema(this->_pExternalSchema.get());
this->_children.emplace_back(std::move(pLoader));
}

Expand All @@ -1369,4 +1378,12 @@ void TilesetJsonLoader::setOwnerOfNestedLoaders(
}
}

void TilesetJsonLoader::setExternalSchema(CesiumGltf::Schema* schema) {
this->_pExternalSchema = schema;
}

CesiumUtility::IntrusivePointer<CesiumGltf::Schema>
TilesetJsonLoader::getExternalSchema() {
return this->_pExternalSchema;
}
} // namespace Cesium3DTilesSelection
10 changes: 8 additions & 2 deletions Cesium3DTilesSelection/src/TilesetJsonLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <CesiumAsync/Future.h>
#include <CesiumAsync/IAssetAccessor.h>
#include <CesiumGltf/Schema.h>
#include <CesiumUtility/IntrusivePointer.h>

#include <rapidjson/fwd.h>

Expand Down Expand Up @@ -34,7 +35,8 @@ class TilesetJsonLoader : public TilesetContentLoader {

CesiumGeometry::Axis getUpAxis() const noexcept;

const CesiumGltf::Schema& getExternalSchema() const noexcept;
const CesiumUtility::IntrusivePointer<CesiumGltf::Schema>&
getExternalSchema() const noexcept;

void addChildLoader(std::unique_ptr<TilesetContentLoader> pLoader);

Expand All @@ -55,14 +57,18 @@ class TilesetJsonLoader : public TilesetContentLoader {
rapidjson::Document&& tilesetJson,
const CesiumGeospatial::Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);

void setExternalSchema(CesiumGltf::Schema* schema) override;
virtual CesiumUtility::IntrusivePointer<CesiumGltf::Schema>
getExternalSchema() override;

protected:
void setOwnerOfNestedLoaders(TilesetContentManager& owner) noexcept override;

private:
std::string _baseUrl;
CesiumGeospatial::Ellipsoid _ellipsoid;
CesiumUtility::IntrusivePointer<TilesetSharedAssetSystem> _pSharedAssetSystem;
CesiumGltf::Schema _externalSchema;
CesiumUtility::IntrusivePointer<CesiumGltf::Schema> _pExternalSchema;

/**
* @brief The axis that was declared as the "up-axis" for glTF content.
Expand Down
11 changes: 9 additions & 2 deletions CesiumVectorData/include/CesiumVectorData/GltfConverter.h
Comment thread
timoore marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <CesiumGeospatial/Ellipsoid.h>
#include <CesiumGltf/Model.h>
#include <CesiumGltf/Schema.h>
#include <CesiumUtility/IntrusivePointer.h>
#include <CesiumUtility/Result.h>
#include <CesiumVectorData/GeoJsonDocument.h>

Expand All @@ -20,7 +21,8 @@ using ConverterResult = CesiumUtility::Result<CesiumGltf::Model>;
* @brief The result of converting a MAXAR_content_geojson schema to a glTF
* schema.
*/
using ConvertSchemaResult = CesiumUtility::Result<CesiumGltf::Schema>;
using ConvertSchemaResult =
CesiumUtility::Result<CesiumUtility::IntrusivePointer<CesiumGltf::Schema>>;

/**
* @brief Convert GeoJSON documents to glTF.
Expand All @@ -33,11 +35,16 @@ class CESIUMVECTORDATA_API GltfConverter {
*
* @param geoJson The GeoJSON document.
* @param ellipsoid The ellipsoid for GeoJSON coordinates.
* @param pSchema the schema to use for converting GeoJSON feature properties
* to glTF EXT_structural_metadata properties.
* @returns A result object that includes the glTF Model and any errors.
*/
static ConverterResult convert(
const GeoJsonDocument& geoJson,
const CesiumGeospatial::Ellipsoid& ellipsoid);
const CesiumGeospatial::Ellipsoid& ellipsoid,
const CesiumUtility::IntrusivePointer<CesiumGltf::Schema>& pSchema =
nullptr);

/**
* @brief Convert MAXAR_content_geojson schema into a glTF schema.
* @param maxarSchema The schema extension object supplied with a GeoJson
Expand Down
Loading
Loading