matafokka/geotiff-geokeys-to-proj4

Bug in PCSKeys.js

Closed this issue · 4 comments

There seems to be a bug in lines 108 & 109 of EPSG/data/PCSKeys.js:

k.o3.ProjOriginLatGeoKey = k.ProjNatOriginLatGeoKey;
k.o3.ProjScaleAtOriginGeoKey = k.ProjScaleAtNatOriginGeoKey;

It think this should be:

k.o3.ProjOriginLatGeoKey = k.o2.ProjNatOriginLatGeoKey;
k.o3.ProjScaleAtOriginGeoKey = k.o2.ProjScaleAtNatOriginGeoKey;

You're right, thank you, such silly mistake. Also found that ProjScaleAtCenterGeoKey and ProjScaleAtNatOriginGeoKey have units and proj keys instead of u and p. Will be fixed today.

Aaand done, please, update version in package.json to 2021.10.29.

Again, thank you so much for diving into the code and finding a problem!

Many thanks for the quick fix and the new release!

Unfortunately, my geotiff file still doesn't work. I will make a new issue.

Sorry to hear that. Can you send me geokeys (output of geotiff.getGeoKeys()) and a Proj4 string that your favorite GIS generates? Or just send GeoTiff file itself, if it doesn't contain any sensitive information. I'll see what I can do tomorrow.