Skip to content

Instantly share code, notes, and snippets.

View mdsumner's full-sized avatar

Michael Sumner mdsumner

View GitHub Profile
import pyproj
from pyproj import CRS, Transformer
from pyproj.exceptions import CRSError, ProjError

# PROJ version (string and tuple)
print(pyproj.proj_version_str)   # e.g. "9.6.0"
print(pyproj.PROJ_VERSION)       # (9, 6, 0)
@mdsumner
mdsumner / gdal-warp-remakes.md
Created September 18, 2026 21:08
GDAL remakes: an llm-heavy survey of warper alternatives

GDAL-remakes: a survey of raster reprojection reimplementations

Companion notes for hypertidy/rwarp#1. Compiled September 2026.

Scope: software that reimplements raster warping -- the destination-driven mapping of a target grid back through a coordinate transform into a source grid, with resampling -- rather than calling GDAL's warper. Point-transform libraries (proj4js, proj4rs, geodesy) are listed only where a warper depends on one.

Diagnosing curl / /vsicurl timeouts from a JupyterHub session

A timeout (as opposed to a connection refusal) almost always means packets are being dropped silently, so the job is to find out which phase dies. Work outward in layers.

1. Split the phases

curl -sS -o /dev/null \
@mdsumner
mdsumner / TARGETS.md
Created September 14, 2026 01:48
An exploration of the mechanism of the place

Targets

Ordered by what each would add to the corpus, not by how interesting the entity is on its own. An entity earns its place if it either tests the schema against a new legal form or connects to nodes already in the graph.

Done

RACT, MAIB, Tasracing, Macquarie Point Development Corporation, EPA Tasmania, the salmon producers as a cluster, Hobart City Council, the energy government businesses as a

#!/usr/bin/env Rscript
# Patch raadfiles for fast package load.
#
# Replaces the per-load md5 hash of every file_db.tab with a stat-based
# signature (size + mtime), and adds a local parsed cache so a steady-state
# load reads one small local RDS instead of re-reading (possibly
# network-mounted) text caches.
#
# Usage: Rscript raadfiles-patch.R [path/to/R/000-raadfiles-admin.R]
# Then: git diff (review), R CMD INSTALL . (or devtools::load_all()), test
ds = xr.open_zarr(
     session.store,
     group="goes19_goes18/10m/C08/2026-03-10",
    zarr_format=3,
)
ds
code for https://rstats.me/@mdsumner/117059558926596079
run on Pawsey, packages are on CRAN or gh:hypertidy
```R
#!/usr/bin/env Rscript
## Pacific mean SST from GHRSST COGs, one value per date.
## File-per-date cache: rerun any time, only missing dates are computed,
## failures write nothing and are picked up on the next run.

https://github.com/hypertidy/bigcurve

{bigcurve} provides D3-level adaptive densifications at shape-segment level with bisecting line segments if required by the coordinate transformation, on a solid C++ basis, with {wk} for format wrangling and CRS transform, {wkpool} provides segments (with topology, future proof)

p <- geos::as_geos_geometry(terra::as.polygons(terra::rast(terra::ext(-150, 150, -85, 85), res = 15)))

tgt <- "+proj=laea"
tr &lt;- PROJ::proj_trans_create(wk::wk_crs(p)$wkt, tgt)
# dsn <- sds::nsidc_seaice()
# library(terra)
# plot(rast(dsn))
#e <- draw()
#dput(round(as.vector(e)))
## pole inside extent, south polar steregraphic
e <- c(xmin = -1094338, xmax = 1230070, ymin = -699223, ymax = 997424)
xyedge <- vaster::vaster_boundary(c(64, 64), e)
## reproj_extent infills the source extent to not miss the pole