Commit 63ab027b authored by JOE XMG's avatar JOE XMG
Browse files

update

parent 5be39bda
Pipeline #9141 passed with stage
in 37 seconds
public/japan
public/stuttgart_tileset
\ No newline at end of file
public/stuttgart_tileset
public/fellbach_tileset
public/ulm_tileset
public/tileset
node_modules
\ No newline at end of file
// import { load } from '@loaders.gl/core';
// import { Tiles3DLoader } from '@loaders.gl/3d-tiles';
// import { Tileset3D } from '@loaders.gl/tiles';
import { load } from 'https://cdn.skypack.dev/@loaders.gl/core';
import { Tiles3DLoader } from 'https://cdn.skypack.dev/@loaders.gl/3d-tiles';
import { Tileset3D } from 'https://cdn.skypack.dev/@loaders.gl/tiles';
async function loadTileset(url) {
try {
// Load the 3D Tiles tileset
const tilesetJson = await load(url, Tiles3DLoader);
// Example: Assuming you have a setup to use the loaded Tileset3D (e.g., using deck.gl or another library)
// This code snippet only demonstrates how to load the data.
const tileset3d = new Tileset3D(tilesetJson);
console.log('Tileset loaded:', tileset3d);
// Insert here the code to visualize the tileset (e.g., with deck.gl, three.js, etc.)
} catch (error) {
console.error('Failed to load the 3D Tiles tileset:', error);
}
}
// The URL to the 3D Tiles dataset
const tilesetUrl = 'https://3dps.gis.lrg.tum.de/geovolumes/collections/Fellbach/all_buildings_lod2_textured/3dtiles/tileset.json';
loadTileset(tilesetUrl);
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D CityModel Viewer</title>
</head>
<body>
<div id="map"></div>
<script src="app.js" type="module"></script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
{
"name": "3dgeovisclient",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://transfer.hft-stuttgart.de/gitlab/thunyathep.santhanavanich/3dgeovisclient.git"
},
"author": "",
"license": "ISC",
"dependencies": {
"@loaders.gl/3d-tiles": "^4.1.3",
"@loaders.gl/core": "^4.1.3",
"@loaders.gl/tiles": "^4.1.3"
}
}
## First try
```bash
npx tile-converter --install-dependencies
npx tile-converter --input-type="3DTILES" --tileset="/home/joe/2021_rtgis_3dps_geovolumes/geovolumes/collections/Fellbach/all_buildings_lod2_textured/3dtiles/tileset.json" --name="Fellbach_Textures" --slpk=TRUE --generate-textures=TRUE
```
\ No newline at end of file
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://cesium.com/downloads/cesiumjs/releases/1.94/Build/Cesium/Cesium.js"></script>
<link href="https://cesium.com/downloads/cesiumjs/releases/1.94/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
<script src="viewerCesiumNavigationMixin.js"> </script>
</head>
<body>
<div id="cesiumContainer" style="width: 100%; height:100%"></div>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmNDI1ZTg5OC05MWU1LTQ5YTYtOTEyZS1mODk1ODZiZGRhMjgiLCJpZCI6MTcxNDQsImlhdCI6MTY4MDIwNTA2MX0.fM4zc4RUfbrgLvaD4FXP-EUNMceSRA1ILRt2qVNACpc';
var viewer = new Cesium.Viewer('cesiumContainer', {
// terrainProvider: Cesium.createWorldTerrain(),
baseLayerPicker: true,
vrButton: true,
geocoder: true,
navigationHelpButton: false,
selectionIndicator: false,
shadows: false,
timeline: true,
sceneModePicker: true,
terrainProvider: new Cesium.CesiumTerrainProvider({
url: 'https://web3d.basemap.de/cesium/dgm5-mesh',
credit: new Cesium.Credit("\u0026copy; 2023 basemap.de", true)
})
});
viewer.extend(Cesium.viewerCesiumNavigationMixin, {});
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: 'https://web3d.basemap.de/cesium/buildings-fly/root.json'
}));
viewer.camera.setView({ "destination": { "x": 4154353.86673887, "y": 678154.7981396901, "z": 4776795.2223274 }, "orientation": { "direction": { "x": -0.9635249406751695, "y": -0.15728536436861265, "z": 0.2165202134959783 }, "up": { "x": 0.21369179371637717, "y": 0.03488294928175081, "z": 0.9762781351375663 } } })
basicStyle = new Cesium.Cesium3DTileStyle({
color: "color('white')",
show: true
});
waterDemandStyle = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["${gebaeudefunktion} === '31001_1010'", "color('#ffffcc')"],
["${gebaeudefunktion} === '31001_3013'", "color('#bae4bc')"],
["${gebaeudefunktion} === '31001_1123'", "color('#7bccc4')"],
["${gebaeudefunktion} === '31001_2111'", "color('#2b8cbe')"],
["true", "color('#2b8cbe')"],
],
},
});
tileset.style = basicStyle;
</script>
</body>
</html>
\ No newline at end of file
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://cesium.com/downloads/cesiumjs/releases/1.94/Build/Cesium/Cesium.js"></script>
<link href="https://cesium.com/downloads/cesiumjs/releases/1.94/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
<script src="viewerCesiumNavigationMixin.js"> </script>
</head>
<body>
<div id="cesiumContainer" style="width: 100%; height:100%"></div>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmNDI1ZTg5OC05MWU1LTQ5YTYtOTEyZS1mODk1ODZiZGRhMjgiLCJpZCI6MTcxNDQsImlhdCI6MTY4MDIwNTA2MX0.fM4zc4RUfbrgLvaD4FXP-EUNMceSRA1ILRt2qVNACpc';
var viewer = new Cesium.Viewer('cesiumContainer', {
// terrainProvider: Cesium.createWorldTerrain(),
baseLayerPicker: true,
vrButton: true,
geocoder: true,
navigationHelpButton: false,
selectionIndicator: false,
shadows: false,
timeline: true,
sceneModePicker: true,
terrainProvider: new Cesium.CesiumTerrainProvider({
url: 'https://web3d.basemap.de/cesium/dgm5-mesh',
credit: new Cesium.Credit("\u0026copy; 2023 basemap.de", true)
})
// imageryProvider: new Cesium.MapboxStyleImageryProvider({
// // check style ID at https://docs.mapbox.com/api/maps/styles/
// styleId: 'light-v10',
// // styleId: 'navigation-day-v1',
// accessToken: 'pk.eyJ1IjoidGh1bnlhdGhlcCIsImEiOiJjamFpOWV4a2gxd21vMndxdXd2M3VoY3hmIn0.jLlCscei0yH-ZHwcfxF_ug'
// })
// imageryProvider: new Cesium.OpenStreetMapImageryProvider({
// url: 'https://a.tile.openstreetmap.org/'
// }),
});
viewer.extend(Cesium.viewerCesiumNavigationMixin, {});
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: 'https://3dps.gis.lrg.tum.de/geovolumes/collections/Fellbach/all_buildings_lod2_textured/3dtiles/tileset.json'
}));
tileset.readyPromise.then(function (tileset) {
viewer.flyTo(tileset)
});
// var cityStyle = new Cesium.Cesium3DTileStyle({
// color: {
// conditions: [
// ["${surface} === 'wall'", "color('#f2f2f2')"],
// ["${surface} === 'roof'", "color('#ff5c4d')"],
// // ["${surface} === 'roof'", "color('#005c4d')"],
// ["${surface} === 'bridge'", "color('#999999')"]
// ]
// },
// });
// tileset.style = cityStyle
// const provider = new Cesium.WebMapServiceImageryProvider({
// url: 'https://sgx.geodatenzentrum.de/wms_basemapde?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities',
// layers: "de_basemapde_web_raster_farbe",
// parameters: {
// transparent: true,
// format: "image/png",
// }
// });
// viewer.imageryLayers.addImageryProvider(provider);
// Get the URL of the current page
// var url = window.location.href;
// // Use a regular expression to extract the lat and lng parameters
// var regex = /lat=([0-9.]+)&lng=([0-9.]+)/;
// var match = regex.exec(url);
// // Check if the match is not null
// if (match) {
// // Get the lat and lng values from the match array
// var lat = match[1];
// var lng = match[2];
// // Do something with the lat and lng values
// console.log("Latitude: " + lat);
// console.log("Longitude: " + lng);
// viewer.camera.flyTo({
// destination: Cesium.Cartesian3.fromDegrees(lng, lat, 3500.0),
// orientation: {
// heading: Cesium.Math.toRadians(0.0),
// pitch: Cesium.Math.toRadians(-40.0),
// roll: 0.0
// }
// });
// } else {
// // No lat and lng parameters found
// console.log("No latitude and longitude values found in the URL");
// viewer.camera.flyTo({
// destination: Cesium.Cartesian3.fromDegrees(10.277367, 47.415311, 3500.0),
// orientation: {
// heading: Cesium.Math.toRadians(0.0),
// pitch: Cesium.Math.toRadians(-40.0),
// roll: 0.0
// }
// });
// }
</script>
</body>
</html>
\ No newline at end of file
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://cesium.com/downloads/cesiumjs/releases/1.94/Build/Cesium/Cesium.js"></script>
<link href="https://cesium.com/downloads/cesiumjs/releases/1.94/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
<script src="viewerCesiumNavigationMixin.js"> </script>
</head>
<body>
<div id="cesiumContainer" style="width: 100%; height:100%"></div>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmNDI1ZTg5OC05MWU1LTQ5YTYtOTEyZS1mODk1ODZiZGRhMjgiLCJpZCI6MTcxNDQsImlhdCI6MTY4MDIwNTA2MX0.fM4zc4RUfbrgLvaD4FXP-EUNMceSRA1ILRt2qVNACpc';
var viewer = new Cesium.Viewer('cesiumContainer', {
// terrainProvider: Cesium.createWorldTerrain(),
baseLayerPicker: true,
vrButton: true,
geocoder: true,
navigationHelpButton: false,
selectionIndicator: false,
shadows: false,
timeline: true,
sceneModePicker: true,
terrainProvider: new Cesium.CesiumTerrainProvider({
url: 'https://web3d.basemap.de/cesium/dgm5-mesh',
credit: new Cesium.Credit("\u0026copy; 2023 basemap.de", true)
})
});
viewer.extend(Cesium.viewerCesiumNavigationMixin, {});
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: 'ulm_tileset/tileset.json'
}));
viewer.flyTo(tileset)
// const provider = new Cesium.WebMapServiceImageryProvider({
// url: 'https://sgx.geodatenzentrum.de/wms_basemapde?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities',
// layers: "de_basemapde_web_raster_farbe",
// parameters: {
// transparent: true,
// format: "image/png",
// }
// });
// viewer.imageryLayers.addImageryProvider(provider);
// Get the URL of the current page
// var url = window.location.href;
// // Use a regular expression to extract the lat and lng parameters
// var regex = /lat=([0-9.]+)&lng=([0-9.]+)/;
// var match = regex.exec(url);
// // Check if the match is not null
// if (match) {
// // Get the lat and lng values from the match array
// var lat = match[1];
// var lng = match[2];
// // Do something with the lat and lng values
// console.log("Latitude: " + lat);
// console.log("Longitude: " + lng);
// viewer.camera.flyTo({
// destination: Cesium.Cartesian3.fromDegrees(lng, lat, 3500.0),
// orientation: {
// heading: Cesium.Math.toRadians(0.0),
// pitch: Cesium.Math.toRadians(-40.0),
// roll: 0.0
// }
// });
// } else {
// // No lat and lng parameters found
// console.log("No latitude and longitude values found in the URL");
// viewer.camera.flyTo({
// destination: Cesium.Cartesian3.fromDegrees(10.277367, 47.415311, 3500.0),
// orientation: {
// heading: Cesium.Math.toRadians(0.0),
// pitch: Cesium.Math.toRadians(-40.0),
// roll: 0.0
// }
// });
// }
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment