Skip to content

Instantly share code, notes, and snippets.

@sritchie
Created February 26, 2011 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sritchie/1455e310c21417ad13b5 to your computer and use it in GitHub Desktop.
Save sritchie/1455e310c21417ad13b5 to your computer and use it in GitHub Desktop.
(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