# ArcGIS Closest Facility with anisotropic round trips?

I’m working on a network analysis of an urban archaeological site where I’m running a closest facility analysis on some 2000 structures to specific features within the city. I’ve segmented the road layer and calculated travel times for each segment based on Tobler’s Hiking Function, which I then enter as the time cost to calculate the quickest routes from each house to the closest feature (in terms of time). The problem I’ve run into is how to calculate these as round trips. I can’t simply double the total time of each route because the time values are anisotropic based on slope and Tobler. I’ve tried running the analysis backwards (from Facility to Incident, instead of Incident to Facility), but this often results in different matches and routes, again because of anisotropy. I’ve also tried summing the From-To and To-From time values for the segments and using those as a kind of "round trip" cost, but this again results in different Incident-Facility matches from the original Incident-Facility analysis using the anisotropic times. I’m at a loss as to how to do this. I thought if there was a way to produce a list of network layer segments for each route, I could simply sum the opposite time values (TF vs FT), but I can’t find a way to produce this, plus I’m sure that each route would consist of both TF and FT values for each segment. Does anyone have a solution or have I reach a limit of current ArcGIS capabilities?

UPDATE: I’ve found the "Copy Traversed Source Features)" tool that will export a table with all of the segment values, but the process of recalculating the accumulated inverse time values is daunting, to say the least. I have to link the segment IDs from each route to the original network layer, then somehow note if each segment’s time value was TF or FT (via separate fields with 0 or 1 values) and replace it with its inverse. Even worse, sometimes segments are joined in the middle (not at a junction) and the time values have to be proportionally shortened.

I feel like there must be a way to write a script or something to automate this, rather than attempt to do it manually, but I have no idea how to do that.

Geographic Information Systems Asked on November 14, 2021

At GeoNet Can I run a Closest Facility analysis with anisotropic round trips? came up with a much easier solution than NetworkX.

All you have to do is run the Closest Facility analysis in reverse (Facility-Incident instead of Incident-Facility) and set the number of facilities to find to some higher number than 1 as I was doing (I used 3). This way the reverse route will be at least one of the 3 possible matches, if not the highest in the ranking. To join the two attribute tables so that I could sum the two total times, I created a new field in each layer and concatenated the Incident and Facility IDs to create a unique identifier for each route. The final tally is a round trip taking account of Tobler's Hiking Function in each direction.

Answered by Matt on November 14, 2021

## Related Questions

### Is this ST_Relate result expected?

1  Asked on August 8, 2021 by peter-stace

### Distance between labels? QGIS3.18

0  Asked on August 8, 2021

### Creating Minimum Convex Polygon – Home Range from Points in QGIS

7  Asked on August 8, 2021 by phil-allman

### Empty TIFF files while exporting images using Google Earth Engine

1  Asked on August 8, 2021 by stalker_of_the_stack

### How to calculate pixel area of a clipped image in Google Earth Engine?

1  Asked on August 8, 2021 by user173819

### GeoJSON Datastore and GeoServer

2  Asked on August 8, 2021 by jonsken

### QGIS 3.16 – Maptip shows contents only once

0  Asked on August 8, 2021 by giulio89

### Tracing not working with DWG-turned-KMZ file in QGIS

0  Asked on August 8, 2021

### eCognition TTA Mask : Aerial images in ecognition for supervised classification

1  Asked on August 8, 2021 by shiuli-pervin

### Map .pbf CRS in QGIS?

1  Asked on August 8, 2021 by hxd1011

### What is the difference between “Random Forest” and “Forest-based Classification and Regression” in ArcGIS Pro?

1  Asked on August 8, 2021

### PyQt5: Wipe XYZ Connections

0  Asked on August 8, 2021 by helpoverflow

### How to import H3 Spatial Index modules into NodeJS App

0  Asked on August 8, 2021

### ERDAS Imagine – missing colour column on greyscale image

0  Asked on August 8, 2021 by nikkijane

### Clip raster not working: no target filename specified QGIS

0  Asked on August 8, 2021 by gurkn

### Displaying multiple attributes in QGIS Composer legend

2  Asked on August 8, 2021 by gin

### PostGIS union multiple tables, big dataset, faster approach?

2  Asked on August 8, 2021 by steffen

### Using Geopackage JS and Openlayers in Angular

0  Asked on August 7, 2021 by quimi-font

### Transforming coordinate system in ArcMap gives Warning 001293?

0  Asked on August 7, 2021 by mingyang-guo

### GeoPandas sjoin returning fewer records than expected

0  Asked on August 7, 2021 by 5676