Hot answers tagged routing
13
Often it is good to address the need that is stated rather than answering the question that was asked. I would like only to point out that there is a well-known parallel solution that neatly circumvents all the technical computing issues: Santa has helpers. These agents work asynchronously and independently to identify the houses that need visits and carry ...
7
Contraction Hierarchy is a very fast algorithm:
http://algo2.iti.kit.edu/1087.php
This algorithm is RAM friendly while executing a query (to hold a contracted graph some more RAM is necessary as well as massive preprocessing)
There are some other algorithms - including the ones that solve public transit routing:
...
6
The only practical way is to add the 'missing' routes the data yourself. OSM probably shouldn't be putting parking lots into its walking routes. There are liability issues with adding routes that aren't real, properly maintained pedestrian paths. A parking lot, though walkable, could be dangerous and could be private property. You'll have similar issues with ...
6
OSM has a page dedicated to routing, which is worth going over:
http://wiki.openstreetmap.org/wiki/Routing
There is a special tool for importing OSM data into a PGRouting system and generating the required structure:
https://github.com/pgRouting/osm2pgrouting
Lastly, there is a workshop tutorial on getting routing working with OSM data here:
...
5
I have not used ArcGIS Schematics for more than some quick demos quite a few years ago, but there is a blog posting on Create route maps with the ArcGIS Schematics extension that may provide a solution.
5
The question has been asked before:
http://stackoverflow.com/questions/9535819/find-all-paths-between-two-graph-nodes and
http://stackoverflow.com/questions/58306/graph-algorithm-to-find-all-connections-between-two-arbitrary-vertices
4
Bearing in mind Sean's answer (that you have to add 'missing' pats yourself) as well as that these missing parts technically are parts of road-graph which are in turn are just lines, here is the quick'n'dirty workaround you may use. If the walking path has a common point with a "walkable" polygon, export this polygon's border as a line into your road-graph ...
4
I would start with the OpenStreetMap Wiki. From there, I would say that pgRouting is one of the more popular OS DB routing tools. If going with the pgRouting approach, OSM2PO is a popular way of creating the sql import statements for large regions of OSM data, as I heard that the usual database import utility used with pgRouting, osm2pgrouting, has trouble ...
4
This is something you can probably solve by using the Warshal's or Dijkstra's algorithm
Although the number of houses in the world is way too big it would take a long time to compute that, I think this is a good initial point. Now I don't have the time to explain them but i give you an initial point. I'll go out with my family now and maybe I'll go back to ...
4
What you need is a directed graph. The table osm2po creates for pgRouting is not directed. Nevertheless you can derive one forward and one backward edge from each segment (table-row). The result is an adjacency list - a little different from your representation:
graph = {
'A': {'B': 10, 'D': 4, 'F': 10},
}
osm2po (and I think pgRouting does also) uses ...
4
So here is what I would Find out:
Is your License valid, and not expired? To see this go to Start>>ArcGIS>>Desktop Administrator and go to the Availability Section. You will see how many ArcGIS Network Analyst extension licenses are available on your License Server, and how many are free. It will also indicate the expiry date of the License.
In ArcCatalog ...
3
You are getting that result because you chose PedestrianTime for your Impedance. The solver only considered the streets because of that.
The PedestrianTime network attribute represents the time it takes a
pedestrian to travel on the network.
If you wanted the best route, you should set the Impedance to TravelTime. This is explained in Exercise 3: ...
3
This is a challenging problem to start with! A good place to start is this tutorial on pgRouting, an extension to the PostgreSQL database with PostGIS, from one of our moderators. She has other posts on the topic here.
Once you have pgRouting working (no small task!) then you might want to check out Geoserver and OpenLayers for building a web-based ...
3
You probably could do something like this (assuming you already have an elevation raster in the database called 'elev' and the road network is called 'roads' with a primary key 'road_id')
-- Add a column for slope values
ALTER roads ADD COLUMN slope float;
-- Update with: (elevation of start pt - elev of end pt )/length of segment
UPDATE roads SET slope=(
...
3
This is TSP. You just haven't defined a valid distance metric because it does not satisfy the triangle inequality: if there is a route from A to C through B which is shorter than the stated distance from A to C, then the stated distance from A to C is, quite simply, wrong. The solution is to update the distance matrix by setting the length from A to C to ...
3
I think Google calculate a fastest route and then one or more alternatives, which may be shorter and slower, but not necessarily the shortest possible route.
Even the fastest may still have preference to using major roads compared to minor roads, even if the minor roads may be faster in some areas.
I think the alternatives are calculated by recalculating ...
3
I don't think I would recommend this at the start (more as a last resort for simplicity), but I have seen many subway maps actually manipulate the lines to be more orderly. Here is an example from the visual.ly blog depicting U.S. highways. I am pretty sure there are many more floating around though.
This mainly addresses your point #3, but it helps to ...
3
In addition to the suggestion by maw269 (which I also recommend), you can do OSM routing with SpatiaLite. There is a step-by-step tutorial on the SpatiaLite documentation page (direct link to PDF).
Obviously PostGIS will give you better scalability / multi-user capability, but if your needs are limited (in particular, the area is small), then SpatiaLite may ...
3
you can get vector data of road network from openstreetmap. They allows you to download osm which can them be converted to PostGIS, shapefile etc. see here for conversion details.
try JOSM which is a java client for downloading data from openstreetmap. You can find enough tutorials using JOSM here
Hope that helps
3
There is no error in your osm2pgsql output. It only gives a notice that it creates a vertices table with a serial column.
When the routing result looks fine, then the import and topology went well. You probably should check if you imported all ways you want to use and adjust the configuration file accordingly.
For multi-modal routing though (if you care ...
3
I would say Google Maps JavaScript API V3 is a good option for creating a web-based routing application.
You can calculate the directions by using the DirectionsService object. This object communicates with the Google Maps API Directions Service which receives direction requests and returns computed results. I believe most of us have done the similar ...
2
For routing you'll need a vector-line network dataset with nodes at each possible endpoint of a journey. Think of it like a skeleton line running down each corridor with a dot (node) at each door.
It seems you then need one of these for each floor of each building.
You can then use pgrouting in PostGIS or igraph in R to compute routes between nodes. These ...
2
I used now as before
v.extract input=lines@PERMANENT output=streets@PERMANENT where=highway='living_street' or highway='service' or highway='pedestrian' or highway='primary' or highway='residential' or highway='secondary' or highway='track' or highway='secondary_link' or highway='tertiary' or highway='tertiary_link' or highway='motorway' or highway='road' ...
2
pgRouting driving_distance function returns not only vertex(node)_id, but also edge(link)_id and cost. (See Official document - 'Examples' part and yellow nodes/links of bellow image.)
So, I think that you can find red point efficiently from driving_distance result like...
for [edge(link) which is not listed in result and connect listed vertex(node)]
...
2
you can check out MATSim - Agent-Based Transport Simulations. it has lots of well-documented tutorials too. there is good video here on vimeo.
MATSim provides a framework to implement large-scale agent-based
transport simulations. The framework consists of severel modules which
can be combined or used stand-alone. Modules can be replaced by own
...
2
If you don't care about which road network you get, I'd recommend you download some free TIGER datasets.
I would not recommend OSM because it just complicates things unnecessarily. The OSM graph is not routeable by default.
2
Possibly take a look at the topojson project, which includes a simplification option for geometry.
If you wanted to do this yourself one algoritm would be as follows:
Break each line into segments (pairs of points)
Order these segments in a clockwise direction (sort vertices by x ascending, then y
descending)
Calculate whether the segments are the same ...
2
You will most likely need to create transfer edges. I have found the ESRI help on this topic to be quite informative, as well as the 2nd exercise in the Network Analyst tutorial.
2
Have a look at the ArcGIS Tracking Server and Tracking Analyst.
These should do a decent job of showing your real-time data onto a map.
As fas as the data is considered, I think it should conform to the requirements for the above products. I do not have much insight into that area.
Cheers!
2
If I understand you correctly, and I am not an expert, but maybe you can find something in the source code of pgrouting shooting star heuristic function and modify it too your needs. Of course, your would have to build pgrouting again.
Only top voted, non community-wiki answers of a minimum length are eligible


