Last active
August 29, 2015 14:03
-
-
Save robinkraft/1a7744f46831cc7a6189 to your computer and use it in GitHub Desktop.
working with rasterio and Apache Spark
This file contains 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
>>> '''launch python repl with ./bin/pyspark''' | |
'launch python repl with ./bin/pyspark' | |
>>> import rasterio as rio | |
>>> | |
>>> def img_size(path): | |
... with rio.drivers(): | |
... with rio.open(path) as img: | |
... return [img.width, img.height] | |
... | |
>>> | |
>>> f = sc.textFile("tifs.txt") | |
>>> wc = f.map(img_size) | |
>>> wc.collect() | |
[[4800, 4800], [4800, 4800], [4800, 4800]] |
This file contains 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
/tmp/Hansen_GFC2013_lossyear_50N_080W.tif | |
/tmp/Hansen_GFC2013_lossyear_60N_040E.tif | |
/tmp/Hansen_GFC2013_lossyear_60N_050E.tif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment