blosm
blosm copied to clipboard
Custom Terrain Elevation Source
I have another feature request 😄 , It would be awesome if we could provide a custom terrain elevation source that your plugin could use. For example, many digital terrain models (DTMs) are distributed as GeoTIFF's, which is basically a raster (picture) that is georeferenced. This makes it possible for us to create a higher fidelity terrain model than what SRTMv3 is currently providing (30m).
It looks like the current code is pretty well separated between:
- Downloading the elevation data source -
app/__init__.py - initTerrain(self, context, addonName):
- Creating the vertices and indices that define the terrain -
app/__init__.py - def buildTerrain(self, verts, indices, heightOffset)
- Constructing the terrain mesh from the vertices and indices -
app/__init__.py - def importTerrain(self, context):
So in theory the biggest change we would have to make is creating a custom buildTerrain
function that creates the list of verts and indices. A user interface would be provided that allows the user to specify GeoTIFF file, activating the custom buildTerrain
function and needed switches.
Now the biggest issue is once again is going to be the binary dependency of reading a GeoTIFF file (GDAL). We can handle this a similar way by providing a another custom blender plugin that exposes GDAL.
We can skip the GDAL dependency if we dont support GeoTIFF and only 2D numpy arrays with the user provide Affine matrix and srid.
It would be nice to have that feature. The GUI could look similar to OSM:
- import from the server
- import from a file
Yep, just what I was thinking.