[Chameleon] Re: [UMN_MAPSERVER-USERS] SLD PIXMAP Error With How-To Example

Yewondwossen Assefa assefa at dmsolutions.ca
Tue Sep 13 11:27:37 EDT 2005


Jennifer,

  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.

   I hope my explantion make sense. I have keep both issues decribed in 
bug 1467.

Later,





Jennifer Zeisloft wrote:
> Hello-
> 
> I have an update for this problem with using external graphics for SLD 
> requests.
> 
> I attempted to use the SLD file at 
> http://www2.dmsolutions.ca/msapps/world_testdata/tests/sld_tests/sld_polygon_fill_symbol_external.xml
> 
> with the ms4w-Chameleon OGC sample application (which contains the 
> proper layer - WorldGen- for the SLD) and received the same error 
> messages that I've been receiving with my own application:
> 
> *Warning*: [MapServer Error]: loadSymbol(): Symbol of type PIXMAP has no 
> image data. in 
> *C:\ms4w\apps\chameleon\htdocs\common\wrapper\map_session.php* on line *215*
> 
> *Warning*: Failed to open map file 
> /ms4w/tmp/sess_43264a06bd7bc/1126582974-2202.map in 
> *C:\ms4w\apps\chameleon\htdocs\common\wrapper\map_session.php* on line *215*
> 
> *Fatal error*: Call to a member function on a non-object in 
> *C:\ms4w\apps\chameleon\htdocs\widgets\KeyMapDHTML\KeyMapDHTML.widget.php* 
> on line *150*
> 
> 
> Could this be a bug??  Could there be a problem with the way ms4w is set 
> up on our server (although we did nothing different this time...)? Is 
> there a copy of this same sample application available through the 
> MapServer website so that I could test the same application on a 
> different server (if so, I haven't been able to find it)?  This is a 
> problem I just haven't made any headway on and any suggestions would be 
> greatly appreciated!
> 
> Jennifer Zeisloft
> UW Sea Grant
> 
> 
> On 9/8/05, *Jennifer Zeisloft* <jzeisloft at gmail.com 
> <mailto:jzeisloft at gmail.com>> wrote:
> 
>     Hi-
> 
>     I have created a temporary directory with all of the associated
>     files: the context file, the sld file, the temp map file, the temp
>     image file, and the wms map file.
>     https://mywebspace.wisc.edu/jrzeisloft/web/temp/ 
> 
>     I don't know that you'll need all of those, but I'm not really sure
>     where the problem is.  Other (non-external) SLDs can be applied
>     without a problem. 
> 
>     The application I am working on is located at
>     http://maps.aqua.wisc.edu/lscmp/viewmaps.phtml.  The context I was
>     using to test the external graphic SLD is the Bluff Stability
>     context.  The layer I was using is the Bluff Profiles layer.  The
>     SLD I was trying to open is at 
>     https://mywebspace.wisc.edu/jrzeisloft/web/temp/sld_symbol_external.xml
>     <https://mywebspace.wisc.edu/jrzeisloft/web/temp/sld_symbol_external.xml>.
> 
>     I can't think of any other information to offer: I simply go to the
>     application, open the bluff stability context, select the bluff
>     profile layer (though I am not sure this is necessary), click the
>     Open SLD tool button, and browse to the SLD file.  Then the error
>     occurs. 
> 
>     Thanks for your help!
> 
>     Jennifer Zeisloft
> 
> 
>     On 9/8/05, *Yewondwossen Assefa* < assefa at dmsolutions.ca
>     <mailto:assefa at dmsolutions.ca>> wrote:
> 
>         Not sure what the initial error is but you could check the map file
>         1126209374-4254.map and see if the inline symbols created
>         reference an
>         existing png or gif file.
> 
>         I would also be nice if you could provide a quick was (+ all
>         realted
>         files) to reproduce this bug. At this point I am not sure how to
>         reproduce it.
> 
>         Later,
> 
>         Jennifer Zeisloft wrote:
>>  Hello All-
>>
>>  I am starting to play with SLD and am attempting to use an
>         external
>>  graphic to symbolize a point.  I first tried it with my own
>         external
>>  graphic, but got the error message:
>>
>>  *Warning*: [MapServer Error]: loadSymbol(): Symbol of type
>         PIXMAP has no
>>  image data. in
>>  *C:\ms4w\apps\chameleon\htdocs\common\wrapper\map_session.php*
>         on line *215*
>>
>>  *Warning*: Failed to open map file
>>  /ms4w/tmp/sess_4320970788d61/1126209374-4254.map in
>>  *C:\ms4w\apps\chameleon\htdocs\common\wrapper\map_session.php*
>         on line *215*
>>
>>  *Fatal error*: Call to a member function on a non-object in
>>
>         *C:\ms4w\apps\chameleon\htdocs\widgets\KeyMapDHTML\KeyMapDHTML.widget.php*
>>  on line *150*
>>
>>
>>  I then tried it with the sld_symbols_external.xml file from
>         the SLD
>>  How-To document (I changed the layer name, of course) and
>         received the
>>  same error.  I also tried using PNG instead of GIF - same
>         error.  Can
>>  anyone offer a hint?  Thanks in advance for your help!
>>
>>  Jennifer Zeisloft
>>  UW Sea Grant
> 
>         --
>         ----------------------------------------------------------------
>         Assefa Yewondwossen
>         Software Analyst
> 
>         Email: assefa at dmsolutions.ca <mailto:assefa at dmsolutions.ca>
>         http://www.dmsolutions.ca/
> 
>         Phone: (613) 565-5056 (ext 14)
>         Fax:   (613) 565-0925
>         ----------------------------------------------------------------
> 
> 
> 

-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the Chameleon mailing list