Commit a005a382 authored by Joe TS Dell's avatar Joe TS Dell
Browse files

update

parent 4ff49882
Pipeline #1144 passed with stage
in 3 seconds
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="source/bootstrap.min.css">
<title>Web-based Visualization of the 3D City Models</title>
<style>
table {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
}
td {
border-right: 1px solid black;
padding: 2px 2px 5px 2px;
margin: 0px;
}
th {
border-bottom: 1px solid black;
padding: 5px;
margin: 0px;
}
tr {
padding: 0px;
margin: 0px;
}
</style>
</head>
<body>
<div style="margin:20px; padding:30px">
<h1>Creating Interactive 3D Web Maps with CesiumJS and 3D City Models</h1>
<h3>Step 1: Preparing 3D City Models</h3>
<p>In this step, we will download the 3D city models in CityGML format. Then, convert the models to 3D Tiles
format for optimizing the 3D web visualization. In this article, I picked the 3D city models from Den Haag area as it is a compact model. Of couse, you are freely to explore this method with any CityGML datasets.</p>
<li> Download the CityGML dataset from <a
href="https://denhaag.dataplatform.nl/#/data/36049d1a-4a0f-4c5d-8adb-21dbfb7252f9"
target="_blank">https://denhaag.dataplatform.nl/#/data/36049d1a-4a0f-4c5d-8adb-21dbfb7252f9</a> in the
download section.</li>
<li> Using the FME Workbench to convert the CityGML models to 3D Tiles format. Starting by opening the FME
Workbench, Drag and drop all CityGML models to the FME window.<br>
<img src="img/1a.JPG" alt="" style="width: 800px;"><br>
</li>
<li>
Select input Format "CityGML" and Workflow option "Single Merged Feature Type".<br>
<img src="img/1.JPG" alt="" style="width: 400px;"><br>
</li>
<li>
Click on "Add a new writer" button and select Format "Cesium 3D Tiles"<br>
<img src="img/2.JPG" alt="" style="width: 400px;"><br>
</li>
<li>
The workflow should look like following figure. Click Run and then wait until the conversion complete. Then,
the final 3D Tile City Models will be in the destination folder you input.<br>
<img src="img/3.JPG" alt="" style="width: 600px;"><br>
</li>
<hr>
<h3>Step 2: Preparing HTML for CesiumJS</h3>
In this step, we will create HTML web document containing the 3D Web Globe using CesiumJS library. You can use
any code Idle or editor. In this example, I named it as denHaagApp.html. You can create the document with the name you like and copy the following code. Dont forget to specify the URL on line 24 to the target Tileset.json. If you do this for the first time, you can come back after you set up the web server in step three.
<script src="https://gist.github.com/JoeThunyathep/0a97950f69952ea13759e0f245416604.js"></script>
<hr>
<h3>Step 3: Host the 3D Web App on the Web Server</h3>
This steps, we will host the Web App from step 2 and the 3D Tiles city models from step 1 on the web server. You
are freely to use any web server of your preferences. In this example, we use the XAMPP open source web server.
(You can get it from <a
href="https://www.apachefriends.org/index.html">https://www.apachefriends.org/index.html</a>)
<li>Install XAMPP</li>
<li>Open XAMPP Control Panel and start APACHE web server.<br>
<img src="img/4.JPG" alt="" style="width: 400px;"><br>
</li>
<li>Place the web document (denHaagApp.html) from step 2 and a folder of 3D Tiles city models from step 1 in the C:\xampp\htdocs directory.<br>
<img src="img/5.JPG" alt="" style="width: 800px;"><br>
</li>
<li>In the html web document, update the URL value to the tileset.json file of your 3D Tiles model in the htdocs folder. For example, if your 3D Tiles directory is at C:\xampp\htdocs\3dtile\tileset.json. You should set the url value to "./3dtile/tileset.json" or "http://localhost/3dtile/tileset.json" as APACHE will serve everything in the htdocs directory relatively to "http://localhost".
</li>
<li>
Finally, you can access your 3D web app visualizing 3D city model on your web browser at http://localhost/denHaagApp.html<br>
<img src="img/6.JPG" alt="" style="width: 800px;"><br>
</li>
<hr>
<h2>Overview of the software used</h2>
<ul>
<li><a href="https://cesiumjs.org/downloads/">CesiumJS</a></li>
<li>Web Server:&nbsp;<a href="https://httpd.apache.org/">Apache HTTP Server</a>&nbsp;, is also in&nbsp;<a
href="https://www.apachefriends.org/de/index.html">XAMPP</a>&nbsp;included</li>
<li>Web browser:&nbsp;<a href="https://www.mozilla.org/de/firefox/new/">Firefox</a></li>
<li>FME Workbench 2020</li>
</ul>
<h2>Copyright</h2>
<p>The texts and images provided in the blog are under the&nbsp;<a
href="https://creativecommons.org/licenses/by/3.0/de/">CC BY 3.0 DE</a>&nbsp;license.</p>
<h2>Author</h2>
<b>Thunyathep Santhanavanich (JOE)</b> PhD candidate<br>
Faculty of Geomatics, Computer Science and Mathematics, <br>University of Applied Sciences Stuttgart,
Schellingstr. 24, D-70174 Stuttgart<br>
<a href="mailto:thunyathep.santhanavanich@hft-stuttgart.de">thunyathep.santhanavanich@hft-stuttgart.de</a>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="source/bootstrap.min.js"></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.68/Build/Cesium/Cesium.js"></script>
<link href="https://cesium.com/downloads/cesiumjs/releases/1.68/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
</head>
<body>
<div id="cesiumContainer" style="width: 100%; height:100%"></div>
<script>
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmMGJkYzQwZS1lNTI2LTQ1N2UtYjEyNy1lMjJiYjg2YjIxYmQiLCJpZCI6MTcxNDQsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NzE3Mjc2Njl9.C_XxMaj0_rAu-ADAkpcjcdzcccEMZ-cdbcn4fi5qby8';
var viewer = new Cesium.Viewer('cesiumContainer', {
//terrainProvider: Cesium.createWorldTerrain(),
baseLayerPicker: true,
vrButton: true,
geocoder: false,
navigationHelpButton: false,
selectionIndicator: false,
shadows: true,
timeline: false,
sceneModePicker: true,
});
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: "https://steinbeis-3dps.eu/3DGeoVolumes/collections/DenHaag/3dtiles/tileset.json"
}))
Cesium.when(tileset.readyPromise).then(function (tileset) { viewer.flyTo(tileset) })
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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