Skip to content

Commit

Permalink
add band
Browse files Browse the repository at this point in the history
  • Loading branch information
sdobbert authored and sdobbert committed Jan 30, 2024
1 parent d4d303f commit 93924c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/geoserver-create-and-apply-sld/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ const grc = new GeoServerRestClient(url, user, pw);
"inputs": [
"myCustomStyleName",
"mySldWorkspace",
"myCoverageDbTable"
"myCoverageDbTable",
"myBand"
]
}
*/
const geoServerCreateAndApplySld = async (workerJob, inputs) => {
const sldName = inputs[0];
const sldWorkspace = inputs[1];
const dbTable = inputs[2];
const band = inputs[3];

logger.debug('Checking GeoServer connectivity …')
const gsExists = await grc.about.exists();
Expand Down Expand Up @@ -88,8 +90,7 @@ const geoServerCreateAndApplySld = async (workerJob, inputs) => {
let max = 0;
// for every dataset in the coveragestore, get min and max statistics and compute total min and max
for (let i = 0; i < locations.length; i++) {
// TODO: make sure we get the stat for channel 1
const infoCmd = `gdalinfo -mm ${locations[i]} | grep "Computed Min/Max"`;
const infoCmd = `gdalinfo -mm ${locations[i]} | grep "Band ${band}" -A1 | grep "Computed Min/Max"`;
try {
const response = await execShellCommand(infoCmd);
logger.debug('gdal response: ' + response);
Expand Down

0 comments on commit 93924c0

Please sign in to comment.