Skip to content

Commit

Permalink
Correct the order the input and output
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentao-Kuang committed Jan 13, 2025
1 parent 73c2b71 commit e8a41a6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/cogify/src/cogify/gdal.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,15 @@ export function gdalCreate(targetTiff: URL, color: Rgba, opt: CogifyCreationOpti
};
}

export function gdalBuildTopoRasterCommands(input: URL, output: URL, width: number, height: number): GdalCommand {
export function gdalBuildTopoRasterCommands(
targetTiff: URL,
sourceVrt: URL,
width: number,
height: number,
): GdalCommand {
const command: GdalCommand = {
output,
command: 'gdal_translate',
output: targetTiff,
args: [
['-q'], // Supress non-error output
['-stats'], // Force stats (re)computation
Expand All @@ -171,9 +176,8 @@ export function gdalBuildTopoRasterCommands(input: URL, output: URL, width: numb

// https://gdal.org/en/latest/drivers/raster/cog.html#reprojection-related-creation-options
['-co', 'ADD_ALPHA=YES'],

urlToString(input),
urlToString(output),
urlToString(sourceVrt),
urlToString(targetTiff),
]
.filter((f) => f != null)
.flat()
Expand Down

0 comments on commit e8a41a6

Please sign in to comment.