[Mapserver-users] filter, mapscript

Eric Bridger eric at gomoos.org
Wed Feb 26 03:26:10 EST 2003


Just taking a guess, but I think you need to have a TEMPLATE defined in
the layer for it to be queryable. Even though you don't need the
template. Try adding:
LAYER
  TEMPLATE "none.html"

Eric


On Wed, 2003-02-26 at 10:36, Sven Jacobi wrote:
> Hi list,
> 
> I'm trying to make a query by attributes, but somehow it doesn't work...
> I'm using MS 3.6.1 and Python Mapscript.
> Below are the pieces of code responsible for the errors...
> 
> Any ideas what I'm doing wrong?
> 
> Thanks in forward,
> 
> Sven
> 
> ---------------------------------------------------
> ...
> testlayer = mymap.getLayerByName("Bestandstandorte")
>  testlayer.status=MS_ON
>  #testlayer.filteritem = 'H_BAUMART'
>  testlayer.setfilter('Fi')
>  rv = testlayer.queryByAttributes(mymap, 1)
> ...
> 
> -----------------------------------------------------
> ...
> LAYER
>   NAME "Bestandstandorte"
>   DATA Bestandstandorte
>   #EXPRESSION (`Ortsgrenze`)
>   STATUS OFF
>   TYPE POLYGON
> 
>   FILTERITEM "H_BAUMART"
>   FILTER 'Fi'
> 
>   CLASSITEM "H_BAUMART"
>   CLASS    
>     NAME Fichte
>     EXPRESSION 'FI'
> ...
> 
> ----------------------------------------------------
> File "/home/jacobi/Funkland/Zope-2.5.1b2-src/Extensions/querytest.py", line 
> 105, in drawmap
>     testlayer.setfilter('FI')
>   File "/home/jacobi/Funkland/site-packages/MapScript.py", line 1901, in 
> __getattr__
>     raise AttributeError,name
> AttributeError: setfilter
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 





More information about the mapserver-users mailing list