[mapserver-users] map_layer_filter

Lowther, David W dlowther at ou.edu
Tue Oct 29 06:29:54 PST 2002


Bjarni,

I'm not sure how to do this with a more complex filter like:

"pnum in ('3400-00-001-001-0-001-00','3400-00-001-001-0-002-00')"

What would you set the value of map_layername_filter to for the above
filter?

It seems from some further investigation that there are several characters
that will cause the filter to be truncated ',(,_ 
Are there others? 
Is there any way around this?

Thanks for your help,

Dave

-----Original Message-----
From: Bjarni Pjetursson [mailto:Bjarni.Pjetursson at tietoenator.com]
Sent: Tuesday, October 29, 2002 3:34 AM
To: 'Lowther, David W'
Cc: mapserver-users at lists.gis.umn.edu
Subject: SV: [mapserver-users] map_layer_filter


Try quoting your field with both single-plings and double-plings like this
<input type="text" name="map_layername_filtername" value='"conditions"'>
Regards
Bjarni Thor Pjetursson

> -----Oprindelig meddelelse-----
> Fra:	Lowther, David W [SMTP:dlowther at ou.edu]
> Sendt:	28. oktober 2002 21:56
> Til:	Mapserver-Users (E-mail)
> Emne:	[mapserver-users] map_layer_filter
> 
> Howdy List,
> 
> I'm trying to pass in a setting for map_layer_filter from a form. It looks
> something like this:
> 
> <form method="post" action="http://domain/cgi-bin/mapserv.exe" target=map
> name="Master">
> 	<input type=hidden name="map" value="something.map">
> 	<input type=hidden name="map_sqlParcel_filter" value="pnum in
> ('3400-00-001-001-0-001-00','3400-00-001-001-0-002-00')">
> 	<input type=hidden name=layers value="cnty_poly sqlParcel">
> </form>
> 
> The layer comes from PostGIS and everything works fine when set the filter
> in the mapfile. I get an error that looks like this:
> 
> msPOSTGISLayerWhichShapes(): Query error. prep_DB:Error executing POSTGIS
> DECLARE statement (0.6 failed - retried 0.5 and it failed too). DECLARE
> mycursor BINARY CURSOR FOR SELECT
> asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from
> (select
> oid,* from a047parcel) as foo WHERE (pnum in ) and (the_geom && setSRID(
> 'BOX3D(-98.1769012540527 36.1434604724575,-97.4028596973514
> 36.6100900285963)'::BOX3D,find_srid('','a047parcel','the_geom') )) 
> 
> My best guess is that this has something to do with the quotation marks
> coming from the form. Does anybody have any ideas on this one?
> 
> Thanks for your help.
> 
> David Lowther



More information about the MapServer-users mailing list