Skip to content

pgRouting + QGIS + Mac = headache #228

@johlund

Description

@johlund

Hello GIS-Pros,

I really need your help!

I'm a real newbie so please forgive me if this is a stupid post but I couldn't find a solution anywhere. I'm studying Urban and Regional planning at Stockholm University and right now we're doing this GIS project. The university uses ArcGis to train us but since I would like to be able to improve my skills at home on a Mac, QGIS sounded like the perfect solution. Most of our teachers really promotes QGIS as a good alternative and we're allowed to use it for this project as long as we can make it work. After going through the pretty advanced installation process with some errors regarding the version of R which I sorted out eventually, I was thrilled to see QGIS working and I was feeling good about this project since I now would be able to do it on my own computer. So far, so good..

For this project we need to calculate shortest path and other basic network analysis stuff and we're using geodata from Swedish government institutions (shapefiles). So I installed pgRouting with 'brew install pgRouting' (I've tried a million ways but this seems to be the best since it automatically installs all the postgis/postgres stuff needed) and I've created the datebase, added the extensions and from QGIS I can access the db with dbmanager and add PostGIS layers from the local server. So far so good.

I have followed the instructions at both docs.pgrouting.org and workshop.pgrouting.org and I have managed to run the pgr_createTopology command which have been successful. I've also installed Psycopg2-2.4.5 and the pgRoutingLayer plugin in QGIS.

So far so good BUT when running select pgr_analyzeGraph('vagar', 0.00001, 'geom', 'id'); I get some kind of isring-error:

ASTORP=# select pgr_analyzeGraph('vagar', 0.00001, 'geom', 'id'); NOTICE: PROCESSING:
NOTICE: pgr_analyzeGraph('vagar',1e-05,'geom','id','source','target','true')
NOTICE: Performing checks, pelase wait...
NOTICE: Analyzing for dead ends. Please wait...
NOTICE: Analyzing for gaps. Please wait...
NOTICE: Analyzing for isolated edges. Please wait...
NOTICE: Analyzing for ring geometries. Please wait...
ERROR: isring() should only be called on a LINE
CONTEXT: SQL statement "SELECT count(*) FROM public.vagar
WHERE true AND (true) and st_isRing(st_linemerge(geom))"
PL/pgSQL function pgr_analyzegraph(text,double precision,text,text,text,text,text) line 309 at EXECUTE statement
ASTORP=#


And when trying to click at the map with pgRoutingLayer I get a Python error:
An error has occured while executing Python code:

Traceback (most recent call last):
File "/Users/Jonas/.qgis2/python/plugins/pgRoutingLayer/pgRoutingLayer.py", line 262, in setSourceId
result, id, wkt = self.findNearestNode(args, pt)
File "/Users/Jonas/.qgis2/python/plugins/pgRoutingLayer/pgRoutingLayer.py", line 636, in findNearestNode
db = self.actionsDb[dados].connect()
File "/Users/Jonas/.qgis2/python/plugins/pgRoutingLayer/dbConnection.py", line 129, in connect
conn = ConnectionManager.getConnection( self.type ).connect( selected, self.parent() )
File "/Users/Jonas/.qgis2/python/plugins/pgRoutingLayer/connectors/postgis.py", line 135, in connect
return Connection(uri)
File "/Users/Jonas/.qgis2/python/plugins/pgRoutingLayer/connectors/postgis.py", line 153, in init
raise DbError(e)
DbError: FATAL: role "NULL" does not exist

Python version:
2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]

QGIS version:
2.0.1-Dufour Dufour, f738351

Python path: ['/Users/Jonas/.qgis2/python/plugins/processing', '/Applications/QGIS.app/Contents/MacOS/../Resources/python', '/Users/Jonas/.qgis2/python', '/Users/Jonas/.qgis2/python/plugins', '/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins', '/Library/Frameworks/SQLite3.framework/Versions/B/Python/2.7', '/Library/Frameworks/GEOS.framework/Versions/3/Python/2.7', '/Library/Python/2.7/site-packages/numpy-override', '/Library/Frameworks/GDAL.framework/Versions/1.10/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/pyparsing-2.0.1-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/PIL', '.', '/Users/Jonas/.qgis2/python/plugins/QuickMultiAttributeEdit/forms', '/Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools']


I've also added a screenshot from QGIS DBManager (Attached: DBManager) if that might be helpful.

Nothing seems to work and I can't find anybody online with the same problem. You guys are my last hope. And I need to get going really fast with this project that is due to be handed in before Xmas. If I cant sort this out during the weekend I'll have to install parallels and run ArcGIS or use ArcGIS at school which would be sad..

I must have missed something right? Something really simple?

Many many thanks in advance! Contact me at: ohlund.jonas@gmail.com if you need further information to help me solve this.

Kind regards,
Jonas Öhlund
Stockholm University
Department of Human Geography

dbmanager

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions