Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/geotiffwriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export function writeGeotiff(data, metadata) {
metadata.StripByteCounts = [numBands * height * width];
}

if (!metadata.ModelPixelScale) {
if (!metadata.ModelPixelScale && !metadata.ModelTransformation) {
// assumes raster takes up exactly the whole globe
metadata.ModelPixelScale = [360 / width, 180 / height, 0];
}
Expand All @@ -367,7 +367,9 @@ export function writeGeotiff(data, metadata) {
// if didn't pass in projection information, assume the popular 4326 "geographic projection"
if (!metadata.hasOwnProperty('GeographicTypeGeoKey') && !metadata.hasOwnProperty('ProjectedCSTypeGeoKey')) {
metadata.GeographicTypeGeoKey = 4326;
metadata.ModelTiepoint = [0, 0, 0, -180, 90, 0]; // raster fits whole globe
if (!metadata.ModelTransformation) {
metadata.ModelTiepoint = [0, 0, 0, -180, 90, 0]; // raster fits whole globe
}
metadata.GeogCitationGeoKey = 'WGS 84';
metadata.GTModelTypeGeoKey = 2;
}
Expand Down