1

I have some data stored in a CSV file containing name and date ranges.

For example:

ID | Name | Start | End   |  X  |  Y
-------------------------------
1  | Test | 2014  | 2015` | ... | ... |
2  | Test | 2014  | 2016` | ... | ... |
3  | Test | 2020  | 2025` | ... | ... |

I join this data based on the ID column with shapefiles and thus get the information coupled with the shape data.

I can assign different colours and write definition queries to make the data stand out and filter the date range but I would like to split the data over multiple layers in order to show shape data for year 2014,2015,... etc. in ArcReader.

I have a programming background but no prior experience of using ArcGIS Desktop.

How can I do this?

2 Answers 2

2

you can use the select tool with python. It's easier if you first copy the joined attributes to your feature class table, but not necessary.

here is a python snippet (assuming you work with a shapefile)

for year in range(2000,2015):
     arcpy.Select_analysis(fc, fc[:-4]+str(year)+".shp", """ "Start" = """ + str(year) )

this query is designed for a numeric field. For text field you should put it between ' 's

""" "Start" = '{}' """.format(year)
0
2

You can manually separate your data, if you want. First, select some records with select_by_attribute. Next, you have two options. You can save the selected set as a temporary layer in the Map Document by right-clicking the layer, Selection, Create Layer From Selected Features. Or save the selected set to disk as a shapefile or geodatabase featureclass by right-clicking the layer, Data, Export Data.

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