Error returning Shape extent

164
2
Jump to solution
03-03-2021 09:09 AM
CliveSwan
Occasional Contributor II

Greetings,

I am using the ESRI example to try and return the Features extent, getting an error:

Extent—ArcGIS Pro | Documentation

TypeError: '<' not supported between instances of 'Polyline' and 'Polyline'

 

 The error is at the for row in sorted:

 

 

for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, topdown=True, datatype=data_type): 
    #datasets = [''] + datasets if datasets is not None else []
    for filename in filenames:
            for row in sorted(arcpy.da.SearchCursor(filename, ['Shape@'])):
                #print(filename)
                extent = row[0].extent
                print(filename, extent)

 

 

 

Appreciate any pointers.

Thanks,

Clive

0 Kudos
2 Solutions

Accepted Solutions
CliveSwan
Occasional Contributor II

It didn't like the sorted..

View solution in original post

0 Kudos
jcarlson
Regular Contributor II

It probably would, but you'd need to give it a non-spatial field on which to sort.

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
CliveSwan
Occasional Contributor II

It didn't like the sorted..

View solution in original post

0 Kudos
jcarlson
Regular Contributor II

It probably would, but you'd need to give it a non-spatial field on which to sort.

- Josh Carlson
Kendall County GIS

View solution in original post