Skip to content

Instantly share code, notes, and snippets.

View 1papaya's full-sized avatar

1papaya

View GitHub Profile
@1papaya
1papaya / gdf_distance_matrix.py
Created March 8, 2019 15:51
Distance matrix of GeoDataFrames with scipy
from scipy.spatial import distance_matrix
import pandas as pd
def gdf_distance_matrix(gdf1, gdf2, crs={'init':'epsg:3857'}):
"""
Calculate the distance matrix between two GeoDataFrames
Both GeoDataFrames must have the source crs set in order to be projected.
Parameters
----------
@1papaya
1papaya / gdal_ecw.sh
Last active November 5, 2021 22:21
Install GDAL 2.3 with ECW support on Ubuntu 18.04
#!/bin/bash
##
## Tested on: Ubuntu 18.04 & ECW 5.4 & GDAL 2.3.1
##
## Download the ERDAS ECW JP2 SDK v5.4 Linux
## https://download.hexagongeospatial.com/downloads/ecw/erdas-ecw-jp2-sdk-v5-4-linux
## Download GDAL v2.3 Source (ex. 2.3.1)