[pgrouting-users] shootingstar_sp vs shortest_path_shooting_star
John Williams
jdwilliams1982 at gmail.com
Mon Dec 5 17:17:21 EST 2011
On Mon, Dec 5, 2011 at 12:33 PM, Stephen Woodbridge <woodbri at swoodbridge.com
> wrote:
> On 12/5/2011 11:32 AM, John Williams wrote:
>
>> I've got directions working fairly well using the shootingstar_sp
>> example from the workshop on the website. Now, I'm trying to get one-way
>> streets working. Can this be done with shootingstar_sp? ...or do I have
>> to use shortest_path_shooting_star()? Can someone tell me the
>> difference? I've found shortest_path_shooting_star in the documentation,
>> but not shootingstar_sp.
>>
>> Thanks...
>>
>
>
> Yes you can do oneway streets in shooting star.
>
> create a column "reverse_cost" then set reverse_cost = cost and then set
> the cost or reverse cost to 10000 for the wrong way.
>
> sone you call shortest_path_shooting_star(..**.., directed,
> has_reverse_cost) and set both directed and has_reverse_cost to "true".
>
>
Great, thanks. I used osm2po to convert osm data to routing data and it
appears to have set the appropriate reverse_costs to 1000000. However, this
query still ignores one-way streets:
SELECT rt.gid, ST_AsGeoJSON(the_geom) AS geojson, ways.the_geom,
ST_Length(ST_GeographyFromText(ST_AsText(ways.the_geom))) as
meters,
length(the_geom) AS length, name, source, target, x1, y1, x2,
y2, ways.gid
from (select edge_id as gid from shortest_path_shooting_star('select gid as
id, source, target, x1, y1, x2, y2, to_cost, to_cost as cost, rule,
reverse_cost from ways', 763081, 753436, true, true)) as rt, ways where
rt.gid = ways.gid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20111205/09f048b1/attachment.html
More information about the Pgrouting-users
mailing list