class Georeferencer::Image
Public Instance Methods
centroid()
click to toggle source
# File lib/georeferencer/models/image.rb, line 13 def centroid # Data from the collection endpoint doesn't include the bounding box, so we need to check we have the full data, # or reload (which hits the resource endpoint) if not (wlng, slat, elng, nlat) = respond_to?(:bbox) ? bbox : reload.bbox {lat: (slat+nlat)/2, lng: (wlng+elng)/2} end
url(width=200,height=nil)
click to toggle source
# File lib/georeferencer/models/image.rb, line 21 def url(width=200,height=nil) [thumbnail[:url],'full',"#{width},#{height}",0,'default.jpg'].join("/") end