Tag Info

Hot answers tagged

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


6

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 ...


6

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.


4

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 ...


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 ...


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

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 ...


3

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 ...


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

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

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, ...


2

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.


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

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.


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

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:


2

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 > ...


2

The problems arise because the CostDistance calculations use the (Euclidean) distance in a map as a surrogate for the true distances experienced on the globe's surface. This surrogate will be distorted in two ways: The relationship between map distance and globe distance will vary according to location on the map. At any given point, the map-globe ...


2

if you need more advanced distance calculation, you should use the Path distance instead of the Euclidian distance. This allow you to account for the slope in the direction of the movement, which is necessary to adapt the true distance with respect to the elevation (using an elevation change as a cost raster does not work because this elevation change is ...


2

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") ...


1

If your points A and B are point features, there could be a snapping issue when (internally) converting to raster. It is safer to use a raster as input, making sure that the "snap raster" is activated. On the other hand, it is theoretically possible to have two (or more) "best path", so you would need to add additional constraint to chose your "preferred ...


1

If you have the Spatial Analyst extension, it sounds like you may be able to make use of the Path Distance tool. You will need an elevation raster to serve as input. The tool will output a raster with a value in each cell that represents the shortest distance to one of your points from that cell, taking the topography into account in its calculations. Of ...


1

I strongly doubt there is anything in ArcGIS 10 (or any other GIS for that matter) that will accomplish this accurately. One basis for this doubt is that I researched similar problems years ago and, finding no solutions, developed a general one. After five years of close review of related literature (including the GIS journals on which ESRI relies for ...


1

Did you see the PathDistance tool in ArcGIS?


1

In QGIS there is the Distance Matrix tool from the top bar: vector/analysis tools/distance matrix tool (I hope the translation is right because of my territorial version). I hope it helps


1

Using Network Analyst extension, you could: 1 - Use OD Matrix analysis, with the 4 harbor points, using travel time as cost, to calculate "nearest" facilities from each other; 2 - Select the 3 "nearest" pairs of harbors; 3 - For each of the pairs, use route analysis to create best route between them. 4 - Dissolve resulting lines summing the time; Note: ...


1

I asked the original question but I lost my login credentials. Let me give an update. I worked out how to do these non-Euclidean interpolations in ArcGIS but they took a long time to process (many hours). I just recently came across an R package (ipdw) that seems to produce equivalent output 4x faster.



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