When I upload a shapefile to PostgreSQL using the QGIS tool I can create the routing topology following this tutorial without any problem.
But when I use the PostGis Shapefile Import/Export Manager or the SQL generated by the shp2pgsql.exe I can't get any values for the x1,x2,y1 and y2 fields.
UPDATE edge_table SET x1 = st_x(st_startpoint(the_geom)),
y1 = st_y(st_startpoint(the_geom)),
x2 = st_x(st_endpoint(the_geom)),
y2 = st_y(st_endpoint(the_geom)),
cost_len = st_length_spheroid(the_geom, 'SPHEROID["WGS84",6378137,298.25728]'),
rcost_len = st_length_spheroid(the_geom, 'SPHEROID["WGS84",6378137,298.25728]');
Only cost_len and rcost_len have values after running that script.
And because of that I can't get any route at all. What am I missing?