[Chameleon] Query widget and PostGIS data

Eric Bridger eric at gomoos.org
Thu Aug 12 09:59:08 EDT 2004


I am successfully using the Query widget with PostGIS layers.  
But in my DATA section I am explicitly requesting the columns I want to
display and the unique key to use. E.g.

  DATA "the_geom from (select cs.oid as oid, GeometryFromText('''POINT(
' || longitude || ' ' || latitude || ')''',-1) as the_geom, code as
site, med as median, cs.year as year, sampling, icon_shape from sites as
s join contaminants_silver as cs on (code = site_code)) as tmp2 using
unique oid using SRID=-1"
  FILTER "year = 1993"

You could try 
DATA "the_geom from (select the_geom, col1,col2,col3,col4 from
coast_10_polygon_4325) as tmp using unique oid using SRID=-1"

It might also have to do with specifying the unique numeric id to use
for queries.

HTH
Eric





On Thu, 2004-08-12 at 07:43, Peter L. Pulsifer wrote:
> Hi all,
> 
> I am attempting to query a layer of polygon data using chameleon 1.99 beta
> 1.  Using a shapefile as the data source I have no difficulties.  A valid
> query result is displayed.  However, when using a postgis connection to the
> same data, the query results page is empty/blank - no error messages
> (although some HTML is generated - see below).  I have also included the
> layer object listing for reference.
> 
> Any idea why the behaviour is different for the postgis connection?  
> 
> Thanks in advance for any assistance.
> 
> Peter
> 
> Peter L. Pulsifer
> Geomatics and Cartographic Research Centre
> Carleton University, Ottawa, Canada
> 
> 
> 
> Blank Postgis query result:
> 
> Shapefile Query Result:
> 
> Postgis result:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html;
> charset=iso-8859-1"></HEAD>
> <BODY></BODY></HTML>
> 
> Layer object:
>   LAYER
>     NAME "coast10_polygon"
>     STATUS ON
>     CONNECTIONTYPE postgis
>     CONNECTION "dbname=add host=127.0.0.1"
>     DATA "the_geom from coast10_polygon_4326"
> #    DATA "PAL.shp"   alternate connection to data in shapefile format
>     TYPE POLYGON
>     DUMP TRUE
>     TOLERANCE 10
>     TOLERANCEUNITS PIXELS
>     TEMPLATE "ttt_query.html"
> 
>     METADATA
>       "wms_name"  "ADD41_SCALE10"
>    	"wms_title" "ADD 4.1 Coastline Polygons (10)"
> 	"wms_srs" "EPSG:4326"
>       "wms_onlineresource"
> "http://127.0.0.1/cgi-bin/mapserv_42?map=/ms4w/apps/scar/samples/map/world_w
> ms.map&"
> 	"wms_formatlist"  "image/png,image/gif,image/jpeg,image/wbmp"
>       "wms_server_version"  "1.1.1"
> 	"wfs_title" "coast10_polygon"
>     END
>     
>     PROJECTION
> 	"init=epsg:4326"
>     END
>     
>     CLASSITEM "cst10srf"
>     CLASS
>       NAME "Ice shelf"
>       EXPRESSION "ice shelf"
>       COLOR 230 245 245
>       OUTLINECOLOR 185 185 185
>     END
>     CLASS
>       NAME "Land"
>       EXPRESSION "land"
>       COLOR 220 240 239
>       OUTLINECOLOR 205 205 205
>     END
>     CLASS
>       NAME "Ocean"
>       EXPRESSION "ocean"
>       COLOR 152 217 233
>     END
>     CLASS
>       NAME "Rumple"
>        EXPRESSION "rumple"
>       COLOR 0 174 231
>       OUTLINECOLOR 200 200 200
>     END
>     CLASS
>       NAME "Ice Tongue"
>       EXPRESSION "ice tongue"
>       COLOR 14 74 128
>       OUTLINECOLOR 155 155 155
>     END
>   END 
> 
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 




More information about the Chameleon mailing list