FILTER working on PostGIS layers?
Paul Ramsey
pramsey at REFRACTIONS.NET
Tue Sep 13 07:24:51 PDT 2005
If you drop your FILTERITEM and use just FILTER "identbv = 20050049"
that will work...
On 13-Sep-05, at 6:45 AM, Bart van den Eijnden wrote:
> Follow-up on this.
>
> It seems that layer->filter.string only contains the FILTER value
> and not the whole expression to be used in the where clause.
>
> sprintf(query_string_0_6, "DECLARE mycursor BINARY CURSOR FOR
> SELECT %s from %s WHERE (%s) and (%s && setSRID( %s,%s) )",
> columns_wanted, data_source, layer->filter.string, geom_column,
> box3d, user_srid);
>
> Does this sound familiar to anyone?
>
> Best regards,
> Bart
>
>
> Bart van den Eijnden
> Syncera IT Solutions
> Postbus 270
> 2600 AG DELFT
>
> tel.nr.: 015-7512436
> email: BEN at Syncera-ITSolutions.nl
>
>
>>>> Bart van den Eijnden <BEN at SYNCERA-ITSOLUTIONS.NL> 13-9-2005
>>>> 13:26:44 >>>
>>>>
> Hi list,
>
> I am running into an issue using Mapscript 4.7 from a few weeks back.
>
> PostGIS layers work fine for map display and query, but as soon as
> I try to highlight a feature using FILTERITEM and FILTER I get the
> following error (so it seems the filteritem is not used when
> building the WHERE clause, the column exists in the database and
> has the right case):
>
> [13-Sep-2005 13:06:43] PHP Warning: [MapServer Error]:
> prepare_database(): Error executing POSTGIS DECLARE (the actual
> query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
> identbv::text,asbinary(force_collection(force_2d
> (the_geom)),'NDR'),OID::text from bouwvergunning.aanvraag WHERE
> (20050049) and (the_geom && setSRID( 'BOX3D(114024.650480941
> 503134.482620259,115117.267932596
> 503806.862590517)'::BOX3D,find_srid
> ('','bouwvergunning.aanvraag','the_geom') ))' <br><br>
>
> Postgresql reports the error as 'ERROR: argument of AND must be
> type boolean, not type integer ........
>
> This is my LAYER definition:
>
> LAYER
> NAME "bimas"
> METADATA
> wms_title "Bouwvergunningen"
> END
> STATUS OFF
> DEBUG ON
> FILTERITEM "identbv"
> FILTER "20050049"
> TYPE POINT
> CONNECTION "user=stragisweb password=synstragisweb
> dbname=wormerland host=127.0.0.1"
> CONNECTIONTYPE postgis
> DATA "the_geom from bouwvergunning.aanvraag USING UNIQUE identbv"
> PROJECTION
> "init=epsg:28992"
> END
> MINSCALE 0
> MAXSCALE 10000
> CLASS
> NAME bouwlocaties
> STYLE
> COLOR 255 0 0
> SIZE 12
> SYMBOL "Bouwlocaties"
> END
> END
> TEMPLATE "blank.html"
> END
>
> Thanks in advance. Is this fixed in CVS?
>
> Best regards,
> Bart
>
> Bart van den Eijnden
> Syncera IT Solutions
> Postbus 270
> 2600 AG DELFT
>
> tel.nr.: 015-7512436
> email: BEN at Syncera-ITSolutions.nl
>
More information about the MapServer-users
mailing list