Select to view content in your preferred language

Error returning Shape extent

1114
2
Jump to solution
03-03-2021 09:09 AM
CliveSwan
Frequent Contributor

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
Frequent Contributor

It didn't like the sorted..

View solution in original post

0 Kudos
jcarlson
MVP Esteemed Contributor

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
Frequent Contributor

It didn't like the sorted..

0 Kudos
jcarlson
MVP Esteemed Contributor

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

- Josh Carlson
Kendall County GIS