Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Values in raster change after CookieCutter function #13

Open
rickemery opened this issue Oct 18, 2016 · 0 comments
Open

Values in raster change after CookieCutter function #13

rickemery opened this issue Oct 18, 2016 · 0 comments

Comments

@rickemery
Copy link

When the CookieCutter function is used to cut out a feature from a shapefile and raster with the same projection, the values in the raster are not maintained.

An example can be found in ftp://volga.ags.io/files/zs_large_raster.zip using zs_large_raster.tif and zs_large_raster.shp:

  1. Download zs_large_raster.zip and extract it's contents
  2. Open zs_large_raster.tif, examine values for pixels in FID 0
  3. Run the following:
inimg = GeoImage('/path/to/zs_large_raster.tif')
feature = GeoVector('/path/to/zs_large_raster.shp')[0]
CookieCutter(
    GeoImages(['/path/to/zs_large_raster.tif']),
    feature,
    './cut_raster.tif',
    abs(inimg.Affine()[1]),
    abs(inimg.Affine()[5]),
    True
)
  1. Open cut_raster.tif, examine values for pixels in FID 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant