Commit fefa21d0 authored by Sven Schneider's avatar Sven Schneider
Browse files

added BHT 3d tiles as test area

parent 40c8e4da
No related merge requests found
Pipeline #6295 passed with stages
in 20 seconds
Showing with 277 additions and 34 deletions
+277 -34
......@@ -142,6 +142,27 @@
</div>
<button style="margin: 20px 0px 5px 0px;" type="button" class="btn btn-outline-danger btnMod" onclick="gotoBHT()">BHT Berlin</button>
<div class="backdrop mainbackdrop">
<h6 style="color: rgb(8, 228, 118);">CityGML Buildings </h6>
<table>
<tbody>
<tr>
<td style=" padding-bottom: 10px;"><strong>LOD2 Buildings </strong> </td>
<td style=" padding-bottom: 10px; padding-left: 15px;"><label class="switch">
<input id="FellbachBuildingsCheckbox" type="checkbox" onclick="toggleBHT_BuildingTiles()" checked>
<span class="slider round"></span>
</label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
......
......@@ -27,30 +27,18 @@ Cesium.Camera.DEFAULT_VIEW_FACTOR = 0;
viewer.scene.globe.enableLighting = true; // set lighting to true
// load 3d Tile set of HFT from Cesium ION.
var tileset = viewer.scene.primitives.add(
new Cesium.Cesium3DTileset({
url: Cesium.IonResource.fromAssetId(656401),
})
);
// define a function to zoom to the tileset (invoke later)
var zoomAll = function (tileset) {
return new Promise(function (resolve, reject) {
if (!tileset) {
reject("Tileset is undifined");
}
viewer.camera.viewBoundingSphere(
tileset.boundingSphere,
new Cesium.HeadingPitchRange(0, -0.5, 400)
);
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
resolve();
});
};
// var tileset = viewer.scene.primitives.add(
// new Cesium.Cesium3DTileset({
// url: Cesium.IonResource.fromAssetId(656401),
// })
// );
var HFT_Tileset_LOD1 = viewer.scene.primitives.add(
new Cesium.Cesium3DTileset({
url: "buildingTiles/HFTbuildingsLOD1/tileset.json",
show: true,
})
);
// var HFT_testbld = viewer.scene.primitives.add(
// new Cesium.Cesium3DTileset({
......@@ -139,10 +127,10 @@ var HFT_testbld = viewer.scene.primitives.add(
//////// important value. to find the correct value trail and error is needed for a perfect fit
const BUILDIG_TILESET_HEIGHT_OFFSET = 50;
tileset.readyPromise.then(function (tileset) {
HFT_Tileset_LOD1.readyPromise.then(function (HFT_Tileset_LOD1) {
var height = BUILDIG_TILESET_HEIGHT_OFFSET;
var cartographic = Cesium.Cartographic.fromCartesian(
tileset.boundingSphere.center
HFT_Tileset_LOD1.boundingSphere.center
);
var surface = Cesium.Cartesian3.fromRadians(
cartographic.longitude,
......@@ -160,12 +148,49 @@ var HFT_testbld = viewer.scene.primitives.add(
new Cesium.Cartesian3()
);
// now shift / translate the tileset by the translation vector defined above
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
HFT_Tileset_LOD1.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
// return zoomAll(tileset); // zoom or rather go to the translated tileset
// return zoomAll(HFT_Tileset_LOD1); // zoom or rather go to the translated tileset
});
tileset.show = false;
HFT_Tileset_LOD1.show = false;
//////////////////////////////////////////////////////////////////////////////////////
var BHT_Tileset = viewer.scene.primitives.add(
new Cesium.Cesium3DTileset({
url: "buildingTiles/BHT/tileset.json",
show: true,
})
);
BHT_Tileset.readyPromise.then(function (HFBHT_Tileset_testbld) {
var height =44;
var cartographic = Cesium.Cartographic.fromCartesian(
BHT_Tileset.boundingSphere.center
);
var surface = Cesium.Cartesian3.fromRadians(
cartographic.longitude,
cartographic.latitude,
0.0
);
var offset = Cesium.Cartesian3.fromRadians(
cartographic.longitude,
cartographic.latitude,
height
);
var translation = Cesium.Cartesian3.subtract(
offset,
surface,
new Cesium.Cartesian3()
);
// now shift / translate the tileset by the translation vector defined above
BHT_Tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
return zoomAll(BHT_Tileset); // zoom or rather go to the translated tileset
});
////////////////////////////////////////////////////////////////////////////////////
......@@ -248,11 +273,11 @@ var toggleRGBPC = function () {
}
var toggleBuildingTiles = function () {
if (tileset.show === true) {
tileset.show = false
if (HFT_Tileset_LOD1.show === true) {
HFT_Tileset_LOD1.show = false
}
else {
tileset.show = true
HFT_Tileset_LOD1.show = true
if (tilesetLOD3.show === true){
$('#prettyBuildingsCheckbox').prop('checked', false);
tilesetLOD3.show = false
......@@ -294,9 +319,9 @@ var togglePrettyBuildingTiles = function () {
}
else {
tilesetLOD3.show = true
if (tileset.show === true){
if (HFT_Tileset_LOD1.show === true){
$('#simpleBuildingsCheckbox').prop('checked', false);
tileset.show = false
HFT_Tileset_LOD1.show = false
}
}
// $('#prettyBuildingsCheckbox').prop('checked', true); // Checks it
......@@ -306,6 +331,15 @@ var togglePrettyBuildingTiles = function () {
var toggleBHT_BuildingTiles = function () {
if (BHT_Tileset.show === true) {
BHT_Tileset.show = false
}
else {
BHT_Tileset.show = true;
}
}
////////////////////////////////////////////////////
// Fellbach building tiles
fellbachBuildings = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
......@@ -378,7 +412,20 @@ var togglePrettyBuildingTiles = function () {
});
var gotoBHT = function () {
var extent = Cesium.Rectangle.fromDegrees(13.3438353562,52.5410017572,13.3610358270,52.5474834537);
Cesium.Camera.DEFAULT_VIEW_RECTANGLE = extent;
Cesium.Camera.DEFAULT_VIEW_FACTOR = 0;
viewer.flyTo(BHT_Tileset);
}
var gotoFellbach = function () {
......
File added
File added
File added
File added
File added
File added
{
"asset": {
"version": "0.0"
},
"geometricError": 247.9417658429499,
"root": {
"refine": "ADD",
"boundingVolume": {
"region": [
0.2329960989214269,
0.9170443736130169,
0.23311497883637408,
0.9170987530397745,
32.8400001525879,
86.2489032390836
]
},
"content": {
"uri": "b3dms/R.b3dm",
"boundingVolume": {
"region": [
0.2329960989214269,
0.9170443736130169,
0.23311497883637408,
0.9170987530397745,
32.8400001525879,
86.2489032390836
]
}
},
"children": [
{
"boundingVolume": {
"region": [
0.2329960989214269,
0.9170443736130169,
0.23305553887890046,
0.9170715633263957,
32.8400001525879,
86.2489032390836
]
},
"content": {
"uri": "b3dms/R/NE.b3dm",
"boundingVolume": {
"region": [
0.23303781472316767,
0.9170588983247077,
0.23304767791082373,
0.9170645423431714,
34.810001373291,
39.4694109616214
]
}
},
"geometricError": 0.0
},
{
"boundingVolume": {
"region": [
0.2329960989214269,
0.9170715633263957,
0.23305553887890046,
0.9170987530397745,
32.8400001525879,
86.2489032390836
]
},
"content": {
"uri": "b3dms/R/SW.b3dm",
"boundingVolume": {
"region": [
0.23301939875921435,
0.9170718013658467,
0.23302710207027516,
0.9170755158016375,
36.0,
56.4664026524832
]
}
},
"geometricError": 0.0
}
],
"geometricError": 52.78743525512473
},
"properties": {
"EIG_KL_PV": {
"maximum": 3,
"minimum": 0
},
"H_First_Max": {
"maximum": 86.2489,
"minimum": 39.46941
},
"CreationDate": {},
"STR": {
"maximum": 2897,
"minimum": 321
},
"MeasuredHeight": {
"maximum": 52.8189,
"minimum": 4.65941
},
"LFD": {
"maximum": 2,
"minimum": 1
},
"GMDE": {
"maximum": 1,
"minimum": 1
},
"gmlID": {},
"FOLIE": {
"maximum": 11,
"minimum": 11
},
"EIG_KL_ST": {
"maximum": 1,
"minimum": 0
},
"H_Trauf_Min": {
"maximum": 58.32,
"minimum": 39.46941
},
"RoofType": {
"maximum": 1130,
"minimum": 1000
},
"FeatureType": {},
"H_First_Min": {
"maximum": 63.5,
"minimum": 39.46941
},
"KREIS": {
"maximum": 0,
"minimum": 0
},
"RBEZ": {
"maximum": 0,
"minimum": 0
},
"H_Trauf_Max": {
"maximum": 86.2489,
"minimum": 39.46941
},
"HNR": {
"maximum": 37,
"minimum": 10
},
"LAND": {
"maximum": 11,
"minimum": 11
},
"Function": {
"maximum": 2741,
"minimum": 1123
},
"ThoroughfareNumber": {
"maximum": 39,
"minimum": 9
},
"LocalityName": {},
"ThoroughfareName": {},
"CoreName": {},
"Longitude": {
"maximum": 13.35650442860574,
"minimum": 13.351469460791014
},
"Latitude": {
"maximum": 52.54588794588965,
"minimum": 52.54349466985517
}
}
}
\ No newline at end of file
Supports Markdown
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