   [tile]
   (let [data (:data tile)
         fill (:fill tile)]
-    (and (some? fill) (some? data) (zero? (.compareTo data fill)))))
+    (and (some? fill) (some? data) (zero? (.compareTo (.rewind data)
+                                                      (.rewind fill))))))
 
 (defn locate-fn
   "Build projection coordinate point calculator for GDAL dataset."

          (.put bytes))
      buffer)))

(def fill-buffer
  "Create a buffer memoized on data-size and data-fill."
  (memoize/lu
   (fn [data-size data-fill data-type]
     (cond (= data-type "INT16") (int16-fill data-size data-fill)
           (= data-type "UINT8") (uint8-fill data-size data-fill)))))

(defn +fill
  "Make a fill buffer used to detect no-data tiles"

(defn +spec
  "Retrieve a spec (for the given UBID) and add it to the band. This assumes
   only one tile-spec will be found. If multiple tile-specs exists, behavior
   is undefined.

   If a tile-spec is not found, then this function returns nil. The band should
   not be ingested."
  [band]
  (log/debugf "looking for tile-spec for %s" (:ubid band))
  (let [spec (first (tile-spec/query {:ubid (:ubid band)}))]
    (if (some? spec)
      ;; then add the spec properties to the band
      (merge band spec)
      ;; this returns nil, the band will be filtered out
      ;; by `conforms?`
      (log/warnf "no tile-spec present, skipping %s"))))

(defn int16-fill
  "Produce a buffer used to detect INT16 type buffers containing all fill data."
