[mapserver-dev] Correct usage of SWIG-MapScript-SYMBOL generation

Stephan Holl stephan.holl at intevation.de
Thu May 26 11:40:32 EDT 2011


Hello devs,

Stephan Holl <stephan.holl at intevation.de>, [20110520 - 15:11:19]

> Hello Mapserver-devs,
> 
> we try to add symbols to a SYMBOLSET with Java (1.6.2 on Windows)
> MapScript dynamically (with MS 6.0.0-rc2 with MS4W) with this code:
> -------------------
> import java.io.IOException;
> import java.io.File;
> 
> import edu.umn.gis.mapscript.mapObj;
> import edu.umn.gis.mapscript.layerObj;
> import edu.umn.gis.mapscript.classObj;
> import edu.umn.gis.mapscript.styleObj;
> import edu.umn.gis.mapscript.symbolObj;
> import edu.umn.gis.mapscript.symbolSetObj;
> import edu.umn.gis.mapscript.MS_SYMBOL_TYPE;
> 
> public class CharTest {
> 
>     /**
>      * Entrypoint for the application.
>      */
>     public static void main(String[] args) {
>        mapObj map = new mapObj("template.map");
>        layerObj layer = new layerObj(map);
>        classObj co = new classObj(layer);
> 
>        symbolSetObj symbolSet = map.getSymbolset();
>        symbolObj symbol = symbolSet.getSymbolByName("testname");
>        symbol.setType(MS_SYMBOL_TYPE.MS_SYMBOL_TRUETYPE.swigValue());
>        symbol.setFont("Arial-alike");
>        symbol.setAntialias(1);
>        // see
>        //
>        http://mapserver.org/mapfile/symbology/construction.html#symbols-of-type-truetype
>        symbol.setCharacter("&#61496;");
> 
>        symbolSet.save("symbols.sym");
>     }
> }
> -------------------

The above code works fine on linux using java mapscript from
mapserver_trunk.

On Windows with 6.0 in ms4w it does not work.

Does anybody have the option to test this on windows with current trunk
(r11758) (I am unable to compile on WIndows though)? This would be nice
to get nearer to the source of the problem.

> 
> The resulting symbol is
>   SYMBOL
>     NAME "testname"
>     TYPE TRUETYPE
>   END
> 
> There is no error raising up with the above program, but the result
> seems odd. At least FONT and CHARACTER-keywords should be set within
> the exported symbolset.
> 
> 
> Does anybody can give some advice how to use the
> SWIG-based MapScript-API to construct symbolsets correctly.

TIA

Best regards 

	Stephan

-- 
Stephan Holl <stephan.holl at intevation.de> | Tel.: +49 (0)541-33 508 3663
Intevation GmbH, Neuer Graben 17, 49074 OS  |  AG Osnabrück - HR B 18998
Geschäftsführer:  Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20110526/a6e1adea/signature.bin


More information about the mapserver-dev mailing list