[OpenLayers-Users] help (pgrouting)
Stephen Woodbridge
woodbri at swoodbridge.com
Thu Feb 18 19:48:31 EST 2010
Ricardo Rodríguez wrote:
> hello all, it is possible that openlayers, work DIRECTLY with postgres,
> postgis and mapserver without pgrouting or need something WFS, which
> recommend.
> additionally there are tutorials or examples that utilize these programs
OpenLayers runs in your browser and it can not work "DIRECTLY" with
postgres/postgis but is can work via a simple Ajax request to a PHP or
other service you provide on the server.
There are plenty of examples and probably a tutorial:
http://www.google.com/#hl=en&source=hp&q=pgrouting+openlayers
Since pgRouting runs in the database and PHP can trivially access the
database, it is very straight forward to write a simple PHP routing that
takes a starting and end location via an Ajax request, then makes the
appropriate SQL queries to the database and gets back its results that
are then returned to the browser is simple XML. In Javascript you parse
the XML, there are tools to help already in OpenLayers, and display the
track as a vector layer.
Here is a demo I put together. However it uses code that is not part of
pgRouting, but the idea would be the same for what you are trying to do.
http://gis.imaptools.com/routing/leaddog/?zoom=10&lat=33.85667&lon=35.52978&layers=B0TTTF&start=35.492313%2033.826188&stop=35.595811%2033.906827&method=STS&lang=eng
Hope this helps,
-Steve
> thanks for your answers
>
> Ricardo Rodríguez
> Ing. Topográfico
> Univalle
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list