Clip Raster Issues

2428
5
Jump to solution
04-06-2023 08:50 PM
jopie8
by
New Contributor II

Good day,

 
When clipping a raster with shapefile geometry, I encounter two difficulties and would like to know the best practices to avoid these issues.
 
First, when I make the clip, it gives me a raster that respects the boundaries of the shapefile and that doesn't have a background. That said, when I export the result in .TIF, a black background appears behind the shape that had been generated. Is there anything I can do to fix this, or is this just normal? I saw that from the symbology it was possible to click a button to remove the background, but I would like this background not to be part of the file. Maybe I am forgetting something about the theory behind raster files...
 
Second, I noticed that the exported TIF file size increased after the clip operation. Basically I have a 2 GB file, and the resulting clip which covers a portion of the original area is 40 GB. It doesn't seem normal to me that the result of a clip is bigger than its original file. I know I haven't given many details regarding export or clip settings, but I can provide some if needed. 
 
I was thinking maybe these were two small fixes and that there was probably someone who had encountered these two situations before.
 

Thanks!

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

first, rasters will have a rectangular extent regardless of the clip shape.  The area inside the clip boundary will have values, the area/cells outside the boundary are classed as "nodata" which will have a nodata value, that is how you can toggle off that area's visibility. 

Second, the clip operation will depend on the extent you specified, the cell size, the data type (integer/float) and a whole load of other things.  See the Environments section of this link

Clip Raster (Data Management)—ArcGIS Pro | Documentation

Tif is recommended so pay attention on what other parameters you specified in the tool


... sort of retired...

View solution in original post

5 Replies
DanPatterson
MVP Esteemed Contributor

first, rasters will have a rectangular extent regardless of the clip shape.  The area inside the clip boundary will have values, the area/cells outside the boundary are classed as "nodata" which will have a nodata value, that is how you can toggle off that area's visibility. 

Second, the clip operation will depend on the extent you specified, the cell size, the data type (integer/float) and a whole load of other things.  See the Environments section of this link

Clip Raster (Data Management)—ArcGIS Pro | Documentation

Tif is recommended so pay attention on what other parameters you specified in the tool


... sort of retired...
jopie8
by
New Contributor II

Thank you very much for the reply, it is really appreciated. If I understand correctly, then it is quite normal that a clipped raster export has a background. Regardless of the clip shape, a background will be automatically generated because it is part of the structure of raster files.

Then, as for the file size increase after an export, this will be influenced by the parameters that I specify in the tool during the export. Usually, I use the values automatically generated by ArcGIS if there are any. I am not sure what would be the appropriate specifications here. Are there by any chance well-known and general environment settings that keep the file size reasonable after export?


I can provide this dataset as an example of what I am working with, hopefully, that's helpful: https://open.canada.ca/data/en/dataset/ee1580ab-a23d-4f86-a09b-79763677eb47 

For example, here I would like to use this dataset to clip the province of Quebec. The raster for all of Canada is 2 GB but the resulting clip is 40 GB...

0 Kudos
DanPatterson
MVP Esteemed Contributor

Without downloading the files, I doubt that Canada would fit into 2 GB if it had the exact same cell size and coordinate system of Quebec.  As for the extent, only clip what you need and perhaps specifying the extent of your clipping polygon would be appropriate (assuming you have one).  Every tool in ArcToolbox has an Environments tab... that is where you specify properties, like cell size, extent etc


... sort of retired...
jopie8
by
New Contributor II

Hello, thank you for your advice. I did a little more reading and trial/error and from what I'm noticing, using a larger cell size helped exporting a smaller clipped raster in terms of file size. Also, apparently, raster images with a lower pixel bit type will result in a smaller file size than those with a higher bit type but in my case, I preferred the results I got in 16-bit than 8-bit as I seemed to lose some information in the process. I also ended up finding a bit more detail in this thread: https://community.esri.com/t5/arcgis-pro-questions/best-practices-for-clipping-data-from-living-atla...

That said, there is still one last thing I believe I can try that could potentially help. My raster has many more than one fields in its attribute table: I wonder if it was possible from the Environments tab to specify that the export of the file is done only by keeping two fields rather than six? A bit like we would do when exporting features for a feature class.

Thanks!

 

 

0 Kudos
DanPatterson
MVP Esteemed Contributor

try hiding the fields in the raster prior to clipping (from the fields view on the table).

there is no environments setting


... sort of retired...