[GIS] Problem using pgr_createTopology

pgrouting

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.

Best Answer

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);
Related Question