You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was computing the midpoint of my image from the getBoundingBox() and noticed the latitude was always a bit north of my actual image. This may be only specific to my images, but it seems that this is what caused it:
the getOrigin() function gets me the top left (north-west) coordinate of the image. The line var y2 = y1 + resolution[1] * this.getHeight();
would then always be north of the already north-most coordinate. This is what worked for me: changing the + sign in that code snippet to a negative sign var y2 = y1 - resolution[1] * this.getHeight();
This is would mean that y2 is now the southern border of the image. This code is from the getBoundingBox() function
The text was updated successfully, but these errors were encountered:
I second this. I am using GeoTIFFs of geostationary satellites, and I had to adjust the bounding box with the origin myself in order to display it correctly with openlayers.
Here is what I did, its a workaround and imho needs a fix in the getBoundingBox() function.
constgt=geotiff.parse(...);// for debugging, just use the firstconsti=gt.getImage(0);constorigin=i.getOrigin();constbbox=i.getBoundingBox();// manually fix miny and maxyconsttargetBbox=[bbox[0],bbox[1]-origin[1]*2,bbox[2],bbox[3]-origin[1]*2];
I was computing the midpoint of my image from the getBoundingBox() and noticed the latitude was always a bit north of my actual image. This may be only specific to my images, but it seems that this is what caused it:
the getOrigin() function gets me the top left (north-west) coordinate of the image. The line
var y2 = y1 + resolution[1] * this.getHeight();
would then always be north of the already north-most coordinate. This is what worked for me: changing the + sign in that code snippet to a negative sign
var y2 = y1 - resolution[1] * this.getHeight();
This is would mean that y2 is now the southern border of the image. This code is from the getBoundingBox() function
The text was updated successfully, but these errors were encountered: