WMS/WFS using PHP MapScript

Hester Jane Viola H.Viola at BOM.GOV.AU
Mon Dec 6 16:28:46 PST 2004


Hi,

We have developed an internal web mapping tool within the Australian Bureau
of Meteorology using standard CGI MapServer to view weather data.
Our newest undertaking though is using PHP Mapscript to provide climate data
(stored in PostgreSQL/PostGIS) to a Water Portal via a WFS, based on a
dynamic request sent by that portal.
The request sent by the portal, is used to generate a layer in a PHP
mapscript file, by adding the data via an SQL query, (there are no layers
defined in the map file in use) ie.

section of the php file:
  ...
$rain_layer->set("connectiontype",MS_POSTGIS);
$rain_layer->set("connection","$rain_connection");
$rain_query="the_geom from (SELECT g_stations.the_geom as the_geom,
                       onedrain.prcp as prcp,
                             g_stations.name as name,
                             g_stations.oid as oid
                       FROM g_stations, onedrain
                           $date_part
                             $loc_part
                           AND onedrain.stn_num = g_stations.stn_num)
                           as foo USING UNIQUE oid USING SRID=-1";

$rain_layer->set("data","$rain_query");
  ...
where $date_part and $loc_part include the input arguments sent in the
portal request.

Now that I have explained the set up, I would like to know how to implement
a WFS to this dynamically created rain_layer. I have experimented with using
$rain_layer->executeWFSGetfeature() but this only returns an empty string.
I am also interested in how a WMS is enabled using PHP mapscript, if the
layers are not defined in the .map file.

I hope that someone can provide some information.

Thank you in anticipation.


--
Regards
Hester VIOLA

IT Officer,  Data Management
Australian Bureau of Meteorology
700 Collins St, Melbourne, 3008
Email. h.viola at bom.gov.au



More information about the MapServer-users mailing list