Skip to content

Instantly share code, notes, and snippets.

View snowman2's full-sized avatar

Alan D. Snow snowman2

View GitHub Profile
@snowman2
snowman2 / random_vs_randrange
Last active October 11, 2017 02:33
the difference between random and randrange
# import what you need
>>> from random import random, randrange
# https://docs.python.org/3/library/random.html#random.random
# Return the next random floating point number in the range [0.0, 1.0).
>>> random()
0.04458157505033977
>>> random()
0.11730160701010572
# range gives you a list/iterable depending in the Python version and is often used for iterations
# http://pythoncentral.io/pythons-range-function-explained
@snowman2
snowman2 / rtree_profiling.ipynb
Last active May 26, 2019 01:21
GEOS STRTree versus libspatialindex RTree
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@snowman2
snowman2 / rioxarray_cog.ipynb
Created September 18, 2019 15:01
Opening COG with rioxarray
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@snowman2
snowman2 / time_shape_transform.ipynb
Last active October 3, 2019 00:57
Compare pygeos to array_transform
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@snowman2
snowman2 / antimeridian_fiona.ipynb
Last active July 9, 2021 14:11
Reproject geopandas dataframe using fiona.transform.transform_geom to manage antimeridian cutting
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@snowman2
snowman2 / gdal_python_github_setup.sh
Last active November 9, 2022 21:18
GDAL Python Developer Setup from GitHub
# SWIG
export SWIG_VERSION=4.0.2
export SWIG_PREFIX=$HOME/install/swig
mkdir -p $SWIG_PREFIX
mkdir /tmp/swig/
cd /tmp/swig/
wget https://sourceforge.net/projects/swig/files/swig/swig-${SWIG_VERSION}/swig-${SWIG_VERSION}.tar.gz/download -O swig-${SWIG_VERSION}.tar.gz
tar xf swig-${SWIG_VERSION}.tar.gz
cd swig-${SWIG_VERSION}
./configure --prefix=$SWIG_PREFIX