MapScript SetSymbolSet

Sean Gillies sgillies at FRII.COM
Wed Feb 15 20:12:41 EST 2006


Chris,

Submit a new bug report to the MapServer Bugzilla under the C library  
component. Looks like msSaveMap may need to be updated.

Sean

On Feb 15, 2006, at 5:45 PM, Christopher Condit wrote:

> Argh - the map instance keeps this and works fine, but refuses to  
> write
> it out to the map file:
>
> symbolObj circle =3D new symbolObj("circle", null);
> circle.type =3D (int)MS_SYMBOL_TYPE.MS_SYMBOL_ELLIPSE;
> circle.filled =3D mapscript.MS_TRUE;
> lineObj line =3D new lineObj();
> line.add(new pointObj(1, 1, 0, 0));
> circle.sizex =3D 1;
> circle.sizey =3D 1;			=09
> map.symbolset.appendSymbol(circle);
>
> later I use:
>
> sty.symbol =3D map.symbolset.index("circle");=09
>
> which works fine - sets the index properly.  No symbols get written to
> the mapfile, however.  Is there something special I need to do to get
> the symbols to write out?
>
> Thanks,
>
> Chris
>
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER- 
> USERS at LISTS.UMN.EDU] On
> Behalf Of Sean Gillies
> Sent: Wednesday, February 15, 2006 4:16 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] MapScript SetSymbolSet
>
> Oh, I see. Yeah, it's possible. Here's an example from one of my =20
> Python projects:
>
>      circle =3D mapscript.symbolObj('circle')
>      circle.type =3D mapscript.MS_SYMBOL_ELLIPSE
>      circle.filled =3D mapscript.MS_TRUE
>      line =3D mapscript.lineObj()
>      line.add(mapscript.pointObj(1,1))
>      circle.setPoints(line)
>      circle.sizex =3D 1
>      circle.sizey =3D 1
>      mo.symbolset.appendSymbol(circle)
>
> The "mo" name is bound to a mapObj. It's very important to get  
> sizex =20
> and sizey right, should be the width and height of the symbol in  
> the =20
> same units as the point and line coordinates used to construct the =20
> symbol.
>
> To use this symbol
>
>      style.symbol =3D mo.symbolset.index('circle')
>
> Translate this into C# and you should be good to go.
>
> cheers,
> Sean
>
> On Feb 15, 2006, at 5:03 PM, Christopher Condit wrote:
>
>> Hi Sean-
>> Is there a way to accomplish this with MapScript?  All I see is a =20
>> way to
>> set the symbolset.
>>
>> Thanks,
>>
>> Chris
>>
>> -----Original Message-----
>> From: UMN MapServer Users List [mailto:MAPSERVER-=20
>> USERS at LISTS.UMN.EDU] On
>> Behalf Of Sean Gillies
>> Sent: Wednesday, February 15, 2006 3:58 PM
>> To: MAPSERVER-USERS at LISTS.UMN.EDU
>> Subject: Re: [UMN_MAPSERVER-USERS] MapScript SetSymbolSet
>>
>> On Feb 15, 2006, at 3:19 PM, Christopher Condit wrote:
>>
>>> Hi Julien-
>>> Thanks for your response.  Here are the contents of the symbol file:
>>> SYMBOLSET
>>>   SYMBOL
>>>     NAME 'circle'
>>>     TYPE ELLIPSE
>>>     POINTS 1 1 END
>>>     FILLED TRUE
>>>   END
>>> END
>>>
>>> The problem I'm having is intermittent and I can't reliably  
>>> reproduce
>>> it.  My only thought was that for some reason mapscript couldn't  
>>> read
>>> the file.  Is there any way to embed these symbols directly in the
>>> mapfile instead of referencing the symbolset file?
>>>
>>> Thanks,
>>>
>>> Chris
>>
>> Yes, just add any SYMBOL block as a child of the top-level map.
>>
>> Sean
>>
>

---
Sean Gillies
sgillies at frii dot com
http://zcologia.com/news



More information about the mapserver-users mailing list