Take the 2-minute tour ×

I am using ArcGIS 10 with ArcEditor license. I have a 10 year composite of month-to-month temperature values for 17 weather stations. That makes 120 months. I have to select each and every month separately and create a layer out of that selection. Is there an easy way to do that so that I can avoid having to make the repetitive 120 selections?

share|improve this question

marked as duplicate by PolyGeo Oct 26 at 6:17


4 Answers 4

Here is what you could do since you only have ArcEditor license:

  1. ET Geowizard Split by Attribute tool

    • Create new text field called split in your point layer
    • Concatenate your year and month fields together to the new split field
    • Use the ET Geowizard Split by Attribute tool to generate all your shapefiles based on your split field
  2. Another option would be to use Iterate Feature Selection using ModelBuilder.

share|improve this answer

GIS.SE member Dan Patterson's Split Layer by Attributes tool on the ArcGIS Geoprocessing Model and Script Tool Gallery should do the trick:

Splits a layer according to attributes within the selected field producing a separate shapefile for common attributes.

If the FID or some other unique ID field is used, you can effectively produce separate shapefiles for each feature. If you are using a decimal field with a scale of 0 or an integer field or a string field, you can have one or more features in the output shapefile. Date fields need to be converted to a string field and integer fields should contain positive numbers

The selected field is queried for unique conditions. If a prior selection exists, then only those records are queried. The unique values found in the field (or selection within) are used to partition the input layer into the output layers.

share|improve this answer

I'd use the Select geoprocessing tool to accomplish this. If you make a folder with only these 17 weather station files this aught to do the trick:

import arcpy

# Path to your 17 weather station files (all in one folder by themselves)
arcpy.env.workspace = r'...'

# This is the output file path
output = r'...'

for lyr in arcpy.ListFiles():

    # This variables might start at 1 depending on your data
    year = 0

    #These variables depend on what your fields are named
    yearField = "theYear"
    monthField = "theMonth"

    # Loop through each year, set SQL clause based on current year
    while year < 10:
        yearClause = '"' + yearField + '" = ' + "'" + str(year) + "'"
        month = 0

        #Loop through each month, add current month to SQL clause
        while month < 12:
            # This is the SQL statement to select the correct year / month
            whereClause = yearClause + ' AND ' + '"' + monthField + '" = ' + "'" + str(month) + "'"

            # This is where you actually create the layer (make sure your output filename makes sense)
            arcpy.Select_analysis(lyr, output + str(year) + "_" + str(month), whereClause)

            month += 1 # increment counters
        year += 1


share|improve this answer

I know you said you have ArcEditor, but just for completeness sake, if you do have access to an ArcInfo license, the function you would most likely want to use is the Split geoprocessing command, which:

"creates a subset of multiple output feature classes"

Split graphic from ArcGIS Online Help

share|improve this answer
