PolarGeospatialCenter / imagery_utils

Other
34 stars 10 forks source link

Fix bug where float32 outputs are integer values on pgc_ortho.py #43

Closed clairecporter closed 2 years ago

clairecporter commented 2 years ago

The warping step of pgc_ortho uses a UInt16 bit depth like the original raster. Using CreateCopy, the VRT driver in GDAL forces the VRT to that same datatype and truncates the floating point values. I fixed this by casting the warp image to floating point. It's not an elegant solution since it makes the temp warp file larger than necessary, but it will work.

Also fixed a bug in the VRT creation where the source dataset was being written twice to the same output. The bug likely had little impact.