Skip to content

Commit

Permalink
Update cog generation for better output
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan committed Sep 30, 2024
1 parent 16d8c71 commit 1363b86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/derivative_services/geo_derivatives/processors/gdal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.translate(in_path, out_path, _options)
# @param options [Hash] creation options
def self.warp(in_path, out_path, options)
execute "gdalwarp -q -t_srs #{options[:output_srid]} "\
"\"#{in_path}\" #{out_path} -co TILED=YES -co COMPRESS=NONE"
"\"#{in_path}\" #{out_path} -co COMPRESS=NONE"
end

# Executes a gdal_translate command. Used to compress
Expand All @@ -47,11 +47,11 @@ def self.compress(in_path, out_path, options)
# @param options [Hash] creation options
def self.cloud_optimized_geotiff(in_path, out_path, _options)
execute("gdal_translate -q -expand rgb \"#{in_path}\" #{out_path} -ot Byte -of COG "\
"-a_nodata 256 -co COMPRESS=LZW")
"-a_nodata 256 -co COMPRESS=LZW -co TILING_SCHEME=GoogleMapsCompatible")
rescue StandardError
# Try without expanding rgb
execute("gdal_translate -q \"#{in_path}\" #{out_path} -ot Byte -of COG "\
"-a_nodata 256 -co COMPRESS=LZW")
"-a_nodata 256 -co COMPRESS=LZW -co TILING_SCHEME=GoogleMapsCompatible")
end

# Executes a gdal_rasterize command. Used to rasterize vector
Expand Down

0 comments on commit 1363b86

Please sign in to comment.