- No authority
- Official reference is writing r extentions (joke extentions)
- If you thought writing regular r packages was tricky, hold on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Tests for VSI-File | |
Copyright Koordinates Limited | |
License MIT | |
""" | |
import io | |
import logging | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on the math here: | |
// http://math.stackexchange.com/a/1367732 | |
// x1,y1 is the center of the first circle, with radius r1 | |
// x2,y2 is the center of the second ricle, with radius r2 | |
function intersectTwoCircles(x1,y1,r1, x2,y2,r2) { | |
var centerdx = x1 - x2; | |
var centerdy = y1 - y2; | |
var R = Math.sqrt(centerdx * centerdx + centerdy * centerdy); | |
if (!(Math.abs(r1 - r2) <= R && R <= r1 + r2)) { // no intersection |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#=================================================== | |
# 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 |