[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Re: [Mapserver-users] Query postgis layer
From:       "Christian Blumer" <christian.blumer () epfl ! ch>
Date:       2003-06-27 14:33:21
Message-ID: 007201c33cb9$0f1d7170$9852b280 () photigr3
[Download RAW message or body]

Oups I forgot that,

I perform 
    $map->queryByPoint($clickGeo, MS_SINGLE, -1);

Christian Blumer
Ecole Polytechnique Fédérale de Lausanne
ENAC/INTER/PHOT
Batiment GR
1015 Lausanne, Switzerland
  ----- Original Message ----- 
  From: Oscar Testa 
  To: postgis-users@postgis.refractions.net 
  Sent: Friday, June 27, 2003 4:19 PM
  Subject: [postgis-users] Re: [Mapserver-users] Query postgis layer


  Christian,

  where do you perform de query in the mapscript script???

  >I am using     
  >$my_layer = $map->getlayerbyname(ptmesure);
  Here you must include something like 

  $my_layer->queryByPoint($my_point,MS_MULTIPLE,0) 

  OR 

  $my_layer->queryByRect($my_rect) 

  >$numResults = $my_layer->getNumResults();
  >but the query result is always 0.

  Regards
  Oscar
    ----- Original Message ----- 
    From: Christian Blumer 
    Cc: mapserver-users@lists.gis.umn.edu 
    Sent: Friday, June 27, 2003 10:10 AM
    Subject: [Mapserver-users] Query postgis layer


    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=xxx password=xxx dbname=test host=xxx"
      DATA "the_geom from (select * from mesure) as foo using unique gid using SRID=-1"
      CLASS
        NAME "gps"
        COLOR 220 0 0
        SYMBOL 'circle'
        SIZE 7
        TEMPLATE "mesure.html"
      END 
      HEADER "mesure_header.html"
      FOOTER "mesure_footer.html"
      TOLERANCE 10 
    END

    I am using     
    $my_layer = $map->getlayerbyname(ptmesure);
    $numResults = $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
[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Oups I forgot that,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I perform </FONT></DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;$map-&gt;queryByPoint($clickGeo, MS_SINGLE, 
-1);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>Christian Blumer<BR>Ecole Polytechnique Fédérale de 
Lausanne<BR>ENAC/INTER/PHOT<BR>Batiment GR<BR>1015 Lausanne, Switzerland</DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 \
2px solid; MARGIN-RIGHT: 0px">  <DIV style="FONT: 10pt arial">----- Original Message \
----- </DIV>  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=otesta@speedy.com.ar href="mailto:otesta@speedy.com.ar">Oscar 
  Testa</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A 
  title=postgis-users@postgis.refractions.net 
  href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A> \
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, June 27, 2003 4:19 PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [postgis-users] Re: 
  [Mapserver-users] Query postgis layer</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=Arial size=2>
  <DIV><FONT face=Arial size=2>Christian,</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>where do you perform de query in the mapscript script???</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&gt;I am 
  using&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></DIV>
  <DIV><FONT face=Arial size=2>&gt;$my_layer = 
  $map-&gt;getlayerbyname(ptmesure);</FONT></DIV>
  <DIV><FONT face=Arial size=2>Here you must include something like 
</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>$my_layer-&gt;queryByPoint($my_point,MS_MULTIPLE,0) </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>OR </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>
  <DIV>$my_layer-&gt;queryByRect($my_rect) </DIV></DIV>
  <DIV><FONT face=Arial size=2><BR>&gt;$numResults = 
  $my_layer-&gt;getNumResults();</FONT></DIV>
  <DIV><FONT face=Arial size=2>&gt;but the query result is always 
0.</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Regards</DIV>
  <DIV>Oscar</DIV></FONT></DIV>
  <BLOCKQUOTE dir=ltr 
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: \
#000000 2px solid; MARGIN-RIGHT: 0px">  <DIV style="FONT: 10pt arial">----- Original \
Message ----- </DIV>  <DIV 
    style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
    <A title=christian.blumer@epfl.ch 
    href="mailto:christian.blumer@epfl.ch">Christian Blumer</A> </DIV>
    <DIV style="FONT: 10pt arial"><B>Cc:</B> <A 
    title=mapserver-users@lists.gis.umn.edu 
    href="mailto:mapserver-users@lists.gis.umn.edu">mapserver-users@lists.gis.umn.edu</A> \
  </DIV>
    <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, June 27, 2003 10:10 
    AM</DIV>
    <DIV style="FONT: 10pt arial"><B>Subject:</B> [Mapserver-users] Query 
    postgis layer</DIV>
    <DIV><FONT face=Arial size=2></FONT><FONT face=Arial 
size=2></FONT><BR></DIV>
    <DIV><FONT face=Arial size=2>Hi all</FONT></DIV>
    <DIV><FONT face=Arial size=2>I would like to make a query on a layer 
    connected to postgis with PHP mapscript.</FONT></DIV>
    <DIV><FONT face=Arial size=2>The layer definition is:</FONT></DIV>
    <DIV><FONT face=Arial size=2>LAYER<BR>&nbsp; NAME ptmesure<BR>&nbsp; STATUS 
    off<BR>&nbsp; TYPE POINT<BR>&nbsp; CONNECTIONTYPE postgis<BR>&nbsp; 
    CONNECTION "user=xxx password=xxx dbname=test host=xxx"<BR>&nbsp; DATA 
    "the_geom from (select * from mesure) as foo using unique gid using 
    SRID=-1"<BR>&nbsp; CLASS<BR>&nbsp;&nbsp;&nbsp; NAME 
    "gps"<BR>&nbsp;&nbsp;&nbsp; COLOR 220 0 0<BR>&nbsp;&nbsp;&nbsp; SYMBOL 
    'circle'<BR>&nbsp;&nbsp;&nbsp; SIZE 7<BR>&nbsp;&nbsp;&nbsp; TEMPLATE 
    "mesure.html"<BR>&nbsp; END <BR>&nbsp; HEADER "mesure_header.html"<BR>&nbsp; 
    FOOTER "mesure_footer.html"<BR>&nbsp; TOLERANCE 10 <BR>END</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>I am 
    using&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></DIV>
    <DIV><FONT face=Arial size=2>$my_layer = 
    $map-&gt;getlayerbyname(ptmesure);<BR>$numResults = 
    $my_layer-&gt;getNumResults();</FONT></DIV>
    <DIV><FONT face=Arial size=2>but the query result is always 0.</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>I tested is on the same layer but in shape 
    format and it worked.</FONT></DIV>
    <DIV><FONT face=Arial size=2>What should I do to make it work properly on a 
    postgis layer?</FONT></DIV>
    <DIV><FONT face=Arial size=2>Cheers,</FONT></DIV>
    <DIV><FONT face=Arial 
size=2>Christian</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic