Skip to content

Instantly share code, notes, and snippets.

View m9brady's full-sized avatar

Mike Brady m9brady

View GitHub Profile
@hofmannsven
hofmannsven / README.md
Last active July 16, 2024 01:30
Git CLI Cheatsheet
@ajdawson
ajdawson / LambertConformalTicks.ipynb
Last active June 7, 2022 13:47
Adding gridline labels to a cartopy Lambert Conformal projection plot
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gboeing
gboeing / pypi.md
Last active June 17, 2022 16:11
How to organize and distribution a package on pypi

To distribute a package on pypi

Directory structure

/project/
    /package/
        __init__.py
        module.py
 setup.py
@sgillies
sgillies / advanced_rasterio_features.ipynb
Last active July 23, 2024 17:26
Advanced Rasterio features notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sgillies
sgillies / cfrw.py
Last active April 26, 2023 08:37
Rasterio concurrency example
"""Concurrent read-process-write example"""
import concurrent.futures
from itertools import islice
from time import sleep
import rasterio
CHUNK = 100
@tayden
tayden / skimage-exposure-match-histograms-with-masked-array.py
Last active June 19, 2024 16:25
Scikit-Image histogram matching doesn't work on numpy masked arrays. This gist is a workaround for this issue. It shows how to do histogram matching when you have an image and need to exclude certain values from being considered as part of the image histogram.
from skimage import io, exposure
import numpy as np
# Histogram matching with masked image
def match_histograms(image, reference, image_mask, fill_value=0):
masked_image = np.ma.array(image, mask=image_mask)
matched = np.ma.array(np.empty(image.shape, dtype=image.dtype),
mask=image_mask, fill_value=fill_value)
for channel in range(masked_image.shape[-1]):
@jsanz
jsanz / README.md
Last active December 15, 2021 15:43
FOSS4G 2021: pg_tileserv and pg_featureserv workshop

Building a cartographic web application with pg_tileserv and pg_featureserv

  • Workshop materials.
  • Reused the postgis Docker Compose template from previous workshop
  • Reused also the osgeo/gdal container to use ogr2ogr on the downloaded shapefiles.
  • Added pg_featureserv and pg_tileserv Docker images passing the .toml configurations as part of the command setting.
  • Added an nginx service to the compose file for the HTML files.
  • Played with different HTML pages that load tiles from pg_tileserv and displays them using OpenLayers.
  • Created a view that returns random points.