Skip to content

Instantly share code, notes, and snippets.

@lmullen
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmullen/9515337 to your computer and use it in GitHub Desktop.
Save lmullen/9515337 to your computer and use it in GitHub Desktop.
Reproject geotiffs and upload them to a server
tifs_to_project = FileList["*.tif"].exclude(/epsg3857/).ext(".epsg3857.tif")
desc "Reproject all geotiffs into EPSG:3857"
multitask :default => tifs_to_project
rule( /\.epsg3857\.tif$/ => [
proc {|task_name| task_name.sub(/\.epsg3857\.tif$/, '.tif') }
]) do |t|
system "gdalwarp -t_srs EPSG:3857 -s_srs EPSG:4326 #{t.source} #{t.name}"
end
desc "Upload files to geoserver"
task :upload do
system "rsync --stats -avz \
*.epsg3857.tif omekabra@omeka.lts.brandeis.edu:~/geotiff"
end
require "rake/clean"
CLOBBER.include("*.epsg3857.tif")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment