How could I create a topology for a custom generated geometry table having just the_geom geometry(linestring) column? Because pgr_createTopolgy() asks for the gid column also for a given table, which is not something like primary key.


Why do you think that gid is not a primary key? Because the pgr_createTopology function requires a serial ID column as argument (the default column name is id), you could simply add it like this:

ALTER TABLE foo ADD column id serial;

Is there a reason, why this is not possible in your case?

| improve this answer | |
  • My bad. There was some inconsistency in my the_geom column's SRID. Indeed pgr_createTopology simply asks for geometry column and serial ID column and is working just fine. Thanks. – Zia Sep 25 '14 at 7:28

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.