From 369ac14a0cea0628ac110fff71dd8460633abbf4 Mon Sep 17 00:00:00 2001 From: Eliot Jordan Date: Mon, 30 Sep 2024 17:32:12 -0500 Subject: [PATCH] test cog generation --- .../geo_derivatives/processors/gdal.rb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/derivative_services/geo_derivatives/processors/gdal.rb b/app/derivative_services/geo_derivatives/processors/gdal.rb index f8abb2f6b..e3911da12 100644 --- a/app/derivative_services/geo_derivatives/processors/gdal.rb +++ b/app/derivative_services/geo_derivatives/processors/gdal.rb @@ -35,8 +35,8 @@ def self.warp(in_path, out_path, options) # @param out_path [String] processor output file path # @param options [Hash] creation options def self.compress(in_path, out_path, options) - execute "gdal_translate -q -ot Byte -a_srs #{options[:output_srid]} "\ - "\"#{in_path}\" #{out_path} -co COMPRESS=JPEG -co JPEG_QUALITY=90" + execute "gdal_translate -q -a_srs #{options[:output_srid]} "\ + "\"#{in_path}\" #{out_path}" end # Executes gdaladdo and gdal_translate commands. Used to add internal overviews @@ -46,12 +46,18 @@ def self.compress(in_path, out_path, options) # @param out_path [String] processor output file path # @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") + # execute("gdal_translate -q -expand rgb \"#{in_path}\" #{out_path} -ot Byte -of COG "\ + # "-a_nodata 256 -co COMPRESS=LZW") + + execute("gdal_translate -q \"#{in_path}\" #{out_path} -of COG "\ + "-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") + # execute("gdal_translate -q \"#{in_path}\" #{out_path} -ot Byte -of COG "\ + # "-a_nodata 256 -co COMPRESS=LZW") + + execute("gdal_translate -q \"#{in_path}\" #{out_path} -of COG "\ + "-a_nodata 256 -co COMPRESS=LZW -co TILING_SCHEME=GoogleMapsCompatible") end # Executes a gdal_rasterize command. Used to rasterize vector