Re: Implementing -scale functionality of gdal_translate

Sean Gillies


On Wed, Feb 6, 2019 at 2:32 PM <linden.kyle@...> wrote:
So I'm seeing some odd behavior now. I ended up trying the masked_array solution, but I'm seeing breaks in my data at the tile boundaries.

Here's what the data looks like if I use reprojection with just the source band (code:

Here's what the data looks like I read into a masked array and use an ndarray source (code:
Ironically enough I get the exact same result with my solution that doesn't use a masked array, but instead modifies the transform:

Your code looks okay. I recommend padding your read window by a few pixels on each side so that tile_window, tile_data, and tile_transform are slight dilated. I think this is very likely to eliminate what looks like an off-by-one error in the reprojection, an error that you don't see when you use the entire source dataset as the reprojection source. Does that make sense?

Sean Gillies

Join to automatically receive all group messages.