I have two sets of data. One comprises all home sales in a given area, where each data 'point' is actually a polygon representing the lot that was sold. The other set comprises arrests made in the same area, where each point also has a date associated with it.

I want to use the IDW tool to tell me roughly how much arrest activity occurred around a given home in the 12 months preceding the sale. I essentially want to go row by row in the house sale data and tell the spatial analyst tool to consider only points from the second dataset from date n to n-365, then interpolate all points within 1000 feet that satisfy this condition. Any ideas?

I believe I can select all the points that meet my date criteria, but I am not sure how to feed that to the IDW tool interactively (iteratively - i.e. a different selection criteria for each data row, because each home sale happened at a unique location on a unique date).

  • Most tools honor selections when run - you'd have to test to make sure IDW does. That handles the interactive part. If you want to iterate the rows and do all your interpolations automatically, you'll need to create a model (with ModelBuilder) or script that has all the steps to do one house, and then an iterator to step through the houses.
    – Chris W
    Commented May 10, 2015 at 22:39

1 Answer 1


Using ArcPy, this can be accomplished as follows:

  • Create a temporary Feature Layer (MakeFeatureLayer) from the arrests feature class
  • Repeat for all lots:
    • Use Select by Location on the layer with the condition "closer than 1000 feet to the specified lot", creating a new selection
    • Use Select by Attribute on the layer with the condition "date of sale - date of arrest is between 0 and 12 months", restricting the selection
    • Specify the layer as the input to the IDW tool
  • Jan, thanks for the response, I think that is almost exactly what I need. The remaining issue is that I'm not (yet) sure how to iterate this house by house - for each line in my housing data I want to take the value in the "date field" and use it to make a temporary feature layer from the arrest feature class that only includes the features from the proceeding 12 months...then get the IDW value for the house. Moreover, I have millions of houses, will this be to computationally difficult? I feel like my approach is missing something obvious and I'd appreciate your help isolating it Commented May 11, 2015 at 8:18
  • @MatthewFriedman You'd need to add selection by date to the list before making the feature layer. Millions of data points could be an issue, but depends on many things. However, extract some as test data (in the hundreds) to make sure your method works. You might also need to split your data in smaller portions before running the final calculations. This is a process that can be performed with either Modelbuilder or Python. If you have no programming experience I'd go with Modelbuilder, otherwise I think you'll have more control in Python.
    – Martin
    Commented May 11, 2015 at 8:45
  • When I use the "Select by Attribute" tool, how do I pass the sale date into the expression. It appears that only variables from the stops layer appear in the Query Builder. What convention is used to calculate dates here anyway - for instance once I am able to pass in the sale date, how do I write the expression "sale date - 365 days < stop date <= sale date"? Commented Jun 4, 2015 at 17:18

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.