Hot answers tagged

7

In order to perform this task in ArcGIS 10.1, you will require the Spatial Analyst Extension which can perform analysis on rasters including Least-Cost Path. ESRI has created a series of tutorials to get you started with Spatial Analyst. The last of which creates the optimal route to a site. If you follow the tutorial you should be on your way to finding ...


7

In terms of premade GIS, there's a bunch of stuff out there for travel costs on raster surfaces, e.g. r.cost, r.walk (different costs for uphill vs downhill!) If you prefer brewing up code yourself so you know the exact algorithm: http://stackoverflow.com/questions/2311486/how-to-calculate-the-shortest-path-between-two-points-in-a-grid


7

As @dassouki said, the Network Analyst solution could be suitable here, if you specify connectivity groups. In your case the overpass and underpass would be in separate connectivity groups, so it would not be possible to traverse between them. (In cases where there are stairs, you can allow pedestrians to change elevations.) In terms of allowing "...


5

If you're okay with some algorithm programming then a pathfinding algorithm is a good option. A* would work if you have a desired destination, if not Dijkstra would do well. Assign lower costs to brighter pixels. If you're looking for speed, though, it might not be the best option.


5

GRASS GIS has a C implementation in r.cost (source, documentation) which uses a min-heap. Alternatively, you could use a graph package like QuickGraph and Floyd-Warshall to compute the cost. Recent changes in GRASS 6.4 have made r.cost significantly faster, so perhaps performance may be good enough: on my laptop, it takes about 3s for a 1M cell region, or ...


5

Using Excel I computed speed of travel (V, km/hour) vs slope (degrees) using Tobler’s formulae: Defined time (T, seconds) needed to cross single cell in my DEM (2 m in my case): T=3600*2/V/1000 For every slope in range (-80,80,1) and exported results into 2 columns text file (abcd.txt): Placed point (centres) in the middle of my DEM and computed Path ...


4

A possible solution would be to use postgresql, postgis, pgrouting and osm2pgrouting. Insert your fixed locations in a postgis database. Insert the real road network in your database for the area that you need with an import of OSM data using osm2pgrouting. Optional: find the closest point on your road network from the user defined location. Use pgrouting ...


4

This is very similar to what our output looks like from the path distance tool incorporating a dem, vertical raster, and vertical factor specification (which is basically what you are trying to do with your resistance layer but it differentiates between uphill and downhill movement). It may just be what's expected given your elevation range and resistance ...


4

NetworkX provides a ready-to-use library for the A* Algorithm. Basically the steps you want to take are: Read the slope (the slope numbers are the weight, the more weight the less optimal) Create the graph from the slope matrix. This is the hardest part. Feed the NetworkX lib the graph and according to docs it should do the rest. This is a canned ...


4

The reason you are getting this particular error is that you are closing your outfile after the first iteration through the following loop: for rowTxt in rowsTxt: value = rowTxt.getValue("Value") count = rowTxt.getValue("Count") pathcost = rowTxt.getValue("PATHCOST") startrow = rowTxt.getValue("STARTROW") ...


4

There are number of tools from GRASS and SAGA which allows for cost analysis which you can access from the Processing Toolbox:


3

There are several relevant commands in GRASS: r.drain traces a flow through a least-cost path in an elevation model r.cost determines the cumulative cost of moving to each cell on the input cost surface r.walk outputs a raster map layer showing the lowest cumulative cost of moving between each cell and the user-specified starting points This answer ...


3

I have use the r.cost function in GRASS a lot. 1000 * 1000 grids were no problem on a normal laptop. There is also a R package (gdistance, http://r-forge.r-project.org/projects/gdistance/) under development. I found GRASS a lot faster.


3

I'd try something like this (example given in GRASS but the steps are similar for other software): Identify the source locations. One technique: mask the raster to the start row and filter the raster by value. Identify the destination points: in this case, select just the bottom row, and convert the results to vector points, then convert this 'end' raster ...


3

You can use the A* search algorithm using slope as the cost between generated nodes. To see a quick visualization of what that looks like: See A* Search Algorithm (Wiki) and Python A* Search Algorithm (SO) to understand A*. For a slope map there are options out there - Here is one. With a slope map (raster) you can get cost values out of it with GDAL.


3

The question you have asked is non-trivial. I can't speak from experience on how ArcGIS handles least cost paths on a raster, because I haven't played around with it. But if you want to use a strictly raster approach, then you are correct in your assumption that you will need to model the over/under for bridges and tunnels. The other major issue here is ...


3

Choose a range of values for costs (e.g. 1 = low costs, 10 = height costs). Reclasify each input data to a cost raster. e.g.: reclassify elevation: altitude > 1000 m --> cost 10 altitude 900 to 1000 m -> cost 9 … altitude < 100 m --> cost 1 reclassify proximity to rivers: distance < 10 m --> cost 1 distance 10 to 200 m -> cost 2 … Distance > ...


3

A simple approach, using your existing data structure and setup, would be to just use a for loop. ... for i in range(1,83): # i will have values from 1 to 82 route= "E:\\HEC\\strategicmap\\strategicmap.gdb\\route{0}".format(i) Uganda= "E:\\HEC\\strategicmap\\strategicmap.gdb\\Uganda{0}".format(i) arcpy.Select_analysis(PRIOUganda,Uganda, "\"...


3

I faced the same problem just recently. And I've found a way of getting a better path. In my case, I was trying to visualise the effect of having the Panama and Suez canals. My suggestion isn't going to help you find the exact distance, however - but it will trace a more realistic minimum cost path which should be closer in length to the real optimum. ...


3

Here is a script for GRASS GIS 7 I wrote for similar purpose. It takes as input map of vector points and uses r.walk to create cumulative cost surface and creates vector line (least cost path) between each of the points and then computes TSP to get optimal connection between the points using v.net.salesman. You can switch r.walk for r.cost and adjust the ...


3

Figured this out. Depending on how you do your LCPA you just have to reverse the new values in the reclassify tool.


3

I am afraid that you will need to create 79 distance rasters with the distance for each point. This can be done in model builder (with iterate features) or with python (loop on the ID with make feature layers). Once you have your 79 rasters, you can use "extract multi values to points" that will yield a origin-destination cost matrix in your attribute ...


2

It looks like the Google Maps API has a service for this: http://code.google.com/apis/maps/documentation/javascript/distancematrix.html Limit of 25 destinations, though. You might also be able to leverage the api form http://www.mapnificent.net/, though it's based on public transportation.


2

You say you are a "Excel tinkerer". "Mapping" in Excel is possible to some extent. I once saw a very involved Excel dashboard application that used a line chart to plot out boundaries of a study area and then VBA to determine what portion of the study area a given point was located within - all based on X\Y locations of both the study are line vertices and ...


2

The following script performs a least cost path analysis. Input parameters are a cost surface raster (e.g. slope) and start and stop coordinates. A raster with the created path is returned. It requires the skimage library and GDAL. For example the least cost path between point 1 and point 2 is created based on a slope raster: import gdal, osr from skimage....


2

The ArcMap Path Distance tools can do this, although it's moderately complex. Specifically, you need to use the horizontal and vertical factors. This looks at the aspect/elevation to figure out whether it's going uphill, downhill, or parallel to the slope, and assigns a different weight to each direction of approach.


2

You want to favor edges that are "close" to the line segment joining the endpoints of the path (its "axis," let's say). One direct way to do this is to weight the edges accordingly. How you weight them will determine what kind of path is "nicest." Just make sure that edges further from the axis get proportionately greater weight. As an illustration, I ...


2

QGIS has all the algorithms necessary, but there is no GUI to create matrices yet. With some Python knowledge the Network Analysis library documentation should get you started.


2

I guess pgRouting would be the best option for you. Could you please have a look at these post and say if this is in general what you are looking for? Creating many origin-destination routes with pgRouting (Answer of Otto Coster) If yes then there would be a additional loop neccessary do the calculations for all destinations


2

The r.cost GRASS module expects start_points to be a map containing point features. It seems that your map doesn't contain any point features. Try using a map with point features. With QGIS you can easily digitize such a map. For more information on the parameters see the r.cost manual page for GRASS 6.4:



Only top voted, non community-wiki answers of a minimum length are eligible