Tag Info

Hot answers tagged

2

Have you done the pgRouting workshop? The workshop should clarify the following: There are import tools for OSM data, so the network will contain the routing topology already after import. If you still want to use SHP files, then it explains how. Your bus stops have coordinates, so you just need to start from the nearest point in your road network. ...


2

ST_StartPoint() only accepts LineString as input. You'll have to strip your table down from MultiLineString to LineString, either by taking only the first element up each geometry ALTER TABLE foo ALTER COLUMN geom TYPE Geometry(LineString,4326) USING ST_GeometryN(geom,1) Or, more correctly, dumping the multis out, in case there are legit multis. ...


1

Are you calling pgr_drivingdistance and then using id2 (the "edge id") to join back to your edge table? If so, the pgr_drivingdistance function actually currently has a bug which causes this 'edge id' to not represent the actual path taken to get to that node. see https://github.com/pgRouting/pgrouting/issues/203 There's currently an open pull request to ...


1

You need to give more details, how you're using WMS. If you are referring to the pgRouting workshop Geoserver chapter, then you could do the following modification to the SQL query to return also the length as attribute: SELECT ST_MakeLine(route.geom) AS geom, sum(route.l) AS length FROM ( SELECT geom, ST_Length(geom) AS l FROM pgr_fromAtoB('ways',%x1%, ...


1

Lots of questions cause your question is too broad and subject is not as simple as it seems... Writing complete resolution for you could take few hours (!!!) so I'll only write down my line of thinking, it should give you direction which way to go. You have to achieve road network data to count routes... OSM should be good enough. Convert data into graph ...


1

You could get the geometry by joining your query result's id2/edge with your layers's geometry ID (gid): SELECT s.seq, s.node, s.edge, s.cost, b.gid, b.geom FROM ( SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra(' SELECT gid AS id, source::integer, target::integer, ...


1

Following the 2nd example from ST_MakeLine, you could join the nodes from your routing output, to nodes representing a Postgis point, and use this to create a line, something like: SELECT ST_MakeLine(gm.the_geom ORDER BY rt.seq) As route_geom FROM route rt inner join geometry gm on rt.node = gm.node ; where route is the output from pgRouting and geometry ...



Only top voted, non community-wiki answers of a minimum length are eligible