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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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