-
-
Save sritchie/1455e310c21417ad13b5 to your computer and use it in GitHub Desktop.
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
(def | |
^{:doc "Map between the second digit in a MODIS TileID metadata | |
value and the corresponding resolution of the tile data."} | |
res-map | |
{"1" "1000" | |
"2" "500" | |
"4" "250"}) | |
(defn tileid->res | |
"Returns a string representation of the resolution (in meters) of | |
the tile data referenced by the supplied TileID.The second character | |
of a MODIS TileID acts as a key to retrieve this data." | |
[tileid] | |
(res-map (subs tileid 1 2))) | |
;; OR! | |
(defn tileid->res | |
"Returns a string representation of the resolution (in meters) of | |
the tile data referenced by the supplied TileID.The second character | |
of a MODIS TileID acts as a key to retrieve this data." | |
[tileid] | |
(let [s (subs tileid 1 2)] | |
(cond "1" "1000" | |
"2" "500" | |
"4" "250"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment