[Mapserver-users] N/A

Vincent Schut schut at sarvision.com
Tue Mar 18 00:29:51 PST 2003


Angelo,

just a quick guess: the error is in the SQL statement... Could it be that 
(fid_tipo_via) is an integer column in your database? This is what the 
postgres error suggests. You should probably either use a boolean datatype 
after the WHERE clause, or combine your integer data with some criterium to 
create a boolean result (like 'WHERE fid_tipo_via > 23' or some other 
comparison).

Regards,
Vincent Schut.

On Tuesday 18 March 2003 02:39, Angelo CM wrote:
> Hi, i'm getting the following error when try to
> edit through php the filter
> of the layer:
>
> " Warning: MapServer Error in prep_DB(): Error
> executing POSTGIS DECLARE
> (the actual query) statement: 'DECLARE mycursor
> BINARY CURSOR FOR SELECT
> nombre_via::text,asbinary(force_collection
> (force_2d(the_geom)),'NDR')
> OID::text from vias WHERE (fid_tipo_via) and
> (the_geom && setSRID(
> BOX3D(-71.67189575 -33.078516666667,-
> 71.572328225 -33.004)'::BOX3D
> find_srid('','vias','the_geom') ))'
>
> Postgresql reports the error 'ERROR: left-hand
> side of AND is type 'integer'
> not 'boolean' ' "
>
> This is the Layer:
>
> LAYER
> CONNECTIONTYPE postgis
> NAME "ejes_calles"
> CONNECTION "user=postgres password=abc123
> dbname=cultursig
> host=localhost"
> STATUS ON
> DATA "the_geom from vias"
> TYPE LINE
> UNITS DD
> SIZEUNITS DD
> LABELITEM nombre_via
> LABELCACHE ON
> TOLERANCE 3
> TOLERANCEUNITS PIXELS
> CLASS
> NAME "ejes_calles"
> SYMBOL 0
> COLOR 255 108 83
> SIZE 1
> MINSIZE 1
> MAXSIZE 100
> LABEL
> SIZE SMALL
> COLOR 0 0 0
> ANGLE AUTO
> POSITION AUTO
> END
> END
> END
>
> And this is the code in PHP:
> $id_tipo=$myrow[2];
> $map = ms_newMapObj("../mapas/valpo.map");
> $capa = $map->getlayerbyname("ejes_calles");
> $capa->setfilter("\"fid_tipo_via\" =
> \"$id_tipo\"");
> $image = $map->draw();
> $image_url = $image->saveWebImage(MS_PNG,1,1,0);
>
>
> Where is the error? I'm using the latest stable
> versions of PHP, PostgreSQL
> Mapserver and Postgis.
> Thanks

-- 
______________________________________
Vincent Schut (schut at sarvision.com)
Sarvision B.V.
Wageningen, The Netherlands
www.sarvision.com



More information about the MapServer-users mailing list