4

I am using feature to raster to rasterize water polygons. It only makes a raster the extent of the features in the polygons, whereas I would like it to be the extent of another existing .tif image.

Global Mapper can export a raster with a larger extent than the input and fills the extra space with no data, but I don't want to integrate 2 separate processes for a large number of files, I want to work in ArcGIS.

I am using ArcGIS Desktop 9.3 but I do not have the Spatial Analyst extension.


DOES NOT WORK IN ArcGIS 10.0, it won't respect the new envelope.

  • For display and analysis, ArcGIS will automatically treat all regions outside the raster's extent as NoData, so there would seem to be no reason to do this. Is there a particular process in ArcGIS where physically storing the extra NoData pixels actually makes a difference? – whuber Aug 27 '14 at 19:58
  • 1
    An external tool i use to create content requires the extents to be the same. – Orswell Aug 27 '14 at 20:15
3

I noticed I could define the extent in the properties of the layer, export to layer file and then to .tif in ArcMap, so figured there would be a layer python command to make this in memory.

Use "gp.MakeRasterLayer_managment" to make a temporary raster layer with the extent set to be the desired file extent.

export the layer with gp.CopyRaster_management to an actual .tif to be processed.

Happy to add more details, this isn't my scripting computer so i can't cut / paste / mail code.

  • Good tip Orswell, look also at Snap Raster environment setting. It is often overlooked but will help exactly match your raster to an existing raster along with the extent environment. – Michael Stimson Aug 27 '14 at 22:04
2

if you look at the bottom right of your tool, there is an "environment" button. Click on it and you'll be able to define the properties of your output in more details (see here). (including "extent" same as one of your layers. This can also be set in the geoprecissing options from the main menu, for all tools at once.

Note that you could use vrt files (gdalbuildvrt) to create virtual raster files of the extent of the largest file without the need to store all your unnecessary NoData pixels. ArcGIS does read the vrt as a "normal" file.

  • I think i have tried to set the environment buttons settings but wasn't getting them to work as I understood them. I was under the impression that it's only the analysis area and doesn't "add" the extra area to an existing raster. I'm not confident I'm using it correctly either though. See the solution i found for more info maybe. – Orswell Aug 27 '14 at 20:19
  • if you use the environment with the copy raster tool, it should work. – radouxju Aug 28 '14 at 7:12
1

Here is another set of steps that may create a .tif with your desired extent. I haven't tested this yet. The Raster Clip tool allows you define the clipping extent and have the clipped raster extent match the clipping extent (the extent of the other image). This is the 8th parameter, maintain_clipping_extent. From ArcGIS help, MAINTAIN_EXTENT —The output extent will exactly match the clipping extent specified. It seems you can extend the image extents with the Clip command.

  • i looked into this as it would save me a step but it looks like maintain_clipping_extent is new in 10.2 and I'm still using 9.3. – Orswell Aug 28 '14 at 3:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.