[Mapserver-users] Doing Query in PHP/Mapscript and Postgis

colombo.l colombo.l at email.it
Thu May 29 06:00:08 EDT 2003


--_=__=_XaM3_Boundary.1054202408.2A.581509.42.20690.52.42.101010.21279
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi to all,=0D=0A=0D=0AI'm a newbie, I'm using php 4.31 + mapserver dll (3.6.6 - compiled with postgis support) + Postgres (in wich I have all the maps).=0D=0AI did and understood the examples about how to load a map in the documentation section of the mapserver's site but now I would like to do a basic query.=0D=0AThe map is stored in a table which have this fields: gid | layer_type | the_geom.=0D=0A=0D=0AI need by clicking a point of the map to retrive the layer_type of that point.=0D=0A=0D=0AHow can I do that by using mapscript?=0D=0A=0D=0A=0D=0AThanks in advance=0D=0A=0D=0ALuca Colombo=0D=0A=0D=0APs1: I also need to do the opposite thing: by the layer_type/gid  to display on the map the results.=0D=0APs2: I paste a piece of my mapfile (I used it with the cgi mapserver and it works):=0D=0A=0D=0AQUERYMAP=0D=0A   SIZE 200 160=0D=0A   STYLE HILITE=0D=0A   COLOR 0 0 255=0D=0AEND=0D=0A=0D=0ALAYER=0D=0A NAME "layer_confine"=0D=0A CONNECTIONTYPE postgis=0D=0A CONNECTION "user=3Dcarlo dbna

m
e=3Dcatasto host=3Dscorpio.ing.unico.it port=3D5432"=0D=0A DATA "the_geom from mappa"=0D=0A CLASSITEM 'LAYER'=0D=0A STATUS DEFAULT=0D=0A TYPE Line=0D=0A FILTER "mappa.layer_typer=3D'CONFINE'"=0D=0A=0D=0A CLASS=0D=0A     COLOR 213 231 239=0D=0A END=0D=0A=0D=0A TEMPLATE t_query-f.html=0D=0A HEADER h_query-f.html=0D=0A FOOTER f_query-f.html=0D=0A=0D=0AEND


--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Alto rendimento, massima libert=E0. =C8 Conto Arancio di ING Direct.
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3D659&d=3D29-5
--_=__=_XaM3_Boundary.1054202408.2A.581509.42.20690.52.42.101010.21279
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<DIV>Hi to all,</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>I'm a newbie, I'm using php 4.31 + mapserver dll (3.6.6 - compiled with postgis support) + Postgres (in wich&nbsp;I have all the maps).</DIV>=0D=0A<DIV>I did and understood the examples about how to load a map in the documentation section of the mapserver's site but now I would like to do&nbsp;a basic query.</DIV>=0D=0A<DIV>The map is stored in a table which have this fields: gid |&nbsp;layer_type |&nbsp;the_geom.</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>I need by clicking a point of the map to retrive the layer_type of that point.</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>How can I do that by using mapscript?</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>Thanks in advance</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>Luca Colombo</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>Ps1: I also need to do the opposite thing: by the layer_type/gid&nbsp;&nbsp;to display&nbsp;on the&nbsp;map the results.</DIV>=0D=0A<DIV>Ps2: I&nbsp;paste a pi

e
ce of my mapfile (I used it with the cgi mapserver and it works):</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>QUERYMAP<BR>&nbsp;&nbsp; SIZE 200 160<BR>&nbsp;&nbsp; STYLE HILITE<BR>&nbsp;&nbsp; COLOR 0 0 255<BR>END</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>LAYER<BR>&nbsp;NAME "layer_confine"<BR>&nbsp;CONNECTIONTYPE postgis<BR>&nbsp;CONNECTION "user=3Dcarlo dbname=3Dcatasto host=3Dscorpio.ing.unico.it port=3D5432"<BR>&nbsp;DATA "the_geom from mappa"<BR>&nbsp;CLASSITEM 'LAYER'<BR>&nbsp;STATUS DEFAULT<BR>&nbsp;TYPE&nbsp;Line<BR>&nbsp;FILTER "mappa.layer_typer=3D'CONFINE'"</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>&nbsp;CLASS<BR>&nbsp;&nbsp;&nbsp;&nbsp; COLOR 213 231 239<BR>&nbsp;END</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>&nbsp;TEMPLATE t_query-f.html<BR>&nbsp;HEADER h_query-f.html<BR>&nbsp;FOOTER f_query-f.html</DIV>=0D=0A<DIV>&nbsp;</DIV>=0D=0A<DIV>END</DIV>

<p><font face=3DVerdana,Arial size=3D2>----<br>
Email.it, the professional e-mail, gratis per te: <a href=3D"http://www.e=
mail.it/cgi-bin/start?sid=3D3"=20
target=3D"_blank" >clicca qui</a> <br>
<br>
Sponsor:<br>
Alto rendimento, massima libert&agrave;. =C8 Conto Arancio di ING Direct.=
<br>
<a href=3D"http://adv.email.it/cgi-bin/foclick.cgi?mid=3D659&d=3D29-5" ta=
rget=3D"_blank" >Clicca qui</a> </font><br>
--_=__=_XaM3_Boundary.1054202408.2A.581509.42.20690.52.42.101010.21279--




More information about the mapserver-users mailing list