 ;;; documented. Additionally, this will make converting between parameter
 ;;; schemes an explicit operation on explicit data.
 
-(defrecord Longitude [low high])
-(defrecord Latitude [low high])
-(defrecord Bounds [lat lon])
-
-(defn bounds->rec
-  [[lon-lo lat-lo lon-hi lat-hi]]
-  (map->Bounds
-    {:lat (map->Latitude {:low lat-lo :high lat-hi})
-     :lon (map->Longitude {:low lon-lo :high lon-hi})}))
-
 (defn ->pixels
   [{x-dim :x y-dim :y} bounds]
   (let [[lon-lo lat-lo lon-hi lat-hi] (map #(Integer/parseInt %) bounds)

                          (str "$1" fallback-replacement "$3")))))))

(defn data-files->opendap-urls
  [params pattern-info data-files]
  (->> data-files
       (map (partial data-file->opendap-url pattern-info))
       (map #(str % "." (:format params)))))

(defn get-opendap-urls
  [search-endpoint user-token raw-params]

(defn bounding-info->pixels
  [bounding-info]
  (map #(->pixels (:dimensions %) (:bounds %)) bounding-info))

(defn bounding-info->opendap-query
  [bounding-info]
  (when (seq bounding-info)
    (->> bounding-info
         (map identity)
         (string/join ",")
         (str "?"))))

;; XXX WARNING!!! The pattern matching code has been taken from the Node.js
;;                prototype ... and IT IS AWFUL. This is only temporary ...
