Hi Pedro,<div><br></div><div>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?</div>
<div><a href="http://www.pgrouting.org/docs/howto/mapserver.html">http://www.pgrouting.org/docs/howto/mapserver.html</a></div><div><br></div><div>Daniel</div><div><br></div><div><br><div class="gmail_quote">On Fri, Jun 29, 2012 at 1:44 PM, Pedro Costa <span dir="ltr"><<a href="mailto:pedrocostaarma@sapo.pt" target="_blank">pedrocostaarma@sapo.pt</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I am trying to add a route to a webserver with pmapper and mapserver but i can´t.<br>
<br>
I tried like that:<br>
<br>
<br>
LAYER<br>
NAME "rota"<br>
STATUS DEFAULT<br>
TYPE LINE<br>
CONNECTIONTYPE postgis<br>
PROCESSING "CLOSE_CONNECTION=DEFER"<br>
CONNECTION "user=pedro password=********** dbname=test host=localhost options='-c client_encoding=LATIN1'"<br>
<br>
DATA "the_geom from<br>
(SELECT id, the_geom<br>
FROM arcos<br>
JOIN<br>
(SELECT * FROM shortest_path('<br>
SELECT id2 as id,<br>
source::int4 AS source,<br>
target::int4 AS target,<br>
length*estado_actual.custo AS cost<br>
FROM arcos, estado_actual<br>
where arcos.estado_a = estado_actual.id_ea',<br>
438,489,false,false)) AS rota<br>
ON<br>
arcos.id2 = rota.edge_id) AS rota2<br>
using unique id"<br>
<br>
<br>
TOLERANCE 3<br>
TOLERANCEUNITS pixels<br>
TEMPLATE void<br>
PROJECTION<br>
"init=epsg:27492"<br>
END<br>
METADATA<br>
"DESCRIPTION" "rota"<br>
# "RESULT_FIELDS" "n_rua,rua,compriment"<br>
# "RESULT_HEADERS" "Nº do Trecho de rua,Nome da Rua,Longitude(m)"<br>
"ows_title" "Rota"<br>
END # Metadata<br>
CLASS<br>
Name 'ruas'<br>
COLOR 0 0 0<br>
END # Class<br>
END<br>
<br>
<br>
<br>
<br>
<br>
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'.<br>
<br>
Anybody know how resolve this problem?<br>
<br>
Thanks<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.<u></u>org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/pgrouting-<u></u>users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">Georepublic UG & Georepublic Japan<br>eMail: <a href="mailto:daniel.kastl@georepublic.de" style="color:rgb(66,99,171)" target="_blank">daniel.kastl@georepublic.de</a><br>
Web: <a href="http://georepublic.de/" style="color:rgb(66,99,171)" target="_blank">http://georepublic.de</a></span><br>
</div>