Skip to content

Commit

Permalink
Calculate resolution correctly for rotated rasters
Browse files Browse the repository at this point in the history
  • Loading branch information
loganwilliams committed Nov 8, 2023
1 parent 07f9007 commit 1eefc5c
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/geotiffimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,11 +860,20 @@ class GeoTIFFImage {
];
}
if (modelTransformation) {
return [
modelTransformation[0],
-modelTransformation[5],
modelTransformation[10],
];
if (modelTransformation[1] == 0 && modelTransformation[4] == 0) {

Check failure on line 863 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

Expected '===' and instead saw '=='

Check failure on line 863 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

Expected '===' and instead saw '=='
return [
modelTransformation[0],
-modelTransformation[5],
modelTransformation[10],
];
} else {
return [
Math.sqrt(modelTransformation[0] * modelTransformation[0] +

Check failure on line 871 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

Unexpected mix of '*' and '+'. Use parentheses to clarify the intended order of operations

Check failure on line 871 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

'+' should be placed at the beginning of the line

Check failure on line 871 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

Unexpected mix of '*' and '+'. Use parentheses to clarify the intended order of operations

Check failure on line 871 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

Unexpected mix of '+' and '*'. Use parentheses to clarify the intended order of operations
modelTransformation[4] * modelTransformation[4]),

Check failure on line 872 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

Unexpected mix of '+' and '*'. Use parentheses to clarify the intended order of operations
Math.sqrt(modelTransformation[1] * modelTransformation[1] +

Check failure on line 873 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

Unexpected mix of '*' and '+'. Use parentheses to clarify the intended order of operations

Check failure on line 873 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

'+' should be placed at the beginning of the line

Check failure on line 873 in src/geotiffimage.js

View workflow job for this annotation

GitHub Actions / ci

Unexpected mix of '*' and '+'. Use parentheses to clarify the intended order of operations
modelTransformation[5] * modelTransformation[5]),
modelTransformation[10]];
}
}

if (referenceImage) {
Expand Down

0 comments on commit 1eefc5c

Please sign in to comment.