From the course: Advanced Spatial Data Visualization in Python

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

3D visualization with Plotly

3D visualization with Plotly

- [Instructor] In our second 3D example, we are going to use Plotly to create an interactive 3D surface visualization of Germany's digital elevation model. After a few imports, we are opening the roster file with rosterio, and read the elevation values into a numpy array called Z. From this array, we also get the number of rows and columns, which represent the roster size. Next, we create the mesh grid so that every elevation value stored in Z has a corresponding X and Y location on the map. This way, each roster cell can be placed at the correct position. Then we build the Plotly surface plot. It takes our X, Y, and elevation values stored in Z, and then builds the 3D surface where the terrain rises and falls according to the elevation level. Besides the Z coordinator values use and elevation levels, we also use a color map to further illustrate the elevation levels. For the sake of this example, we are using the built…

Contents