I'm trying to create a WMS map, that allows the clients to filter by attribute 
values.

I have a shapefile called "Service_Areas", each feature of which has a "DCCode" 
attribute.

I've also imported the shapefile into a "service_areas" table in a PostGIS 
database, each record of which has a "dccode" field.  (The import process seems 
to convert to lower case.)

I have created a store for each, and defined a layer and a style for each.  
(The styles differ only in the case of the <ogc:PropertyName>.)

I've constructed a URL that returns a PNG file containing a number of areas, 
including the one I am interested in.

http://...:8085/geoserver/ows?
service=wms&
FORMAT=image%2Fpng&
LAYERS=service_areas&
VERSION=1.1.1&
REQUEST=GetMap&
SRS=EPSG%3A4326&
BBOX=-93.00,44.95,-92.99,44.96&
WIDTH=400&
HEIGHT=400

By changing the LAYERS value, I can switch back and forth between the shapefile 
and the PostGIS table, and both work fine.

Now I want to add a filter that will display only the area named "AREA1", so I 
append what would seem to be the simplest cql_filter expression possible.

For the shapefile: &cql_filter=DCCode=AREA1
For the PostGIS table: &cql_filter=dccode=AREA1

When I do this for the shapefile, I get back exactly the same image I did 
before, containing all of the same areas as when I didn't have the filter.

When I do this for the PostGIS table, I get an error message:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE 
ServiceExceptionReport SYSTEM 
"http://www.korterraweb.com:8085/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd";>
 <ServiceExceptionReport version="1.1.1" >   <ServiceException code="Internal 
error ">
      org.vfny.geoserver.wms.WmsException: Rendering process failed
Rendering process failed
Exception rendering layer FeatureCollectionMapLayer[ service_areas, VISIBLE, 
UNSELECTED, style=StyleImpl[ name=Service Areas], 
data=org.vfny.geoserver.global.GeoServerFeatureLocking@3e026f43, query=Query:
   feature type: service_areas
   filter: [Filter.INCLUDE AND [ dccode = AREA1 ]]
   [properties:  ALL ]]
Property &apos;AREA1&apos; could not be found in service_areas
</ServiceException></ServiceExceptionReport>

The following query does find the record, run in the PostGIS query tool:

                SELECT *
                FROM gis_schema.service_areas
                WHERE dccode = 'AREA1'
                ;

So it's not data, my guess it's syntax.  But I have no idea what I'm getting 
wrong.

I've tried quoting the value: &cql_filter=dccode=%22AREA1%22

But that gives me a different error:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE 
ServiceExceptionReport SYSTEM 
"http://www.korterraweb.com:8085/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd";>
 <ServiceExceptionReport version="1.1.1" >   <ServiceException>
      Could not parse CQL filter list.
Lexical error at line 1, column 21.  Encountered: &quot;\&quot;&quot; (34), 
after : &quot;&quot;. Parsing : gis_schema.dccode = &quot;AREA1&quot;. Current 
Token : &quot;null&quot;
</ServiceException></ServiceExceptionReport>

Any ideas?


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to