Processing Extent - same as layer should honour selection

11-16-2016 04:16 AM
Status: Open
Labels (1)
MVP Notable Contributor

Many raster processing tools honour the environment setting Processing Extent, for which one of the options is Same as layer XXX where XXX is the layer. But this layer may have a selection on it and in reality this is the what I want the extent to be (e.g. a single selected country polygon from a world dataset).

Almost all geo-processing tools honour selections but why is this incredibly important environment setting ignoring a selection?

For example if you run extract by attribute and set the extent to be a polygon layer with a selection (e.g. a single country polygon from a world dataset) the resulting raster still has the extent of the original world raster.

Either tools need to be able to identify a dataset has a selection and the processing extent is set to that (preferred option as that behaviour is inline with all other tools) or may be the list needs an addition option, something like Same as Selection in layer XXX.

The current clunky and unnecessary work around is to export the selection to a separate dataset and use that as the extent. This adds an overhead to processing time for large models/scripts.


A much more efficient way to set the extent to a selection is to use Feature Envelope To Polygon to create an extent dataset based on just the extent of each feature, and then set the extent to that. If your features are complex, this would be much faster than copying them all.


Hmmm sounds like you have been down this road before? This is not a tool I use regularly but a great idea! The only issue I can see with this tool is that its an Advance level license tool so for people who do not have that level this approach won't help them.

Certainly a work around I will adopt. Thanks.


Duncan, I got thinking about this and posted a Python script and Model Builder tool that you may find useful.