[mapserver-users] PostGIS function calls in query template?

Paul Ramsey pramsey at refractions.net
Thu Aug 30 15:22:26 EDT 2001


Hi Michael,
The short answer, is 'no' you cannot do this. When mapserver is pulling
attributes from the database, it is checking the system tables to find
the attribute names, then pulling just those values. It might be
possible to make some changes to the postgis access code to allow users
to specify additional attributes as 'x(geometry) as xcoord' additions to
the SQL statement. 
A more expedient workaround is to use PHP/Mapscript as your programming
base, get the geometry ID's from a given query and then use the direct
PHP->pgsql connection to do whatever additional queries you want to do.
Probably less hacky in the long run.
Paul

Michael Scharber wrote:
> 
> How can I use a derived field in a Mapserver query template .html file?
> I mean, can I wrap an attribute from a relation with a PostGIS geometry
> field (used as a layer in Mapserver) with a function call?
> 
> ex. [x(shape)] to present the user with the x (Longitude in my case) of a
> tuples' shape (geometry) attribute.
> 
> TIA
> 
> Michael Scharber
> 
> --
> *******************************************************
>         Michael Scharber
>         Scripps Institution of Oceanography
>         Institute of Geophysics and Planetary Physics
>         8785 Biological Grade
>         IGPP Room 4212
>         La Jolla, CA 92037
> 
>         mscharber at josh.ucsd.edu
>         (858)534-1750
> *******************************************************



More information about the mapserver-users mailing list