2

I have tried importing my multilinestring shapefile from both qgis and the shapefile loader into postgis, but it gives me the following error when running the following code:

SELECT pgr_createTopology('migration.streams', 0.00001, 'id', 'geom', clean:=True); 

NOTICE: PROCESSING: NOTICE: pgr_createTopology('migration.streams', 1e-05, 'id', 'geom', 'source', 'target', rows_where := 'true', clean := t) NOTICE: Performing checks, please wait ..... NOTICE: ----> PGR ERROR in pgr_createTopology: Wrong type of Column id:geom HINT:
----> Expected type of geom is integer,smallint or bigint but USER-DEFINED was found NOTICE: Unexpected error raise_exception

1 Answer 1

2
pgr_createTopology(edge_table, tolerance, [options]) options: [the_geom, id, source, target, rows_where, clean] 

You have your id and geom column reversed. It should be:

SELECT pgr_createTopology('migration.streams', 0.00001, 'geom', 'id', clean:=True);

Also, if you use named parameters, you can use whatever order you want for the options:

SELECT pgr_createTopology('migration.streams', 0.00001, id:='id', geom:='geom', clean:=True);

or

SELECT pgr_createTopology('migration.streams', 0.00001, clean:=True, id:='id', geom:='geom');

etc.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.