27

I have a rectangular raster image in ArcGIS Desktop.

How can I produce a polygon which is just the extent of the raster image?

That is, I want to have a polygon layer with a single quadrilateral which is the edge of the image.

I've tried simply doing a Raster->Polygon conversion, but this tries to use the data in the image to generate the outline - all I want is the outline of the edge of the image.

I'm using ArcGIS Desktop 10.

12 Answers 12

32

If you have Spatial Analyst then you can:

  1. Multiply the raster by 0 to create a constant value raster using Raster Calculator. (be sure to convert it to integer type or step 2 will not work)
  2. Convert the result of step 1 to polygon using the Raster to Polygon tool.

Another solution:

If your have 3D Analyst license then you can use the Raster Domain tool under 3D Analyst>Conversion>from raster (however it does not have the smooth function)

11

What about simply digitizing it? Click-click-click-click done.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • 8
    Not really sure why this option has been down voted. You can find the coordinates of the extent corners and create vertices at those coordinates. It can even be used for analysis. If it's only for display, click-click-click-click works great. – Baltok Mar 20 '12 at 19:26
  • 3
    I'd say because the raster could be an irregular shape and, depending on the complexity, could result in a pretty tiresome digitising job – Phil Henley Mar 20 '12 at 21:57
  • 4
    But the OP said it was rectangular. Seems like a pretty simple job to me. By zooming in and being accurate, the difference between the actual raster outline and the digitized outline would be negligible for any real world application. – Matt Mar 21 '12 at 13:09
11

You can use the Raster Domain tool from 3D Analyst to create a polygon with the same extent as your raster data

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • Welcome to GIS SE! Could you please add references to your answer? That way it would be more solid. – R.K. Nov 22 '12 at 14:22
  • Raster Domain tool did the job, perfectly! Creates an outline or boundary of the raster data. – user27891 Mar 10 '14 at 17:28
  • 1
    A word of warning about this tool - the bounding polygon that's created is the extent of your raster data starting & ending at the pixel CENTER, not the outside edge of the pixels. I just tried it and thought it returned the outside bounding box of the raster, but when you zoom in you'll see that the bounding box starts at the pixel center. – fbiles Aug 4 '16 at 3:29
  • There is actually a parameter for the IRasterDomainExtractor.ExtractDomain method that controls whether it uses the center or the outer edge of the pixels/cells. – Preston May 19 '17 at 22:36
  • This is perfect! One tool and I have a polygon outline of my raster. Thanks! – user3281667 Aug 3 '17 at 20:10
10

You can use the Build Footprint tool in the Data management Toolbox. You have to create a Mosaic Dataset out of your raster.

Create a new Mosaic in a File Geodatabase , add your raster.

Open your Mosaic in ArcMap and Extract the Footprint.

That's what I would do.

8

I use this simple python script, it create a polygon featureclass with the extent of all the raster present in a folder. To use it, you can create a tool in ArcToolbox or you simply change the InFolder and Dest (Destination) variables.

import arcpy,os

InFolder = arcpy.GetParameterAsText(0)
Dest=arcpy.GetParameterAsText(1)

arcpy.env.workspace=InFolder
#The raster datasets in the input workspace
in_raster_datasets = arcpy.ListRasters()

arcpy.CreateFeatureclass_management(os.path.dirname(Dest),
                                   os.path.basename(Dest),
                                   "POLYGON")
arcpy.AddField_management(Dest,"RasterName", "String","","",250)
arcpy.AddField_management(Dest,"RasterPath", "String","","",250)

cursor = arcpy.InsertCursor(Dest)
point = arcpy.Point()
array = arcpy.Array()
corners = ["lowerLeft", "lowerRight", "upperRight", "upperLeft"]
for Ras in in_raster_datasets:
    feat = cursor.newRow()  
    r = arcpy.Raster(Ras)
    for corner in corners:    
        point.X = getattr(r.extent, "%s" % corner).X
        point.Y = getattr(r.extent, "%s" % corner).Y
        array.add(point)
    array.add(array.getObject(0))
    polygon = arcpy.Polygon(array)
    feat.shape = polygon
    feat.setValue("RasterName", Ras)
    feat.setValue("RasterPath", InFolder + "\\" + Ras)
    cursor.insertRow(feat)
    array.removeAll()
del feat
del cursor  
  • can tell us in details how to use this code. I wanna use it on .asc raster file. My images are different different sub folder.? – GIS Data Butcher Mar 23 '15 at 12:14
  • 1
    Answer from jeb has worked for me, don't have sufficient rep to up vote him. @GIS Data Butcher Save the complete source into a script.py file and execute it from Python Window within ArcMap. You can use following command on Python Window to execute script from file. > execfile(r'd:\temp\script.py') – Asad Mar 13 '16 at 10:13
  • perfect!! i wonder, is there a way to the tool read subfolders as well? – raphael Feb 18 at 18:14
  • @raphael, for sure, you just have to implement the standard python os.listdir or os.walk in script. – jeb Feb 27 at 15:08
  • @jeb yes, i get the concept... bot i'm very new at this, and could not make it work... can you give some help? – raphael Feb 27 at 19:05
4

Also, an easy way is to use Reclassify tool where you should click the button Classify and change the number of classes to 1. Click Ok. Now, the output raster can be easily converted using Raster to Polygon conversion Tool. ;)

4

I think that reclassifying and converting the raster to polygon can be way too time consuming. In my opinion, the easiest way to do it is:

  • Get maxX, maxY, minX, minY (this can be done in Python with the describe command)
  • Run Create Fishnet with the extent as above and number of rows/columns as 1

If you have lots of rasters, this should be done in Python and can create hundreds of footprints in a matter of seconds.

0

In ArcCatalog you can create a raster catalog in a .gdb (Data Management Tools->Raster). Unmanaged is fine. Then right click and load (if the rasters are just sitting in a folder then "load from workspace". If you load the raster catalog into ArcMap you can right click-> data-> export footprint, as a shape file or feature class. The shape file will have a 'name' field populated with the name of the raster.

The Raster Catalog will automatically display the extents but I needed to send the extents to someone who wasn't using ArcGIS.

0

Use the "Raster to Polygon" tool in the conversion tools toolbox. Make sure to uncheck the simplify polygons box. This will create exactly what you want.

  • 8
    Are you sure this doesn't just create a huge mess of polygons, one for each contiguous set of equal-value pixels in the original image? – whuber Mar 21 '12 at 16:33
  • You could always add a dissolve after this to get the extent poly. However, I bet the python solution listed by @jeb is faster. – GeoJohn Jun 4 '15 at 15:45
0

"Raster Domain" tool will create a polygon around an irregularly shaped raster. I believe it requires a license for the 3d analyst extension.

0

Using ArcCatalog is the best option. Create a Mosaic Dataset from available rasters. Define "NO VALUE" in the mosaic to avoid the background of raster from being included in the polygon. Build footprints using Radiometric method. Open the Mosaic dataset in ArcGIS and export Footprints to shp file. Great way to get the mosaic boundaries...

0

If you are trying to get the outline of a DEM raster then you will need to do the following

If you have Spatial Analyst and 3d Analyst then you can:

  1. multiply the raster by 0 to create a constant value raster using Raster Calculator.
  2. Convert results of step 1 to a raster integer by using the "INT (Tool)". This is necessary for the next step.
  3. convert result of step 2 to polygon using the Raster to Polygon tool (only works with raster integers).

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.