[Mapserver-users] Query postgis layer
Christian Blumer
christian.blumer at epfl.ch
Fri Jun 27 06:10:15 PDT 2003
This is a multi-part message in MIME format.
------=_NextPart_000_0051_01C33CBE.365EEF70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all
I would like to make a query on a layer connected to postgis with PHP =
mapscript.
The layer definition is:
LAYER
NAME ptmesure
STATUS off
TYPE POINT
CONNECTIONTYPE postgis
CONNECTION "user=3Dxxx password=3Dxxx dbname=3Dtest host=3Dxxx"
DATA "the_geom from (select * from mesure) as foo using unique gid =
using SRID=3D-1"
CLASS
NAME "gps"
COLOR 220 0 0
SYMBOL 'circle'
SIZE 7
TEMPLATE "mesure.html"
END=20
HEADER "mesure_header.html"
FOOTER "mesure_footer.html"
TOLERANCE 10=20
END
I am using =20
$my_layer =3D $map->getlayerbyname(ptmesure);
$numResults =3D $my_layer->getNumResults();
but the query result is always 0.
I tested is on the same layer but in shape format and it worked.
What should I do to make it work properly on a postgis layer?
Cheers,
Christian
------=_NextPart_000_0051_01C33CBE.365EEF70
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I would like to make a query on a layer =
connected=20
to postgis with PHP mapscript.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The layer definition is:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>LAYER<BR> NAME ptmesure<BR> =
STATUS=20
off<BR> TYPE POINT<BR> CONNECTIONTYPE postgis<BR> =
CONNECTION=20
"user=3Dxxx password=3Dxxx dbname=3Dtest host=3Dxxx"<BR> DATA =
"the_geom from=20
(select * from mesure) as foo using unique gid using =
SRID=3D-1"<BR> =20
CLASS<BR> NAME "gps"<BR> COLOR 220 0 =
0<BR> SYMBOL 'circle'<BR> SIZE=20
7<BR> TEMPLATE "mesure.html"<BR> END <BR> =
HEADER=20
"mesure_header.html"<BR> FOOTER "mesure_footer.html"<BR> =
TOLERANCE=20
10 <BR>END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I am=20
using </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>$my_layer =3D=20
$map->getlayerbyname(ptmesure);<BR>$numResults =3D=20
$my_layer->getNumResults();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>but the query result is always =
0.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I tested is on the same layer but in =
shape format=20
and it worked.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What should I do to make it work =
properly on a=20
postgis layer?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Cheers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Christian</FONT></DIV></BODY></HTML>
------=_NextPart_000_0051_01C33CBE.365EEF70--
More information about the MapServer-users
mailing list