[mapserver-dev] Bug MS4W 6.0.3 SLD & FILTER (ogc:PropertyIsEqualTo)

sverre Sverre.Iversen at NGU.NO
Mon Jun 25 00:18:30 PDT 2012


Hello - Bug MS4W 6.0.3 SLD & FILTER (ogc:PropertyIsEqualTo) produces a
malformed temp-map-file.

I found a bug in version 6.0.3 (MS4W) which gives an ”msSDELayerNextShape():
SDE error. SE_stream_fetch(): Underlying DBMS error. (-51)”

Examples:
1) 
sld_filter_literal_string1.xml –generates a temp-map-file (see
GeokjemiWMS_sld_filter_literal_string1.map):
LAYER
  …
    FILTER (( ("datasetnr"= 179000.14) ))#Sverre Iversen - NGU: Original -
error!
    #FILTER (( (datasetnr= '179000.14') ))#Sverre Iversen - NGU: Alt1 -
works!     
    #FILTER "where datasetnr='179000.14'"#Sverre Iversen - NGU: Alt2 -
works!

2) 
sld_filter_literal_string2.xml – generates a temp -map-file (see
GeokjemiWMS_sld_filter_literal_string2.map):
LAYER
  …
   FILTER (( ("medium"= 'Sediment') ))#Sverre Iversen - NGU:  Original -
error!
    #FILTER (( (medium= 'Sediment') ))#Sverre Iversen - NGU:  Alt1 - works!
    #FILTER "where medium='Sediment'"#Sverre Iversen - NGU: Alt2 - works!

Comments: 
1)
Error:                   FILTER  (( ("<field>"=<value>) ))
Solution:              FILTER  (( (<field>=<value>) ))

2)
FILTER-def in LAYER is new in MapServer 6+ with mapping from SLD. Earlier
the filtering was placed only as EXPRESSION in the CLASS-section.  I see
that the text value from example 1 (’179000.14’) will be considered as a
number in any case in MapServer and will fail in the filter against the data
base in such a way that the value is missing quotes (’). Solution for
numbers that are supposed to be text: add a text prefix – for example 
’D179000.14’ in value in the database?


BR -  Sverre Iversen

http://osgeo-org.1560.n6.nabble.com/file/n4983498/GeokjemiWMS_original_example.map
GeokjemiWMS_original_example.map 
http://osgeo-org.1560.n6.nabble.com/file/n4983498/GeokjemiWMS_sld_filter_literal_string1.map
GeokjemiWMS_sld_filter_literal_string1.map 
http://osgeo-org.1560.n6.nabble.com/file/n4983498/GeokjemiWMS_sld_filter_literal_string2.map
GeokjemiWMS_sld_filter_literal_string2.map 
http://osgeo-org.1560.n6.nabble.com/file/n4983498/sld_filter_literal_string1.xml
sld_filter_literal_string1.xml 
http://osgeo-org.1560.n6.nabble.com/file/n4983498/sld_filter_literal_string2.xml
sld_filter_literal_string2.xml 


--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Bug-MS4W-6-0-3-SLD-FILTER-ogc-PropertyIsEqualTo-tp4983498.html
Sent from the Mapserver - Dev mailing list archive at Nabble.com.


More information about the mapserver-dev mailing list