[mapserver-users] How to query the non geometry data in POSTGIS?

Brent Fraser bfraser at geoanalytic.com
Wed Oct 23 13:23:18 EDT 2002


It depends on your requirement.

1.  If you want to allow end-user queries of non-geometric tables stored in
POSTGIS (which means they're just plain old PostgreSQL tables), then
MapServer or MapScript can't do it (at least not that I know of).  Use
server-side scripting such as Perl, PHP, etc.


2.  If you want to simply put a restriction on the geometric data returned
based on attibute values, add a where-clause to the layer's DATA definition
in the map file.  This can get fairly sophisticated in MapServer 3.7 as you
can use sub-SELECT statements to perform joins between the geometric table
and other non-geometric tables.  Here's a snippet from David Blasby's
message of Sept 30:

    DATA "the_geom from (SELECT the_geom, nut3.nurgcd as nurgcd, un3rt.unit
as
    unit,gid  FROM nut3) as foo using unique gid using SRID=6543"


3. If you want to allow end-user queries of geometric tables based on
attribute values, I think the answer is MapScript.  I would like to find out
how to do it using just the CGI interface, but I think it is beyond
MapServer's capabilies.

  How about enhancing MapServer to allow the passing of a where-clause for a
layer via http?

Brent Fraser

----- Original Message -----
From: <yeong888 at giga.net.tw>
To: <mapserver-users at lists.gis.umn.edu>
Sent: Wednesday, October 23, 2002 7:26 AM
Subject: [mapserver-users] How to query the non geometry data in POSTGIS?


> Dear all:
>   I am sorry to bother everyone. I have been tried the MapServer+PostGIS
> many times, but I can't find the soultion to resolve question following:
> How to query the non geometry data in PostGIS+PostgreSQL?
> Is there anyone can tell how to handle this problem?
>
>                       Thank you
>




More information about the mapserver-users mailing list