Getting shape values from a PostGIS layer

Mathieu Parent mathieuparent at INFONIE.FR
Fri Sep 3 04:49:24 EDT 2004


Hi,
How can I get values when I make a query in PHP/MapScript on a PostGIS
layer ?

Examples :
_layer's properties :_
    CONNECTION "user=user password=pass dbname=postgis host=localhost
port=5432"
    CONNECTIONTYPE POSTGIS
    DATA "the_geom from adres"

_part of the script :_
          if(($num_results=$layer->getNumResults())>0) {
            $layer->open();
            for($j=0;$j<$num_results;$j++) {
              $result=$layer->getResult($j);

$shape=$layer->getShape($result->tileindex,$result->shapeindex);
              foreach($shape->values AS $field=>$value) {
                echo "$field=>$value<br>\n";
              }
            }
            $layer->close();

thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20040903/a4d83670/attachment.html


More information about the mapserver-users mailing list