[pgrouting-users] add route layer to mapfile

Daniel Kastl daniel at georepublic.de
Fri Jun 29 06:07:31 PDT 2012


Hi Pedro,

It's long time ago that I have used pgRouting with Mapserver, but I
remember that I had to specify the SRID in DATA. Did you already look at
this example in the pgRouting documentation?
http://www.pgrouting.org/docs/howto/mapserver.html

Daniel


On Fri, Jun 29, 2012 at 1:44 PM, Pedro Costa <pedrocostaarma at sapo.pt> wrote:

> Hello,
>
> I am trying to add a route to a webserver with pmapper and mapserver but i
> can´t.
>
> I tried like that:
>
>
> LAYER
>    NAME "rota"
>    STATUS DEFAULT
>    TYPE LINE
>    CONNECTIONTYPE postgis
>    PROCESSING "CLOSE_CONNECTION=DEFER"
>    CONNECTION "user=pedro password=********** dbname=test host=localhost
> options='-c client_encoding=LATIN1'"
>
>  DATA "the_geom from
>        (SELECT id, the_geom
>        FROM arcos
>        JOIN
>        (SELECT * FROM shortest_path('
>        SELECT id2 as id,
>        source::int4 AS source,
>        target::int4 AS target,
>        length*estado_actual.custo AS cost
>        FROM arcos, estado_actual
>        where arcos.estado_a = estado_actual.id_ea',
>        438,489,false,false)) AS rota
>         ON
>  arcos.id2 = rota.edge_id)  AS rota2
>  using unique id"
>
>
>    TOLERANCE 3
>    TOLERANCEUNITS pixels
>    TEMPLATE void
>    PROJECTION
>    "init=epsg:27492"
>     END
>    METADATA
>    "DESCRIPTION" "rota"
>   # "RESULT_FIELDS" "n_rua,rua,compriment"
>   # "RESULT_HEADERS" "Nº do Trecho de rua,Nome da Rua,Longitude(m)"
>    "ows_title"      "Rota"
>        END  # Metadata
>        CLASS
>    Name 'ruas'
>    COLOR 0 0 0
>        END  # Class
>  END
>
>
>
>
>
> The error is in the clause 'data'. Mapserver can´t load the route and i
> don´t know why. The query works fine in database (if I remove 'using unique
> id' and put 'select' before  'the_geom'.
>
> Anybody know how resolve this problem?
>
> Thanks
>
>
>
>
>
>
>
>
>
> ______________________________**_________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.**org <Pgrouting-users at lists.osgeo.org>
> http://lists.osgeo.org/**mailman/listinfo/pgrouting-**users<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/20120629/491a2443/attachment.html>


More information about the Pgrouting-users mailing list