I've written a [script][1] which produces a polygon shape file of the extents of all the thousands of rasters in our library. I want to organise the FID so that the files with the largest extents are on the bottom so that an area of interest can be easily selected.

By organise FID - i mean that the layers should be drawn (in the shapefile) from the smallest extent to the largest extent as otherwise (like in layer ordering) the record of the dataset that has the highest FID will get selected over anything below it. This is not a simple sort but it has to be to change the order in which the rows are written into the shape file.

Thanks,


  [1]: http://gis.stackexchange.com/questions/12175/get-extent-of-georeferenced-rasters-in-python-and-output-to-polygon-shapefile