Skip to content

Instantly share code, notes, and snippets.

@acrosby
acrosby / hdf5_build
Last active December 17, 2015 09:08
# Make sure g++ compiler is installed for hdf5
sudo apt-get install g++ dpkg-dev
# Download HDF5 source unpack and cd to directory
wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.10.tar.gz
tar -xzvf hdf5-1.8.10.tar.gz
cd hdf5-1.8.10
./configure --prefix=/usr/local --enable-shared --enable-hl
make -j 2
sudo make install
'''
Only slighted modified from code provided by Laura De Cicco (USGS).
Laura De Cicco, A. Crosby
http://nwisvaws02.er.usgs.gov/ogc-swie/wml2/uv/sos?request=GetObservation&featureID=01446500&offering=UNIT&observedProperty=00060&beginPosition=2013-02-15
'''
from xml.dom import minidom, Node
import datetime
@acrosby
acrosby / rtree_large_test.py
Last active December 9, 2020 15:50
Sample code for python rtree bulk loading of 10,000,000 points and a nearest neighbor query.
from rtree import index
from random import random
from datetime import datetime
timer = datetime.now()
# Create 10,000,000 random numbers between 0 and 1
rands = [random() for i in range(10000000)]
# Function required to bulk load the random points into the index