Skip to content

Instantly share code, notes, and snippets.

View danleesmith's full-sized avatar

Dan Smith danleesmith

View GitHub Profile
@danleesmith
danleesmith / hou_geojson_import.py
Created January 31, 2021 21:48
Houdini GeoJSON importer script (python)
"""
This script is will 'import' a custom GeoJSON file into Houdini. It is intended to be used in the Houdini SOP context, either in the default python SOP or a custom python operator. These operators need to have the four custom paramters as listed in the 'node parameters' section.
There are several steps/limitations with the import that must be taken into account:
- Will handle point, line and polygone features
- Will not process polygons with holes
- Will not handle geographic coordinates properly (latitude and longitude). The features must use a projected (X,Y,Z) datum. This technically means that the input GeoJSON will not adhere to the spec which demands coodrinates on WGS84).
- Will not handle NULL or None type attributes for any feature. All features must have a value for all attributes. If there is a NULL for a string use and empty: "". If there is a null for a number use -9999.
"""
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Setup PostGIS database on Debian via WSL

The following assmes that WSL version 2 is already installed and setup

In PowerShell:

wsl --install -d Debian

In the Debian terminal:

Install geopandas on ubuntu using apt-get when running into fetch/IPv6 issues:

sudo apt-get update --option Acquire::ForceIPv4=true --option Acquire::Retries=100 --option Acquire::http::Timeout=60
sudo apt-get updgrade
sudo apt get install python3-geopandas --option Acquire::ForceIPv4=true --option Acquire::Retries=100 --option Acquire::http::Timeout=60

solution thanks to @supersan on StackExchange