Created
April 10, 2012 05:53
-
-
Save robinkraft/2348543 to your computer and use it in GitHub Desktop.
sample Cascalog query FOSS4G
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
| (defn modis->latlon | |
| "Converts the supplied MODIS coordinates into `[lat, lon]` based on | |
| the supplied resolution. | |
| Example usage: | |
| (modis->latlon \"1000\" 8 6 12 12) | |
| ;=> (29.89583333333333 -115.22901262147285)" | |
| [res mod-h mod-v sample line] | |
| (->> (modis->global-mags res mod-h mod-v sample line) | |
| (apply global-mags->sinu-xy) | |
| (apply sinu-xy->latlon))) | |
| (let [spatial-res "500" | |
| src (hfs-seqfile "s3n://formadata/pixelcoords") | |
| out-loc (hfs-seqfile "s3n://formadata/reprojected" :sinkfile :replace)] | |
| (?<- out-loc [?mod-h ?mod-v ?sample ?line ?lat ?lon] | |
| (src ?mod-h ?mod-v ?sample ?line) | |
| (modis->latlon spatial-res ?mod-h ?mod-v ?sample ?line))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment