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.


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

Debes tener errores topológicos, verifica que no tengas líneas duplicadas, arcos, etc.. debes tener una capa super limpia topológicamente hablando.

English translation:

You must have topological errors, verify that you do not have duplicate lines, arcs, etc. You must have a super clean layer topologically speaking.

  • GIS SE is an English-language forum. Please translate non-English text in answers, much as I have done with Google Translate above. – Vince Nov 5 '20 at 21:23

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.