Skip to content

Instantly share code, notes, and snippets.

View AndreLester's full-sized avatar

André Kruger AndreLester

  • Private
  • Swellendam, South Africa
View GitHub Profile
@darrell
darrell / voronoi.sql
Last active November 22, 2020 03:03
Code to generate Voronoi diagrams in PostGIS using Python. Many thanks to everyone who contributed to this code. Original blog post describing the work is here: http://geogeek.garnix.org/2012/04/faster-voronoi-diagrams-in-postgis.html
CREATE OR REPLACE FUNCTION voronoi(table_name text,geom_col text) returns SETOF record as $$
#############################################################################
#
# Voronoi diagram calculator/ Delaunay triangulator
# Translated to Python by Bill Simons
# September, 2005
#
# Additional changes by Carson Farmer added November 2010
#
@astrojuanlu
astrojuanlu / navier_plate_fenics.py
Last active May 3, 2024 21:21
Navier plate in Python with FEniCS
# coding: utf-8
"""Simply supported rectangular plate on its four edges with FEniCS
Author: Juan Luis Cano Rodríguez <[email protected]>
References
----------
* Timoshenko, Stephen, and S. Woinowsky-Krieger. "Theory of Plates and Shells".
New York: McGraw-Hill, 1959.
@alexeygrigorev
alexeygrigorev / tqdm_pool.py
Created December 6, 2018 15:36
Track progress of ProcessPoolExecutor with tqdm
from glob import glob
import multiprocessing
from concurrent.futures import ProcessPoolExecutor
import cv2
from PIL import Image
import imagehash
from tqdm import tqdm
@ThomasG77
ThomasG77 / README.md
Last active April 8, 2024 20:17
Run PyQGIS in Jupyter Notebook
@richpsharp
richpsharp / example_stream_subwatershed_script.py
Created February 13, 2021 21:11
Demo of how to extract streams and subwatersheds
"""Tracer for floodplain extraction function with custom parameters."""
import logging
import os
import sys
import pygeoprocessing
import pygeoprocessing.routing
import numpy
logging.basicConfig(
@phargogh
phargogh / routing-example.py
Last active August 29, 2023 05:41
Example of pygeoprocessing-based D8 routing, including watershed delineation.
import os
import shutil
import numpy
import pygeoprocessing
import pygeoprocessing.routing
from osgeo import gdal
def doit(dem_path, flow_dir_weights, watershed_source_vector, workspace):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mheberger
mheberger / get_watersheds_mghydro.ipynb
Last active March 3, 2025 15:18
Demo using Python to download and save watershed boundaries and rivers geodata via the mghydro.com Global Watersheds web app API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vadimkantorov
vadimkantorov / csharpfrompython.cs
Last active March 22, 2025 16:08
Run a C# function from Python using Python.NET from https://pythonnet.github.io/pythonnet/python.html Call csharpfrompython.py which first calls the compiler and then calls the functions, feature request of better compiler bindings at https://github.com/pythonnet/pythonnet/issues/2196 ; includes two examples of NumPy -> C# array marshalling
namespace CSharpFromPythonNamespace
{
public class CSharpFromPythonClass
{
public string Hi(string x)
{
return "Hi " + x;
}
public static string Hello(string x)
@veekaybee
veekaybee / normcore-llm.md
Last active May 15, 2025 00:06
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models