Skip to content

Commit

Permalink
Merge pull request #413 from mike-000/rotated-resolution
Browse files Browse the repository at this point in the history
Calculate resolution correctly for rotated rasters
  • Loading branch information
constantinius authored Feb 5, 2024
2 parents 7bccb30 + 9650761 commit 0a4704f
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/geotiffimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,11 +860,20 @@ class GeoTIFFImage {
];
}
if (modelTransformation) {
if (modelTransformation[1] === 0 && modelTransformation[4] === 0) {
return [
modelTransformation[0],
-modelTransformation[5],
modelTransformation[10],
];
}
return [
modelTransformation[0],
-modelTransformation[5],
modelTransformation[10],
];
Math.sqrt((modelTransformation[0] * modelTransformation[0])
+ (modelTransformation[4] * modelTransformation[4])),
-Math.sqrt((modelTransformation[1] * modelTransformation[1])
+ (modelTransformation[5] * modelTransformation[5])),
modelTransformation[10]];
}
}

if (referenceImage) {
Expand Down

0 comments on commit 0a4704f

Please sign in to comment.