Skip to content

Instantly share code, notes, and snippets.

@jefferys
jefferys / roxygen2MultiFunctionDocumentation.gist.R
Created June 21, 2015 17:29
R function documentation with roxygen2 - multiple functions
#===================================================
# Demo multi-function roxygen2 - three ways to do it
#===================================================
# This shows how things do work, including wierd corner cases, not
# how they should be done. Most of the information comes from
# http://r-pkgs.had.co.nz/man.html
#====================================================
# Demo multi-function roxygen2 page using @describeIn
@perrygeo
perrygeo / _partial_pixel_rasterization.md
Last active October 12, 2023 17:10
partial pixel rasterization

This is a proof-of-concept for a numpy/rasterio/shapely based implementation of partial coverage rasterization. It works, barely.

The current GDAL algorithms allow for two methods, both binary: the default centroid method and the all-touched method.

This is a third alternative which provides the percentage of coverage of each cell from 0 to 100 which can be thought of as pixel weights for many spatial analyses.

See discussion at rasterio/rasterio#232

@jeroen
jeroen / shit.md
Last active March 4, 2022 07:18
Getting shit to work

Getting shit to work

Disclaimers

  • No authority
  • Official reference is writing r extentions (joke extentions)
  • If you thought writing regular r packages was tricky, hold on
@bzgeo
bzgeo / icesat2_shp.py
Last active January 16, 2023 00:18 — forked from KMarkert/gedi_to_vector.py
Python script to convert from ICESat-2 ATL08 HDF data to shapefile. Usage: 'python icesat2_shp.py <path> --variables [<var1>,<var2>,...,<varN>] --outFormat <extension> --filterBounds [<W>,<S>,<E>,<N>] --verbose'
# based on Kel Markert's GEDI HDF to shapefile conversion script
# https://gist.github.com/KMarkert/c68ccf53260d7b775b836bf2e11e2ec3
import os
import fire
import h5py
import glob
import tqdm
import numpy as np
import pandas as pd
@rcoup
rcoup / test_vsi.py
Created August 16, 2023 09:25
GDAL VSI Python file wrappers and associated IO functions, and tests.
"""
Tests for VSI-File
Copyright Koordinates Limited
License MIT
"""
import io
import logging
import os