ContinuumIO / elm

Phase I & part of Phase II of NASA SBIR - Parallel Machine Learning on Satellite Data
http://ensemble-learning-models.readthedocs.io
43 stars 27 forks source link

geo_transform is not correct when buf_xsize buf_ysize given #109

Open PeterDSteinberg opened 7 years ago

PeterDSteinberg commented 7 years ago

buf_xsize and buf_ysize control the number of x and y pixels in the returned image. I have noticed that these arguments are respected - they give the right size raster, but the geo_transform attr in the Canvas object reflects the resolution of the native file (in its 2nd and 6th numbers [grid cell offset distances]), not the resolution as its was interpreted by the reader.

An example - this is band 8 of the tifs in elm-data after being read with buf_xsize = buf_ysize =1000, the 15 and -15 in geo_transform are now wrong.

Out[106]:
Canvas(geo_transform=[220792.5, 15.0, 0.0, 4426807.5, 0.0, -15.0], buf_xsize=1000, buf_ysize=1000, dims=('y', 'x'), ravel_order='C', zbounds=None, tbounds=None, zsize=None, tsize=None, bounds=BoundingBox(left=220792.5, bottom=4426807.5, right=235777.5, top=4411822.5))