Skip to content

Instantly share code, notes, and snippets.

import fiona
import click
from rasterio import features, Affine
def makeAffine(bounds, width):
xD = bounds[2] - bounds[0]
yD = bounds[3] - bounds[1]
cS = xD / float(width - 2)
height = int(yD / cS) + 1
::wind {
polygon-comp-op: multiply;
polygon-fill: #4e4e4f;
[gust <=0.3] {polygon-opacity:0.0}
[gust >0.3] {polygon-opacity:0.005}
[gust >0.6] {polygon-opacity:0.01}
[gust >0.9] {polygon-opacity:0.015}
[gust >1.2] {polygon-opacity:0.02}
[gust >1.5] {polygon-opacity:0.025}
[gust >1.8] {polygon-opacity:0.03}
Traceback (most recent call last):
File "scripts/fillnodataseams.py", line 29, in <module>
fillnodata()
File "/Users/dnomadb/venv/lib/python2.7/site-packages/click/core.py", line 610, in __call__
return self.main(*args, **kwargs)
File "/Users/dnomadb/venv/lib/python2.7/site-packages/click/core.py", line 590, in main
rv = self.invoke(ctx)
File "/Users/dnomadb/venv/lib/python2.7/site-packages/click/core.py", line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/dnomadb/venv/lib/python2.7/site-packages/click/core.py", line 416, in invoke
https://gist.github.com/13708aa76cbcd848f313
with rio.drivers():
with rio.open(src_path, 'r') as src:
## to get one filled band
filled = fillnodata((src, 1))
## to get all filled bands
filled = [fillnodata((src, i)) for i in range(1, 4)]
https://github.com/mapbox/rasterio/blob/master/rasterio/_fill.pyx#L39
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.