Re: Clipping a raster (grib2), end up with zeros on left edge when cropping with mask

Sean Gillies

Hi Shane,

It looks like your feature geometries extend beyond the extent of your raster, yes? In that case, crop can create an extra row or column of pixels, which will be empty. This seems like a bug to me, or undefined behavior, at least. I suggest passing crop=False in your situation.

On Thu, May 23, 2019 at 8:52 AM Shane Mill - NOAA Affiliate via Groups.Io <> wrote:
Hi everyone,

I am currently clipping a grib2 file, and am ending up with zeros on the left edge of the raster. I'm not an expert with GIS so maybe this is a common problem but was curious if anyone else has experienced this before?
I think the issue is where the mask function is used with the cropping. 

In the picture below, the blue edge shows the zeros.
And for context, here is the driving code that is performing the action:

Sean Gillies

Join to automatically receive all group messages.