1

When I run

select pgr_createTopology('public.roads', 0.0001, 'geom', 'id');

all I get is "FAIL". The roads table has these fields:

id (integer) source (integer) target (integer) geom (geometry LineStringM,3006)

What am I missing? I have been unable to find a list of requirements for the network table, which I create using FME. I use pgRouting 2.2.2.

2

The geometrytype should be LineString, not LineStringM.

Try changing your geom column to LineString with this:

ALTER TABLE public.roads 
  ALTER COLUMN geom TYPE geometry(LineString,3006)
  USING ST_Force2D(geom);
  • Ah, yes, that helped. The query now works. Thank you. – johnrobot Aug 22 '17 at 7:51
  • should check as accepted answer. – LR1234567 Aug 22 '17 at 23:53

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.