             [cmr.indexer.data.elasticsearch :as es]
             [cmr.common.mime-types :as mt]
             [cmr.common.log :refer (debug info warn error)]
+            [cmr.common.services.errors :as errors]
             [cmr.umm.related-url-helper :as ru]
             [cmr.indexer.data.concepts.temporal :as temporal]
             [cmr.indexer.data.concepts.attribute :as attrib]

  [collection]
  (when-let [geometries (seq (get-in collection [:spatial-coverage :geometries]))]
    (let [sr (get-in collection [:spatial-coverage :spatial-representation])]
      ;; TODO Add support for all spatial representations and geometries
      (cond
        (or (= sr :geodetic) (= sr :cartesian))
        (spatial/spatial->elastic-docs sr collection)

        :else
        (info "Ignoring indexing spatial of collection spatial representation of" sr)))))

(defmethod es/concept->elastic-doc :collection
  [context concept collection]

            :processing-level-id.lowercase (when processing-level-id (str/lower-case processing-level-id))
            :collection-data-type collection-data-type
            :collection-data-type.lowercase (when collection-data-type
                                              (if (sequential? collection-data-type)
                                                (map str/lower-case collection-data-type)
                                                (str/lower-case collection-data-type)))
            :platform-sn platform-short-names
            :platform-sn.lowercase  (map str/lower-case platform-short-names)
            :instrument-sn instrument-short-names
