[postgis-users] Re: [Mapserver-users] Query postgis layer

Oscar Testa otesta@speedy.com.ar
Fri Jun 27 15:19:22 2003


This is a multi-part message in MIME format.

---------------------- multipart/alternative attachment
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

---------------------- multipart/alternative attachment
An HTML attachment was scrubbed...
URL: http://offsite.refractions.net/pipermail/postgis-users/attachments/20030627/6b10e4cb/attachment.htm

---------------------- multipart/alternative attachment--