Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added I3S data source support in Cesium #9634

Merged
merged 66 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
7b01bde
Added I3S data source support in Cesium
Tamrat-B Jun 23, 2021
4b7c081
Fixes for travis-ci issues
Tamrat-B Jun 24, 2021
37bf80a
Fixed lint issues
Tamrat-B Jun 30, 2021
dbdb35d
Additional eslint fixes
Tamrat-B Jul 2, 2021
882b9b6
log clean ups
Tamrat-B Jul 6, 2021
0e566d0
- Updated i3s support to cesiumjs 1.87
Tamrat-B Nov 9, 2021
1d575f8
-Removed default access tokens
Tamrat-B Nov 9, 2021
8010d82
- Run prettier
Tamrat-B Nov 9, 2021
c01868a
formatting fix
Tamrat-B Nov 9, 2021
413eaad
Merge branch 'CesiumGS:main' into cesium_i3s_support
Tamrat-B Jul 7, 2022
6aa4fd7
Updates to I3S support
Tamrat-B Jul 7, 2022
ab8033b
Updated samples
Tamrat-B Jul 8, 2022
27348e0
Merge branch 'CesiumGS:main' into cesium_i3s_support
Tamrat-B Jul 8, 2022
4240326
Refactoring to satisfy Travis CI errors
Tamrat-B Jul 8, 2022
0d887a6
eslint fixes...
Tamrat-B Jul 8, 2022
9dbd070
Updated samples, added ability to consume an i3s layer from service a…
Tamrat-B Jul 9, 2022
3fa1e71
Merge branch 'CesiumGS:main' into cesium_i3s_support
Tamrat-B Jul 12, 2022
5dd0ef4
Merge branch 'CesiumGS:main' into cesium_i3s_support
Tamrat-B Jul 13, 2022
084e202
Merge branch 'CesiumGS:main' into cesium_i3s_support
Tamrat-B Jul 14, 2022
636d836
Merge branch 'CesiumGS:main' into cesium_i3s_support
Tamrat-B Jul 15, 2022
10feb5d
Merge branch 'CesiumGS:main' into cesium_i3s_support
Tamrat-B Aug 5, 2022
3e4ae82
Merge branch 'main' into cesium_i3s_support
lilleyse Aug 31, 2022
6a31215
Fix Lerc include, after https://github.com/CesiumGS/cesium/pull/10674
lilleyse Aug 31, 2022
405e579
Fixes in ArcGISTiledElevationTerrainProvider
lilleyse Aug 31, 2022
65c9803
Clean up I3S 3D Object Layer sandcastle
lilleyse Aug 31, 2022
2f3324e
Update thumbnail dimensions to 225x150
lilleyse Aug 31, 2022
19e7679
Tweak sandcastle labels
lilleyse Aug 31, 2022
80a26cd
Clean up I3S IntegratedMesh Layer sandcastle
lilleyse Aug 31, 2022
d031b3a
Clean up I3SDataProvider documentation, remove traceCode
lilleyse Aug 31, 2022
c7017ad
Fix z-fighting with base terrain layer in sandcastle demo
lilleyse Aug 31, 2022
9033839
Constructor cleanup
lilleyse Aug 31, 2022
bb0fe76
Fix boolean documentation
lilleyse Aug 31, 2022
0199346
Fix typo
lilleyse Aug 31, 2022
f0b3079
Remove unused getter
lilleyse Aug 31, 2022
f08066a
Use Check and wrap in pragma.debug
lilleyse Aug 31, 2022
ac44992
Comment spacing
lilleyse Aug 31, 2022
9418bd6
Remove debug console.log
lilleyse Aug 31, 2022
4a1a734
Fix doc
lilleyse Aug 31, 2022
4fe6e6c
Remove update doc and mark private
lilleyse Aug 31, 2022
7f6c1f9
Simplify prePassesUpdate, postPassesUpdate, updateForPass
lilleyse Aug 31, 2022
decf059
Style: Rename GLTF to Gltf
lilleyse Aug 31, 2022
06932f0
Remove private from local functions
lilleyse Aug 31, 2022
6317716
Clea up I3SSceneLayer doc
lilleyse Aug 31, 2022
32e7954
Remove _entities
lilleyse Aug 31, 2022
838d8dd
Clean up I3SLayer doc
lilleyse Aug 31, 2022
8cbe744
Use defined
lilleyse Aug 31, 2022
755c76e
Doc type consistency
lilleyse Aug 31, 2022
ba1c503
Remove empty line
lilleyse Aug 31, 2022
6ffdc1e
Merge branch 'CesiumGS:main' into cesium_i3s_support
Tamrat-B Sep 20, 2022
7b7d19a
-Added suite of unit tests and code reveiw changes
Tamrat-B Sep 20, 2022
ac04058
updated an outdated param
Tamrat-B Sep 20, 2022
37a3d29
added removed line to suppress terrain
Tamrat-B Sep 20, 2022
5a57a6a
Cleanup part 1
lilleyse Sep 22, 2022
f3917c8
Cleanup part 2
lilleyse Sep 22, 2022
178f357
Cleanup part 3
lilleyse Sep 22, 2022
9eab492
Cleanup part 4
lilleyse Sep 22, 2022
2e485b9
Add position min/max to fix culling issues
lilleyse Oct 6, 2022
fe1e95f
Use defined
lilleyse Oct 6, 2022
fa68785
Cleanup part 5
lilleyse Oct 6, 2022
9add20d
Update sandcastles
lilleyse Oct 6, 2022
1f98b36
Fix tests
lilleyse Oct 7, 2022
f0d7d17
Update documentation
lilleyse Oct 7, 2022
178ed54
Cleanup
lilleyse Oct 7, 2022
fbd4ad4
Fix tests
lilleyse Oct 7, 2022
9dd6024
Fix Promise types
lilleyse Oct 17, 2022
bb23732
Add separate files for I3SField and I3SGeometry
lilleyse Oct 17, 2022
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update sandcastles
  • Loading branch information
lilleyse committed Oct 7, 2022
commit 9add20dc3b48218626b7bf51c44cbfeec044ca4a
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/I3S 3D Object Layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h1>Loading...</h1>
});
// Create i3s and Cesium3DTileset options to pass optional parameters useful for debugging and visualizing
const cesium3dTilesetOptions = {
skipLevelOfDetail: true,
skipLevelOfDetail: false,
debugShowBoundingVolume: false,
};
const i3sOptions = {
Expand Down
72 changes: 26 additions & 46 deletions Apps/Sandcastle/gallery/I3S Feature Picking.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,68 +39,53 @@ <h1>Loading...</h1>
"use strict";
//Sandcastle_Begin
const viewer = new Cesium.Viewer("cesiumContainer", {
terrainProvider: new Cesium.createWorldTerrain({}),
terrainProvider: new Cesium.createWorldTerrain(),
animation: false,
timeline: false,
});
//More datasets to tour can be added here..
// More datasets to tour can be added here...
// The url passed to I3SDataProvider supports loading a single Indexed 3D Scene (I3S) layer (.<host>/SceneServer/layers/<id>) or a collection of scene layers (.<host>/SceneServer) from a SceneServer.
const tours = {
lilleyse marked this conversation as resolved.
Show resolved Hide resolved
"New York":
"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/NYC_Attributed_v17/SceneServer",
};
// Initialize a terrain provider which provides geoid conversion between gravity releated (typically I3S datasets) and ellipsoidiaL based
// height systems (cesium world terrain).
// Initialize a terrain provider which provides geoid conversion between gravity related (typically I3S datasets) and ellipsoidal based
// height systems (Cesium World Terrain).
// If this is not specified, or the URL is invalid no geoid conversion will be applied.
// The source Data used in this transcoding service was compiled from https://earth-info.nga.mil/#tab_wgs84-data and is based on EGM2008 Gravity Model
// The source data used in this transcoding service was compiled from https://earth-info.nga.mil/#tab_wgs84-data and is based on EGM2008 Gravity Model
const geoidService = new Cesium.ArcGISTiledElevationTerrainProvider({
url:
"https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/EGM2008/ImageServer",
});
// Create i3s and cesiumTileset options to pass optional parameters useful for debuging and visualizing
// Create i3s and Cesium3DTileset options to pass optional parameters useful for debugging and visualizing
const cesium3dTilesetOptions = {
skipLevelOfDetail: true,
skipLevelOfDetail: false,
debugShowBoundingVolume: false,
};
const i3sOptions = {
url: tours["New York"],
traceFetches: false, // for tracing I3S fetches
geoidTiledTerrainProvider: geoidService, // pass the geoid service
cesium3dTilesetOptions: cesium3dTilesetOptions,
cesium3dTilesetOptions: cesium3dTilesetOptions, // options for internal Cesium3dTileset
};

//Create I3S data provider.
const i3sProvider = new Cesium.I3SDataProvider(
"",
tours["New York"],
i3sOptions
);
i3sProvider.load();
// Create I3S data provider
const i3sProvider = new Cesium.I3SDataProvider(i3sOptions);

//Center camera on I3S once it's loaded
// Center camera on I3S once it's loaded
i3sProvider.readyPromise.then(function () {
const midLon =
(i3sProvider.extent.minLongitude +
i3sProvider.extent.maxLongitude) /
2;
const midLat =
(i3sProvider.extent.minLatitude + i3sProvider.extent.maxLatitude) /
2;
const center = Cesium.Rectangle.center(i3sProvider.extent);
center.height = 10000.0;
viewer.camera.setView({
destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(
new Cesium.Cartographic(
Cesium.Math.toRadians(midLon),
Cesium.Math.toRadians(midLat),
10000.0
)
),
destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(center),
});
});

//add the i3s layer provider as a primitive data type
// Add the i3s layer provider as a primitive data type
viewer.scene.primitives.add(i3sProvider);
// An entity object which will hold info about the currently selected feature for infobox display
const selectedEntity = new Cesium.Entity();
// Silhouette a feature on selection and show metadata in the InfoBox.
// Show metadata in the InfoBox.
viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(
movement
) {
Expand All @@ -113,9 +98,8 @@ <h1>Loading...</h1>
const pickedPosition = viewer.scene.pickPosition(movement.position);

if (
pickedFeature &&
pickedFeature.content &&
pickedFeature.content.tile.i3sNode
Cesium.defined(pickedFeature.content) &&
Cesium.defined(pickedFeature.content.tile.i3sNode)
) {
const i3sNode = pickedFeature.content.tile.i3sNode;
i3sNode.loadFields().then(function () {
Expand All @@ -127,7 +111,7 @@ <h1>Loading...</h1>
pickedPosition.z
);
let description = "No attributes";
let name = "";
let name;
if (
location.index !== -1 &&
geometry.customAttributes.featureIndex
Expand All @@ -141,19 +125,15 @@ <h1>Loading...</h1>
description =
'<table class="cesium-infoBox-defaultTable"><tbody>';
for (const fieldName in i3sNode.fields) {
if (fieldName) {
if (i3sNode.fields.hasOwnProperty(fieldName)) {
const field = i3sNode.fields[fieldName];
description +=
`<tr><th>` + `${field.name}` + `</th><td>`;
description +=
`${field.values[featureIndex]}` + `</td></tr>`;
description += `<tr><th>${field.name}</th><td>`;
description += `${field.values[featureIndex]}</td></tr>`;
console.log(
`${field.name}` +
`: ` +
`${field.values[featureIndex]}`
`${field.name}: ${field.values[featureIndex]}`
);
if (
(!name || 0 === name.length) &&
!Cesium.defined(name) &&
isNameProperty(field.name)
) {
name = field.values[featureIndex];
Expand All @@ -163,7 +143,7 @@ <h1>Loading...</h1>
description += `</tbody></table>`;
}
}
if (!name || 0 === name.length) {
if (!Cesium.defined(name)) {
name = "unknown";
}
selectedEntity.name = name;
Expand Down
32 changes: 9 additions & 23 deletions Apps/Sandcastle/gallery/I3S IntegratedMesh Layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h1>Loading...</h1>
animation: false,
timeline: false,
});
//supress terrain data to avoid clashing with IntegratedMesh layer geometry
// Suppress terrain data to avoid clashing with IntegratedMesh layer geometry
viewer.scene.globe.depthTestAgainstTerrain = false;
// More datasets to tour can be added here..
// The url passed to I3SDataProvider supports loading a single Indexed 3D Scene (I3S) layer (.<host>/SceneServer/layers/<id>) or a collection of scene layers (.<host>/SceneServer) from a SceneServer.
Expand All @@ -66,35 +66,21 @@ <h1>Loading...</h1>
debugShowBoundingVolume: false,
};
const i3sOptions = {
url: tours["Frankfurt"],
traceFetches: false, // for tracing I3S fetches
geoidTiledTerrainProvider: geoidService, // pass the geoid service
cesium3dTilesetOptions: cesium3dTilesetOptions,
cesium3dTilesetOptions: cesium3dTilesetOptions, // options for internal Cesium3dTileset
};

// Create I3S data provider
const i3sProvider = new Cesium.I3SDataProvider(
"",
tours["Frankfurt"],
i3sOptions
);
i3sProvider.load();
const i3sProvider = new Cesium.I3SDataProvider(i3sOptions);

//Center camera on I3S once it's loaded
// Center camera on I3S once it's loaded
i3sProvider.readyPromise.then(function () {
const midLon =
(i3sProvider.extent.minLongitude +
i3sProvider.extent.maxLongitude) /
2;
const midLat =
(i3sProvider.extent.minLatitude + i3sProvider.extent.maxLatitude) /
2;
const center = Cesium.Rectangle.center(i3sProvider.extent);
center.height = 10000.0;
viewer.camera.setView({
destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(
new Cesium.Cartographic(
Cesium.Math.toRadians(midLon),
Cesium.Math.toRadians(midLat),
10000.0
)
),
destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(center),
});
});

Expand Down