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 a shapefile and I want to change the order of the features. Is that possible using ArcMap?

share|improve this question
3  
I don't really understand the question. Why do you want to reorder the records? Is it for display purposes? Graphically or for the attributes? Just a reminder to the question as well as some answers authors, nothing should rely on the order of the records as they are sent in a response to a query unless you provide an ORDER BY clause. It can change from a DBMS engine to another, between versions of a DBMS engine, etc. –  GuillaumeC Feb 7 '11 at 8:09
    
You want to reorder the records for whatever purpose you need them to reordered... Such as building a graph (from the attribute table which will not respect the sort on-the-fly, but will respect when sorted permanently). And also for the issue of populating a sequential ID based on the sort. It needs to be sorted permanently before it will populate in the order; 1,2,3 etc –  SaultDon Feb 7 '11 at 15:48
    
@GuillaumeC I want to sort the features in the shapefile because I'm embedding this shapefile in a mobile app. The app will display a list of features, and although I could do the sorting at load time, I'd prefer to have them sorted. I think it's a legitimate reason, isn't it? –  tato Feb 7 '11 at 21:10
3  
The goal is legitimate, the mean is not. If you need them sorted, use the result of a query, don't assume they are and will remain sorted. –  GuillaumeC Feb 8 '11 at 7:49

4 Answers 4

up vote 5 down vote accepted

You can always open the attribute table in ArcMap and right click the columns header and select Sort Ascending.../Descending... for single fields.

For multiple fields you would instead click Advanced Sorting to select multiple fields.

NOTE: Adding, for instance, a sequential ID field based on the current sorting (which is temporary, stored only in this map/mxd) when using the above method will be ordered by the original OID/ObjectID of the feature class.

There is an ArcScripts available that will sort records permanently and output a new shapefile: http://arcscripts.esri.com/details.asp?dbid=16771

I do hope that when you state 'order of features' that this is the order found in the attribute table and not drawing order for the table of contents/symbology levels.

share|improve this answer
    
the script seems promising, as soon as I can try it I will mark the answer as 'the right one' –  tato Feb 6 '11 at 23:42
    
it worked, as expected –  tato Feb 12 '11 at 17:09

I don't know about Arc*, but for QGIS there is a Sort plugin: http://michaelminn.com/linux/mmqgis/

enter image description here

share|improve this answer

If you have access to an arcinfo license, you can use the Sort in the (Data Management toolbox) which writes the records into a new shapefiles or gdb fc based spatial or attribute sorting

share|improve this answer
    
unfortunately it works with FGDB, not with shapes –  tato Feb 7 '11 at 21:11
    
tato, the tool works with fgdb or shapefile as input and output, i've no idea what your comment above means. –  gotchula Feb 8 '11 at 0:05

An utility software of MapServer (free and open-source) can sort shapes according to attributes values :

http://mapserver.org/utilities/sortshp.html

share|improve this answer

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.