Postgis and EXPRESSION

Paul Ramsey pramsey at REFRACTIONS.NET
Wed Feb 22 10:27:34 EST 2006


I think the problem is that you have both a CLASSITEM and an  
EXPRESSION.  CLASSITEM is generally used when you are doing single- 
value classifications, so something like

CLASSITEM 'name'
CLASS
   EXPRESSION 'Europe'
END

Try removing your CLASSITEM.  Just general debugging technique:  
remove restrictions until something shows up, then slowly add them  
back in again.

BTW, If you have a unique column other than oid, I would suggest  
using that for a unique number, as good practice.  Perhaps you have a  
gid column?

P

On 22-Feb-06, at 5:55 AM, Stefan Schwarzer wrote:

> Hi,
>
> I migrated from mysql to postgres/postgis and update now all my map- 
> queries. But I have a problem getting it working. I wonder if this  
> is a major problem or some minor issue. The doc says :
>
> "Logical expressions allow you to build fairly complex tests based  
> on one or more attributes and therefore are only available with  
> shapefiles"
>
> So, i would almost presume that using EXPRESSIONS is not possible  
> via postgis. But I can't imagine that this is true... In the moment  
> it runs the query but with no result - meaning that it "ignores"  
> the epression. I couldn't find anything similar in the archives  
> either...
>
>
> 	LAYER
> 		NAME bg_shape
> 		CONNECTIONTYPE postgis
> 		CONNECTION 'user=xxx password=xxx dbname=xxx' 			
> 		TYPE POLYGON
> 		DATA 'the_geom FROM (SELECT countries.the_geom AS the_geom,  
> regions_view.name AS name, countries.oid AS oid FROM countries,  
> regions_view WHERE countries.geo_region = regions_view.id) AS foo  
> USING UNIQUE oid USING srid=-1'
> 		CLASSITEM 'name'
> 		CLASS
> 			NAME ''
> 			EXPRESSION ([name] ne 'Africa')
> 			OUTLINECOLOR 230 230 230
> 			COLOR 230 230 230
> 		END
> 	END  # LAYER
>
>
> Thanks for any help!
>
> Stef
>



More information about the mapserver-users mailing list