I have a feature class with multiple overlapping polygons. It's a highways fc and contains underpasses, overpasses and at grade roads & intersections. The problem I have encountered is that the items are not returned in the order I desire. Is there a way to correct this? From what I've read, it is related to the object ids so the only solution I can see would be to write some python code to loop through each feature based on a 'level' attribute and write those with the smallest value (say -1) to a new fc first, followed by levels 0 and 1. I'm using ArcGIS 10.0
Instead of continuing in the comments, I will summarize here. I think your answer is twofold. For the first way of dealing with this, see @Maksim 's answer above. Symbol Level Drawing is the way to go if you want items to be ordered on the map in a certain way.
If you are looking to process data in a certain order, you will need to use an ORDER BY clause in your select statement, or some other way of ordering the data after you retrieve it from the DB.
To elaborate on your concern that the process is not arbitrary: You are right, arbitrary is not strictly correct. However, there are two things to keep in mind:
- The default order depends on the DB type you are using, and the underlying DBMS.
- All RDBMS have statements that allow you the order in which data are returned, and this is for a good reason. The DBMS inherently has no way of always returning data in the same way. See these answers for examples of MySQL and SQL Server
Another point I want to get across is that Object IDs do not change, that is their whole point. I just tried this (with File GDB) editing features does not change their OID. Splitting features will keep one feature with the original OID and create a new one with the next available. OID's are managed by the Geodatabase, in order to not allow you to ever create a duplicate OID.
There is a Sort tool available in ArcGIS, which allows you to reorder the records in the GDB, but it will not re-order them in the existing table, but rather create a new one. It is meant mostly for spatial sorting. This goes to show that you can't influence the order of records in an existing table, as they are managed by the DBMS. This tool simply creates a new table and inserts the records in the desired order.
Look into Symbol Level Drawing. From the accompanying screenshots, it looks to be the solution to your issue.
Accessible via the Advanced button, within the Symbology section of Layer Properties.