[pgrouting-users] pgRouting with Postgres 9.0 on Windows?

Daniel Kastl daniel at georepublic.de
Fri Jan 7 05:00:16 EST 2011


2011/1/7 Richard Marsden <winwaed at gmail.com>

> I'm trying to get pgRouting working with OSM data loaded into PostGIS.
> There's quite a learning curve as I am trying to work with the route data
> from an entire planet.osm file, and I'm completely new to PostGIS & Postgres
> (but not SQL/databases in general, or the concepts of routing and geospatial
> processing).
>

You could try with a smaller area first. Cool that it worked with planet.osm
OSM files for certain countries are available here for example:
http://downloads.cloudmade.com/
(You can download files with street network data only)


>
> I've got the data loaded up into PostGIS with osm2po. I'm running with
> Windows 7 x32 (x64 is available but PostGIS does not support this yet).
> About to try pgRouting and I find I don't have it installed (I thought I'd
> installed it earlier). And this is where I find the Windows build is
> expecting Postgres 8.4 , and not the 9.0 I have installed!
>

There are probably many Windows users in the pgRouting community, but
obviously just a few that can build Windows binaries.
So the currently available builds were reported to us from users. It would
be nice to find some volunteers, who could maintain the Windows builds.


>
> Is there a Windows build of pgRouting which will work with Postgres 9.0?
> Or I do have to uninstall 9.0, re-install with 8.4, and then reload the OSM
> data?
> (I still have the osm2po-produced scripts, but it would still take a day+
> to reload it all).
>

osm2po is independent from pgRouting, so you don't need to rebuild
everything.


>
>  I see that pgRouting only works with node numbers. However I shall have
> start/end points defined by coordinates. I'm still trying to figure the
> database out. Presumably I can use a query to find the closest node to each
> coordinate, although I can only see the link definitions and not the node
> definitions? (or are these implicit in the links?  ie. a link has a start
> node number and a start coordinate).
>

A-Star and Dijkstra work with node ID's, Shooting Star with link ID's.
You need to find the closest link/node to your start point to get the
start/end node/link
Yes, a link has a start node and a end node.


>
> Has anyone done this with osm2po produced data? What did your SELECT
> statements look like?
> (also does anyone have a sample pgRouting SELECT that works with
> psm2po-produced tables?)
>

To make it work the same way as in the tutorial I created a "view", for
example like this:

CREATE VIEW view_ph_topo AS SELECT id AS gid, type_name AS class_id,
st_length(geom_way) AS length, osm_name AS name, x1, y1, x2, y2,
reverse_cost, cost, km, kmh, priority, source, target, target_angle, osm_id,
pid, osm_source_id, osm_target_id, geom_way AS the_geom, geom_source,
geom_target, length(transform(geom_way, 900913)) AS meters,
length(transform(geom_way, 900913)) AS meters_rc, 0.0::double precision AS
to_cost, NULL::text AS rule FROM ph_topo;

Maybe the table layout of osm2po has changed again, so I can't say it works
exactly like this.
Then you should be able make a query like the ones in the tutorials.

Daniel




>
>
> Best regards,
>
> Richard Marsden
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>


-- 
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20110107/087ec80f/attachment.html


More information about the Pgrouting-users mailing list