app/models/map.rb
#attempts to align based on the width and height of
#reference map's un warped image
#results it potential better fit than align_with_warped
#but with less accessible gpcs to edit
attempts to align based on the width and height of
reference map's un warped image
results it potential better fit than align_with_warped
but with less accessible gpcs to edit
attempts to align based on the width and height of reference map ' s un warped image results it potential better fit than align_with_warped but with less accessible gpcs to edit
def align_with_original(srcmap, align = nil, append = false)
      srcmap = Map.find(srcmap)
      origgcps = srcmap.gcps
      self.gcps.hard.destroy_all unless append == true
      origgcps.each do |gcp|
         new_gcp = Gcp.new()
         new_gcp = gcp.clone
         if align == "east"
             new_gcp.x -= srcmap.width
         elsif align == "west"
            new_gcp.x += srcmap.width
         elsif align == "north"
            new_gcp.y += srcmap.height
         elsif align == "south"
            new_gcp.y -= srcmap.height
         else
         end
         new_gcp.map = self
         new_gcp.save
      end
      newgcps = self.gcps.hard
   end
def align_with_original ( srcmap , align = nil , append = false ) srcmap = Map . find ( srcmap ) origgcps = srcmap . gcps self . gcps . hard . destroy_all unless append == true origgcps . each do | gcp | new_gcp = Gcp . new ( ) new_gcp = gcp . clone if align == "east" new_gcp . x -= srcmap . width elsif align == "west" new_gcp . x += srcmap . width elsif align == "north" new_gcp . y += srcmap . height elsif align == "south" new_gcp . y -= srcmap . height else end new_gcp . map = self new_gcp . save end newgcps = self . gcps . hard end
attempts to align based on the width and height of
reference map's un warped image
results it potential better fit than align_with_warped
but with less accessible gpcs to edit
attempts to align based on the width and height of reference map ' s un warped image results it potential better fit than align_with_warped but with less accessible gpcs to edit
#clear out original gcps, unless we want to append the copied gcps to the existing ones #if no align, then dont change the gcps
srcmap
<not_specific>
align
<not_specific>
append
<not_specific>