How do I get AOI coordinates from Extract Data?

824
4
11-04-2013 10:29 AM
JimDickerson
New Contributor II
I'm trying to extend the Extract Data sample by passing the Area of Interest (AOI) coordinates to another program. Because the model is interactive and the AOI data temporary, I can't see the values while it is running. 

Can anyone tell me how to obtain the coordinates of the variable "aoi" in ExtractData.py?
Thanks,
Jim
0 Kudos
4 Replies
KevinHibma
Esri Regular Contributor
The AOI from extractdata is a featureset input.
There isn't really a 1 step you can do to get the coordinates of the polygon.

If you just want the features returned as they were submitted, you could add an output parameter of type featureclass and copy the input into the output.
If you really need the coordinates (which will be at least 3 X/Y pairs, if not more), you'll have to either do a cursor to get X/Y at each vertex, or maybe do something like features to points then do an Add XY and return the table values.
0 Kudos
JimDickerson
New Contributor II
In the script ExtractData.py, the variable aoi representing the feature set is passed around. I thought there would be some method or function that would break down the coordinates of the feature set into xmin, ymin, xmax, ymax. 
I was going to use that as a bounding box to a WMS server.

Can I do a describe or something on aoi?
0 Kudos
KevinHibma
Esri Regular Contributor
Well you could, but it wont be the same.
Odds are the extent of the input featureset will be bigger than the feature which was given.
I guess it all depends on what you want....the true coordinates of the feature which was given, or if the extent will do.

If you want the extent, you just describe each coordinate:
d = arcpy.Describe(aoi).extent
xMin = d.XMin
xMax = d.XMax
#etc
0 Kudos
JimDickerson
New Contributor II
In this particular case, the extent will do.  So I will try this approach.  Thanks for the help.
Jim
0 Kudos