Last active
August 29, 2015 13:57
-
-
Save lmullen/9515337 to your computer and use it in GitHub Desktop.
Reproject geotiffs and upload them to a server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [email protected]:~/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