This repo is a collection of unordered notebooks, scripts and libraries that I've used in the last years to work with geospatial data in Houdini. Please don't consider it as structured knowledge: it's just a formalized series of hacks that has proven useful enough to be reused in different dataviz projects.
A recap blog post is available here: http://valerioviperino.me/houdini/dem
This simple CLI takes a .IMG Digital Terrain Model as input and spits out a 32bit floating point OpenEXR image.
This is written in Rust and uses the GDAL
bindings, so you'll need both cargo
and gdal
installed.
See the Readme.org
for more info.
ipython
notebooks documenting different workflows.
Each notebook might require different dependencies, but generally you'll always need:
numpy==1.19.4
matplotlib==3.3.3
GDAL==3.2.0
Guides you from the loading of a (generally huge) DEM GeoTIFF to exporting samples of the elevation data, so that you don't have to deal with such a high resolution image if you don't need to. If you're in Europe, a good source of DEM files is Copernicus: https://land.copernicus.eu/imagery-in-situ/eu-dem/eu-dem-v1.1
This can prove useful whenever you are exploring the data and want to do your core processing using numpy instead of houdini.
A very basic OOP python library than enables you to easily create geometry in Houdini by loading GeoJSON data. This is just an hobby project (less than 1K LOCs at the time of writing) but I hope it can help someone out there.
Tested under Houdini 17.5 and Python 2.7.
No additional python packages required.
Simply make this module available to your $PYTHONPATH in houdini.
One way to do this is to copy the python/vv_geojson
folder (which contains the python package) to $HOUDINI_USER_PREF_DIR/python2.7libs
.
If you're on mac, $HOUDINI_USER_PREF_DIR/python2.7libs
could become /Users/$USER/Library/Preferences/houdini/17.5/python2.7libs
.
For more infos, see https://www.sidefx.com/docs/houdini/hom/locations.html#disk
Create a Python node while in SOP,
then create a GeoJSONParser
instance like this:
import vv_geojson.geo_utils as vvgeoutils
geojson_path = '~/Downloads/my_geographical_data.geojson'
geojson_parser = vvgeoutils.GeoJSONParser(node.geometry(), geojson_path)
geojson_parser.create_geo()
You can also specify an optional radius of the final geometry:
geojson_parser.create_geo(radius=200)
- GeometryCollection
- MultiPolygon
- Polygon
- MultiPoint
- Point
- LineString
- MultiLineString (untested)
If you're getting weird results inside Houdini, please feel free to open an issue and add the source file that you're trying to import, so that debugging will be easier. If want to double check that you GeoJSON files are written correctly and are using GPS coordinates I would suggest to use this website http://geojson.io