4

I need a polygon layer to draw in order based on a date field... What I'm trying to do:

I need to display an easement feature class with two different symbols: one for easements and one for vacations. In addition, I need this layer to draw in an order that represents the date in which they were recorded (stored in a date field). Using symbol levels is not an option because I am working with thousands of different dates (Also, ArcMap symbology options do not recognize date fields as dates...). The sort tool, which reorders the features in the database, is also not an option because this feature class is constantly being updated and it is not feasible for this tool to be ran frequently.

Any ideas?

2
  • Just for clarity: Is that supposed to be "vacancies" instead of "vacations"?
    – Erica
    Commented Jul 1, 2014 at 14:47
  • 2
    No, it is a vacation. As in vacating an easement.
    – Aaron
    Commented Jul 1, 2014 at 14:48

3 Answers 3

1

Sounds like you are trying to juggle several things at once here, regular updates, huge datasets (you say you have thousands of dates), different symbols and you want them drawn in a specific order.

I have never tried it but you can create custom renderers and layers using ArcObjects, this may be your solution but it will require quite sophisticated development. The topic is discussed here.

0

I have a feeling that without using symbol levels, feature draw order cannot be controlled by ArcGIS. I believe it depends entirely on the order of items returned from storage/database, which is arbitrary and can change. I've tried to change draw order of polygon features based on shape_area in the past (e.g. small features on top), but have never found a working solution unfortunately (except for sort).

0

Another option would be to use arcpy/python. The general code work flow would go something like this:

  1. Use search cursor against the layer/date field and create a arrary pair list (feature ID, and date) sorted by oldest to newest date.
  2. For each item in the date list, do another search cursor and grab the shape geometry (array of vertice x/y value pairs) and write the features using an insert cursor to a new or empty template feature class.

In theory this method should write all the features from oldest to newest, which should display the newest features on-top. You could create a script to run this manually or call this script to run via Windows scheduler at x time interval.

Also, you may reference this Q/A for additional options:

How to change the order of features in a shapefile?

7
  • Wouldn't that essentially be the same thing as running the Sort tool? Wouldn't the method's effectiveness also depend on the storage format as mentioned in this question?
    – Chris W
    Commented Jul 1, 2014 at 20:17
  • @Chris W, Essentially yes, however if you want to sort by shape geometry you need advanced license.
    – artwork21
    Commented Jul 2, 2014 at 11:43
  • You don't need to use two different cursors to get geometry information. Just use the token in your first one. ["*", "SHAPE@"] should work. If it doesn't you'll have to list out all the fields, and then list the token after that.
    – user125266
    Commented Nov 15, 2018 at 17:34
  • @Steve, for this scenario you need two cursors. The first one is needed generate the sorted array list. The second cursor is used to identify the insert order by the sorted date array. Yes, you can grab attributes and geometry all in one cursor but for this scenario you first need a complete date array to base the next step off of.
    – artwork21
    Commented Nov 15, 2018 at 18:19
  • @artwork21 As described you're using 3 cursors. One for sorted id and date. Another for geometry information, and a Third for inserting the features. The first two things can be done with one cursor at the same time. You can sort the first two steps all at the same time by using the order by parameter in the search cursor. You don't have to worry about making sure that every geometry is with it's proper feature ID and Date either if you use this method.
    – user125266
    Commented Nov 15, 2018 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.