I'm using Network Analyst to find closest facilities. What want to do is find closest facilities between origins and the nearest in-state destinations and between origins and the nearest out-of-state destinations (of the same input origin and destination data sets). I use national data sets of approximately 30,000-70,000 origins and several hundreds to thousands of destinations. What I'd like is to place a restriction or constraint parameter based on the state of my origin and destination in their attribute tables, not a restriction in the network data (I'm using the ESRI national road network).
Any ideas on best way to do this with the minimal amount of initial file set-up, processing time, and post-processing output file work? Would be great to have an additional parameter for this in those tool sets. Just getting started with learning Python, fyi, but I'm sure it's doable in Python.
The *undesirable* way of doing this in the past is to run as either a Closest Facility or OD matrix function (usually the latter) where I'm processing more combinations than I really need by "limiting" my destination count to, say, one more than the maximum number of destinations of the state with the largest number of destinations. The massive output file is then manipulated and subset in several subsequent steps (that ArcGIS can't really handle, even in a geodatabase) to identify the lowest travel time between the origins and their closest destinations within and outside the same state of the origin. I've also done this with subsets of the data as input files, but then it's a matter of manipulating several output data sets the same way.
May not be much help, but I'm using NA Closest Facility to calculate the 50 closest fire stations to a set of intersections and addresses. I needed to increased response time on stations outside our county, by either two or four minutes. Initially I used a Definition Query to select the four-minute or two-minute stations, then set the time attribute field to two or four when adding the facilities. Ultimately I added a time-attribute field to the feature class.
Admittedly, I'm only working with a few hundred features.