Giter Site home page Giter Site logo

vvzen / houdini-geospatial-tools Goto Github PK

View Code? Open in Web Editor NEW
27.0 5.0 5.0 2.44 MB

tools for geospatial exploration in Houdini (ipython notebooks + GeoJSON python library)

License: MIT License

Python 3.44% Jupyter Notebook 90.52% Rust 6.04%
houdini geojson data-visualization data-analysis python27 geospatial geotiff

houdini-geospatial-tools's Introduction

Houdini Geospatial Tools

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

gdal-dtm-exporter

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.

python/notebooks

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

Save_GeoTIFF_as_ply

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.

python/vv-geojson

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.

Installation

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

Example usage

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)

Supported GeoJSON Features

  • GeometryCollection
  • MultiPolygon
  • Polygon
  • MultiPoint
  • Point
  • LineString
  • MultiLineString (untested)

Where to get the data

Validate your data

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.