Select to view content in your preferred language

How to Get Polygon of Raster Extent in ArcGIS Pro

17681
12
Jump to solution
09-07-2021 04:55 PM
dgray
by
Regular Contributor

Hi,

I would like to know a way, or several methods if they exist, of generating a rectangular polygon representing the footprint of a raster using ArcGIS Pro.  I don't want to go through the extra time to convert a raster to polygon as is, because this is a potentially very time-consuming step (especially if the raster is an image), whereas I only want a single-valued output. 

If this method does not require higher licensing levels or extensions, that would be even better, but if not that's ok too.

If there's a custom Python script that will do that job, or a snippet of Python I could insert into a script, please let me know.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
DrVSSKiran
Frequent Contributor

Mosaic datset also generqte the raster foot print based on raster extent wothout any add on extension licenses.

Here is the link of arcmap, but similar you can try for pro. I have done in pro 2.0 and later versions

https://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/mosaic-dataset-footprints.ht...

View solution in original post

0 Kudos
12 Replies
DanPatterson
MVP Esteemed Contributor

If you can get the extent of the raster, you can create a polygon then add that to a new featureclass

Extent—ArcGIS Pro | Documentation

If you prefer a simple raster representing the extent, then

Create Constant Raster (Spatial Analyst)—ArcGIS Pro | Documentation

using a value of 1 and the cell size and extent of your current raster.  A constant raster... even if temporary... will convert to a polygon featureclass quite quickly since it only has one value


... sort of retired...
0 Kudos
Elijah
by
Frequent Contributor

I think Raster Domain 3D tool can do it. It outputs a polygon/line geometry of the input raster.

0 Kudos
DrVSSKiran
Frequent Contributor

Mosaic datset also generqte the raster foot print based on raster extent wothout any add on extension licenses.

Here is the link of arcmap, but similar you can try for pro. I have done in pro 2.0 and later versions

https://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/mosaic-dataset-footprints.ht...

0 Kudos
dgray
by
Regular Contributor

Thanks for your suggestions so far.  I will test the mosaic method, as I'm looking specifically for a way to not worry about licensing levels and extensions.

So far, I've created a working Python script (derived from another script meant to composite satellite imagery), which generates extent shapefiles of a satellite imagery raster based on min and max coordinates.  The biggest problem is that it assumes all rasters are oriented perfectly upright.  So it did what I asked it to do, but it's not actually the real extent, as my source rasters are angled.

Is there a way to get the corner coordinates of my raster's extent, not the mins and maxes?  Please take a look at my script (remove the .txt from the file) and provide your thoughts.

Thanks!

0 Kudos
DanPatterson
MVP Esteemed Contributor
xmin = extent.XMin
xmax = extent.XMax
ymin = extent.YMin
ymax = extent.YMax
lowerLeft = arcpy.Point(xmin, ymin)
lowerRight = arcpy.Point(xmax, ymin)
# etcetera

... sort of retired...
0 Kudos
dgray
by
Regular Contributor

Yeah, but if you have an angled raster (e.g. diamond shape), the lower left corner will not have a coincidence of xmin and ymin, etc.  You'll have a ymin, but the x value will be somewhere between the min and max extents of x.  Same with y...the upper right corner will have the ymax value, but the x value isn't necessarily at its max.  

dgray_0-1631140301692.png

 

What I'm really wanting to do is create a polygon that shows the exact footprint of the raster, regardless of its orientation.  I guess I'm saying the word extents, but it's the footprint I'm after, if I'm using terminology correctly.

0 Kudos
DanPatterson
MVP Esteemed Contributor

That can't be derived from the extent obviously, you will have to convert the nodata collar to a polygon, which you could get by classifying the nodata collar to 1 and everything else to 0.  Your probably multipart polygon would then have to be queried for each part's extent

A simpler solution would be to return the intersection points of the nodata and data collars


... sort of retired...
dgray
by
Regular Contributor

Hmm, ok, can this be done without extra licensing levels or extensions?  How do you get the data and nodata collars?

0 Kudos
dgray
by
Regular Contributor

So I ended up creating a script using the Mosaic dataset footprint generation.  It creates extra intermediate steps but it isn't too bad--I just set a scratch workspace and delete the content later.

However, I'm still interested in learning more about the data and nodata collar method.

0 Kudos