Skip to content

[Tutorial] Conversion of shapefile with point geometries to 3D Tiles

allyoucanmap edited this page Jun 11, 2024 · 4 revisions

This tutorial shows how to convert a shapefile with point geometries to 3D Tiles.

Prerequisites

The digital twin toolbox must be up and running at http://localhost:3000 (see "Setup and usage" for more info)

Download the sample data folder from this link, unzip the folder and add the files inside the static/data/ directory (see "Adding data" section for more info).

The data folder contains a sample of the Washingthon D.C. city downloaded from the open portal opendata.dc.gov.

Objective

Create tree instance models in 3D Tiles format given as input data the Urban_Forestry_Street_Tree_Benefits_EPSG_26985.zip shapefile that represent the position of trees.

Below the workflow graph highlighting steps and tools:

graph LR;
    data{static/data/}-->shp_point("Shapefile Point (.zip)")-->geom_point[Geometry Manipulation]-->postgis_point[PostGIS]-->i3dm.export-->3d_intance((3DTiles))-->tilesets{static/tilesets/};
Loading

Steps

Select Urban_Forestry_Street_Tree_Benefits_EPSG_26985 (.zip) from input data section, the data preview renders the tree points as cubes by default.

Select input data from User Interface

Update geometry replacing the default cube with a tree model by changing the Model (.glb) field with the following string: “tree.glb”.

Then click on the Apply button in the same section to update the data preview.

Note: the “tree.glb” model is provided by default in the static/glb/ directory, additional model types in .glb format can be added to the static/glb/ directory to be available by the Model (.glb) field.

Apply variables in user interface to change the geometries

Generate 3D Tiles using the default properties by clicking on the Create tileset button

Initialize tiling process from user interface

Preview of generated 3D Tiles in Cesium.js by clicking on the Tileset preview button in the feedback box

Visualize the tileset output result in a Cesium viewer

The generated tileset can be find inside the static/tilesets directory inside the folder named Urban_Forestry_Street_Tree_Benefits_EPSG_26985.