Skip to content

Instantly share code, notes, and snippets.

2048
{"n0n0n0n0n3n0n0n0n0n0n0n": {"band_1": -30.505917828233898}}
{"s0s0s0s0s3s0s0s0s0s0s0s": {"band_1": -30.517954733905256}}
{"n0n0n0n0n3n0n0n0n0n0n1n": {"band_1": -30.487437598328142}}
{"n0n0n0n0n3n0n0n0n0n0n1s": {"band_1": -30.480835189256492}}
{"n0n0n0n0n3n0n0n0n0n1n0n": {"band_1": -30.451393362010137}}
{"n0n0n0n0n3n0n0n0n0n1n0s": {"band_1": -30.462482709218932}}
{"n0n0n0n0n3n0n0n0n0n1n1n": {"band_1": -30.43480969748125}}
{"n0n0n0n0n3n0n0n0n0n1s1s": {"band_1": -30.429818161815525}}
{"n0n0n0n0n3n0n0n0n1n0n0n": {"band_1": -30.405773830183655}}
2048
{"n0n0n0n0n3n0n0n0n0n0n0n": {"band_1": -30.505917828233898}}
{"s0s0s0s0s3s0s0s0s0s0s0s": {"band_1": -30.517954733905256}}
{"n0n0n0n0n3n0n0n0n0n0n1n": {"band_1": -30.487437598328142}}
{"n0n0n0n0n3n0n0n0n0n0n1s": {"band_1": -30.480835189256492}}
{"n0n0n0n0n3n0n0n0n0n1n0n": {"band_1": -30.451393362010137}}
{"n0n0n0n0n3n0n0n0n0n1n0s": {"band_1": -30.462482709218932}}
{"n0n0n0n0n3n0n0n0n0n1n1n": {"band_1": -30.43480969748125}}
{"n0n0n0n0n3n0n0n0n0n1s1s": {"band_1": -30.429818161815525}}
{"n0n0n0n0n3n0n0n0n1n0n0n": {"band_1": -30.405773830183655}}
import os, rasterio
import matplotlib.pyplot as plot
basedir = '/Users/dnomadb/Documents/pwat_hrrr/'
savedir = '/Users/dnomadb/Documents/pwat_hrrr_pngs/'
with rasterio.drivers():
for i in os.listdir(basedir):
if i.split('.')[-1] == 'grib':
print i
process.stdin.pipe(require('split')()).on('data', processLine)
var holder = {}
process.stdin.on('end', function() {
console.log(holder);
});
function processLine (line) {
try {
import rasterio, fiona
from rasterio import features
uidfield = #whatever field contains unique values for extraction
infile = #input shapefile
inraster = #input raster
with rasterio.open(inraster, 'r') as src:
rasArr = src.read_band(band_no)
oshape = src.shape
n0n0n:{"band_2":0,"band_3":20,"band_1":0}
n0n1n:{"band_2":0,"band_3":20,"band_1":0}
n1n0n:{"band_2":0,"band_3":20,"band_1":0}
n1n1n:{"band_2":0,"band_3":20,"band_1":0}
n0n0n:{"band_2":0,"band_3":20,"band_1":0}
s0s0s:{"band_2":0,"band_3":20,"band_1":0}
n0n0n:{"band_2":29.5,"band_3":44.5,"band_1":29.5}
n0n:{"band_2":7.375,"band_3":26.125,"band_1":7.375}
n0n1n:{"band_2":62.5,"band_3":77.5,"band_1":62.5}
n0n1n:{"band_2":227.75,"band_3":227.75,"band_1":227.75}
makesurface triangulate 8 --tile 0 0 0 13.72s user 0.64s system 98% cpu 14.549 total
makesurface fillfacets /Users/dnomadb/Downloads/TrueMarble.4km.10800x5400.tif 13.50s user 1.65s system 55% cpu 27.317 total
node clitest.js 3.12s user 0.47s system 13% cpu 27.322 total
Isss all done mayne..
makesurface triangulate 11 --tile 3 3 3 13.63s user 0.56s system 99% cpu 14.245 total
makesurface fillfacets /Users/dnomadb/Downloads/TrueMarble.4km.10800x5400.tif 13.32s user 1.41s system 55% cpu 26.692 total
node clitest.js 3.81s user 0.63s system 16% cpu 26.697 total
{ type: 'Feature',
geometry:
{ type: 'Polygon',
coordinates: [ [Object], [Object], [Object], [Object] ] },
attributes: { band_2: 0, band_3: 20, band_1: 0 } }
{ type: 'Feature',
geometry:
{ type: 'Polygon',
coordinates: [ [Object], [Object], [Object], [Object] ] },
attributes: { band_2: 0, band_3: 20, band_1: 0 } }
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.