0

I want to do some isochrones with pgrouting, and I am failing in setting up the network in the first place.

osm2pgrouting doesn't find my postGIS installation. Also, the error message is not very helpful (ERROR: postGIS not found) and I don't know what to do (reinstalling already tried).

What is your advice?

osm2pgrouting -f lebanon-latest.osm -d routing_lb -U jb -W 
***************************************************
           COMMAND LINE CONFIGURATION             *
***************************************************
Filename = lebanon-latest.osm
Configuration file = /usr/share/osm2pgrouting/mapconfig.xml
host = localhost
port = 5432
dbname = routing_lb
username = jb
password = 
schema= 
prefix = 
suffix = 
Don't drop tables
Don't add nodes
***************************************************
Connecting to the database
host=localhost user=jb dbname=routing_lb port=5432 password=
connection success
ERROR: postGIS not found

In PostgreSQL, the postGIS extension is installed:

postgres=# create extension postgis;
CREATE EXTENSION
postgres=# create extension pgrouting;
CREATE EXTENSION

Test:

postgres=# create extension postGIS;
ERROR:  extension "postgis" already exists

Not surprisingly, no tables in the database have been created:

postgres=# \c routing_lb
You are now connected to database "routing_lb" as user "postgres".
routing_lb=# \dt
No relations found.
1

You may need to create postgis extension in the routing_lb database. Right now you are creating it in postgres database and it may not be in same schema

1

Turns out you have to create the extensions in the database itself and not only once for the whole postgreSQL installation:

routing_lb=# create extension postgis;
CREATE EXTENSION
routing_lb=# create extension pgrouting;
CREATE EXTENSION
routing_lb=# \dx+ pgrouting
routing_lb=# select pgr_version();
              pgr_version               
----------------------------------------
 (2.5.2,v2.5.2,60585f1f7,master,1.58.0)
(1 row)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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