Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I was wondering if there are any alternatives to pgRouting tools.

Thinking about it for a bit, I think the only alternative is to use R or RPY to do the analysis.

Basically I'm trying to solve routing problems based on nonPostGIS databases. As most of my data is actually stored in a different format; however, it's not to hard to convert. I'm finding that pgRouting to my dumb silly brain is difficult to implement. So perhaps a non-database solution that I can easily tweak would be ideal for me

share|improve this question
add comment

10 Answers

up vote 13 down vote accepted

[Edit: this has been superseded by nx_spatial which is available from pypi (easy_install nx_spatial). Importing shapefiles is now standard in networkx 1.4]

I've been kind of disappointed by the lack of geometric network tools in ESRI's Python GP API, so I wrote up something that loads Shapefiles and Feature Classes into networkx directional graphs (DiGraphs).

It is still a work in progress, but it might be an okay starting off point for something that can help with your problem.

http://bitbucket.org/gallipoli/utilitynetwork/

Samples:

from utilitynetwork import Network

net = Network()

#load single file, method reqs OGR
net.loadshp("/shapefiles/test.shp")

#load directory full of shapefiles
net.loadshp("/shapefiles")

#load a feature class, req ESRI gp object, should work with shps as well
import arcgisscripting
gp = arcgisscripting.create(9.3)
net.loadfc("C:\somedb.gdb\featureclass", gp)

#Accessing node/edge data is done by the key value (the geometry as a tuple).
#access node data at x=4, y=2
nodekey = (4, 2)
net.node[nodekey]

Network is inherits from networkx.DiGraph, so all of that functionality is available.

share|improve this answer
add comment

Although the thread is a bit old, I wanted to add a few links about routing in case someone ends here like I did:

share|improve this answer
1  
OSRM made my day... :) thank you... :) –  Ade'l Mar 5 '13 at 12:29
add comment

There's Flowmap, a niche GIS package designed for dealing with network analysis issues.

If you have a fairly simple use-case, the QGIS-based Quantum Navigator might do the trick.

GRASS also supports network analysis, though it may not be worth the friction of getting things set up inside of the environment.

share|improve this answer
add comment

If you're looking for a programatic pythonic solution, take a look at networkx

share|improve this answer
    
Any libraries for going from .shp to networkx? I could build one myself in Python, but I'd rathe rnot reinvent the wheel... –  fmark Jul 30 '10 at 3:16
4  
Its not exactly a 1:1 match since shapefiles store data as simple features, not topological networks. So you need to know/assume some things about your source dataset first - primarily that all intersections are terminal nodes for a linestring. Here is an example of using geodjango to convert simple features into a networkx graph: code.google.com/p/marinemap/source/browse/lingcod/spacing/… –  perrygeo Aug 2 '10 at 16:17
add comment

You could use GeoTools' graph package to do the routing too.

share|improve this answer
1  
I think this sample is related to GeoTools graph usefulpracticalgeoblog.blogspot.com/2011/03/… –  ThomasG77 Mar 8 '11 at 9:08
add comment

You can also have a look at the tools from RouteWare. Long track record and not database bound

share|improve this answer
add comment

Not sure if that fits your particular requirements bu it might be worth looking at network extension of gvSIG.

share|improve this answer
add comment

Many routing problem use Dijkstra's algorithm to determine shortest path. It's relatively straightforward to code: http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

Also, Guido van Rossum wrote an early essay about graphs in Python. His short piece includes an approach for primitive route data structures and coding: http://www.python.org/doc/essays/graphs.html

There are a lot of routing packages out there. For specifically geographic purposes, besides pgRouting, graphserver (http://bmander.github.com/graphserver/) and ESRI ArcGIS Network Analyst come to mind. The social network analysis community has a list of graph analysis software at: http://www.insna.org/software/index.html and http://www.insna.org/software/software_old.html. Many of those packages are open source and relevant in a geographic context. For highly-sophisticated, robust or complex calculations, linear programming packages like CPLEX and Lindo Lingo might be worth investigating.

share|improve this answer
    
the problem is that most of these solutions need a system of nodes and links, and GIS data is usually not stored that way –  dassouki Aug 5 '10 at 11:06
    
Network analyst is about $2,500 and not really interested in making such a purchase now. I'd rather have a pythonic solution –  dassouki Aug 5 '10 at 11:07
    
Dijjkstra is for very basic graphics. For real life problems, usually it is a very heavy and slow algorithm. Also, ESRI software, as it is not open sourced, is difficult to improve and is slowly being left behind in favor of other tools. –  Délawen Dec 11 '13 at 11:43
add comment

If you are a Java programmer or do not fear to code in Java ;) you can have a look into my GraphHopper project.

share|improve this answer
add comment

In Alpha release but looks promising:

GeoDaNet (Alpha) - Spatial point pattern analysis on networks (based on PySAL Ptyhon library, concieved in GeoDa centre).

(Slides, manual, download.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.