Way to calculate least cost distances for multiple starting and ending locations in same csv file at once.

2062
5
03-23-2017 10:33 AM
AdamKemberling
New Contributor

I have many many tagging locations and recapture locations formatted with starting latitude and longitudes and recapture coordinates in a csv file, and a raster file with the barriers weighted accordingly. I want the distances for each specific start to the corresponding recapture, not a raster of least cost paths between them all.

Comfortable working in R language, raster file size prohibitively large for gdistance package

0 Kudos
5 Replies
ShaunWalbridge
Esri Regular Contributor

Hello Adam,

If I understand your question, as you probably found there isn't a single geoprocessing tool that does exactly what you're looking for. It sounds like you have origin-destination pairs, and one (or more) weighted barrier datasets, which presumably take into account the ecological and oceanographic barriers relevant for your species of interest. You mentioned that you've tried to use R entirely to do this, but hit resource limitations. I don't know enough of the specifics of your problem to give you an exact answer, but here are a few things that may be relevant:

1. You can use the Cost Path tool with individual rasters and not do the entire CSV at once. Basically, you'd figure out how to do it once for a single origin-destination pair, then write a Python script (or use Model Builder) to iterate over the rows in your CSV, and run this analysis for each origin-destination pair within your dataset. Depending on the size of your raster and the number of OD pairs, this may take some computing time.

2. There are a variety of tools which integrate with ArcGIS which at least partially overlap with what you're asking. Circuitscape is focused on a single global optimization problem, but again could be used in an iterative fashion as mentioned above, and scales to quite large problems. MGET is another tool which is quite useful in this space, it combines R, ArcGIS and Python to solve complex modeling problems. It has tools, for example, for larvae dispersion.

Overall, it sounds like a general modeling problem, but if you post details we can try to help you through them. Depending on the size of your raster, you may also want to look at alternative representations of your connectivity dataset. For example, in the past I've used a pruned network model to represent global ocean connectivity at a relatively fine scale. Building this network initially takes some time, but the advantage is it then makes computing a route within the space very inexpensive and easily scalable.

Cheers, Shaun

DanPatterson_Retired
MVP Emeritus

Interesting linkage between Circuitscape author and Julia Language development.  Another addition, perhaps, to the linguistic family for Arc* Shaun?

0 Kudos
ShaunWalbridge
Esri Regular Contributor

Brad, Viral and I were all at NCEAS at the same time, Viral did some cool work with parallelizing the network modelling, and Brad rewrote it to Python in that time (it had been Matlab I believe). Definitely Julia is shaping up to be a nice language.

AdamKemberling
New Contributor

Hi Shaun,

First, I appreciate your responses and suggestions. To clarify the issue, I have many origin-destination pairs as you said, and a raster file spanning the entire study area with barriers I would like to measure distances traveled around. The barriers are land/marsh and have been assigned very large values to make them too costly to cross whereas all water cells have a very low value.

I have been approaching the problem using the gdistance package in R, because it seemed to be a good fit for the problem. The raster file is all set to go, but because of the size of the geographic area, and the grid size being so small the file is too large for my computer to calculate the transition layer, and I have resorted to breaking it into memory-manageable chunks to calculate the distances, but this is tedious and many of the pairs overlap where I would break up the original raster so I need to break the csv into matching chunks as well which is equally tedious.

my decision to use R rather than iterating through model builder was that I was having difficulty making the model and getting the tools to calculate distances rather than least cost paths, something that I felt would be straightforward and more accepting of my origin-destination pairs. I am looking into the MGET and circuitscape options now, but any assistance or suggestions for the model builder option would be welcome, as arcgis seems to do a better job with memory for raster file calculations.

Thanks again,

Adam

0 Kudos
DanPatterson_Retired
MVP Emeritus

and Pro has been ruled out? at least it should surmount some of the memory limits imposed by ArcMap... but I will let Shaun chime in on whether that would be a potential replacement for the ArcMap modelbuilder environment, since I don't use modelbuilder often enough to know if there are any inherent difference between the implementations.

0 Kudos