Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have the following code:

for fc in fcs:
    desc = arcpy.Describe(fc)
    ext = desc.extent
    ext.split(" ")
    print ext

I'm getting error: AttributeError: Point: Get attribute split does not exist

I know my fcs list is okay and the extent property is working correctly. I want each fc in fcs to output a list with the coordinates like this:

[-179.168566355952, 51.2134728616834, 179.748708978836, 71.3896098800921, NaN, NaN, NaN, NaN]

share|improve this question

2 Answers 2

up vote 8 down vote accepted

The ext is an object and not a list so Split won't work.

What you can do is:

list = [ext.XMin, ext.YMin, ext.XMax, ext.YMax]
share|improve this answer

You need to update your code to:

for fc in fcs:
    desc = arcpy.Describe(fc)
    ext = desc.extent
    l = str(ext).split(" ")
    print l

Note you are treating the extent object like a string then the returned objects in the list will be of string format.

share|improve this answer
    
I was able to do this in a round about way but the problem is that the list is now full of strings. –  Chet Steadman Feb 7 at 13:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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