Opened 19 years ago

Last modified 19 years ago

#1467 new defect

[SLD] missing imagepath initializtion when creattng a symbol

Reported by: assefa Owned by: mapserverbugs
Priority: high Milestone:
Component: WMS Server Version: 4.8
Severity: normal Keywords:
Cc: mapserver@…

Description

When applyying an SLD using an external symbol, we create a new inline symbol. 
When creating this symbol in memory, the imagepath element og the symbolobj is 
not set

Change History (2)

comment:1 by assefa, 19 years ago

Update with tests I did and issues decribed more clearly :

I did reproduce the bug earlier last week but was not sure how to adress it. 
There are a couple of issues related to mapserver as well as to chameleon.

 Here is what essentially happens :

   - You open a context and apply an SLD with an external graphic
   - a temprary file representing your symbol is created in the tmp directorry 
(using the setting of the imagepath defined in the map file)
   - a reference to this symbol is written inside the map file as an inline 
symbol
   - chamelon saves a temporary map file
   - chamelon reloads the map file for drawing


  Here is what the temprorary map file looks like in reagrds to this :

  ...
   SYMBOL
    NAME "/ms4w/tmp/ms_tmp/11262924543876-1.gif"
    TYPE PIXMAP
    TRANSPARENT 0
   END


  LAYER
     ....
     NAME "Bluff_Profile"
     ...
     METATADA
      ....
      "wms_sld_body"    "auto"
      ....
     END

     CLASS
      METADATA
      END
      STYLE
        ANGLE 360
          COLOR 0 0 0
        SIZE 10
        SYMBOL "/ms4w/tmp/ms_tmp/11262924543876-1.gif"
      END
    END



  The first problem is a mapserver issue descibed in bug (1467) 
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1467 . This issue is easily 
fixable, the symbol reference in the map file needs to have the image element 
saved. So It would become something like this :

  SYMBOL
    NAME "/ms4w/tmp/ms_tmp/11262924543876-1.gif"
    TYPE PIXMAP
    IMAGE "/ms4w/tmp/ms_tmp/11262924543876-1.gif"
    TRANSPARENT 0
  END

 Correcting this eliminates the error that you will get, But It would not the 
solve your problem entirly.  So here is the 2nd issue :

  - since chemelon uses temprary map file, the way things work when an sld is 
applied (I am not sure exactly when this is set) is that there is a 
metadata "wms_sld_body" "auto" which is set on the layer. That indicates that 
the next time a redraw is done on this layer, mapserver will build an SLD on 
the fly based on the classes found in the layer and send this sld with the 
getmap request.

 The problem here is how to build the the URL for the external graphic in the 
sld (built on the fly). The logic as describe in the sld docs is to use a 
metadata called WMS_SLD_SYMBOL_URL and concatenates the name of the symbol.  
When this logic does not work (because either the metadata is not set  or the 
concatenation does not provide a valid URL), the symbol is not applied.

 I really do not know at this point how to adress so that things can work most 
of the time.

comment:2 by mapserver@…, 19 years ago

Cc: mapserver@… added
Note: See TracTickets for help on using tickets.