O'Reilly logo

Python Geospatial Analysis Cookbook by Michael Diener

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Converting an ESRI ASCII DEM to an image height map

To end this chapter with a bang, here is the most complicated conversion we have seen so far and the most fun as well. Input is an elevation dataset that's stored in ASCII format, more specifically, Arc/Info ASCII Grid, for short with the AAIGrid with the (.asc) file ending. Our output is a heightmap image (http://en.wikipedia.org/wiki/Heightmap). A heightmap image is an image that stores height elevation as a pixel value. A heightmap is also simply known as a digital elevation model (DEM). The benefit of using an image to store elevation data is that it is web compatible and we can use this in a 3D visualization with threejs, for example, as shown in Chapter 10, Visualizing Your Analysis.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required