[Mapserver-users] Classes based on Postgis && function

Jan Hartmann jhart at frw.uva.nl
Fri Feb 21 11:08:32 EST 2003


I don't see it: the parentheses don't match up, and "using UNIQUE" 
stands somewhere in the middle, before the "WHERE" clause (the PostGIS 
error messages really got better, didn't they). Could you please post

1) the SQL statement that worked when you put it to PSQL
2) the exact DATA statement in you Mapfile or PHP script

Jan


Benjamin Wragg wrote:
> I've tried the code on another machine, which has the 3.6.4 release and 
> I get a slightly better error:
>        
> Warning: MapServer Error in prep_DB(): Error executing POSTGIS DECLARE 
> (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT 
> sbinary(force_collection(force_2d(the_geom from(select sheet.the_geom as 
> the_geom, userpolygon.the_geom as polygeom, sheet.oid, case when 
> sheet.seriesid=1 and distance(sheet.the_geom, userpolygon.the_geom)=0 
> then 1 end as myclass)),'NDR'),OID::text from sheet,userpolygon where 
> sheet.the_geom && userpolygon.the_geom and sheet.seriesid=1 and 
> userpolygon.id=2) as foo using UNIQUE=sheet.oid WHERE the_geom 
> from(select sheet.the_geom as the_geom, userpolygon.the_geom as 
> polygeom, sheet.oid, case when sheet.seriesid=1 and 
> distance(sheet.the_geom,userpolygon.the_geom)=0 then 1 end as myclass && 
> setSRID('BOX3D(-180 -135,180 135)'::BOX3D, -1 )'
> 
> Postgresql reports the error 'ERROR: parser: parse error at or near "from" '
> 
> More Help:
> 
> Error with POSTGIS data variable. You specified '<check your .map file>'.
> Standard ways of specifiying are :
> 
> The 'from' part is the same error that the database gives back. I copied 
> the above sql and ran in over the database and it seems to 
> be complaining about the first 'from'.
> 
> Any suggestions?
> 
> Thanks,
> 
> Benjamin
> 




More information about the mapserver-users mailing list