Hi folks,

 

>From the geotools user guide Styling features for display
<https://docs.geotools.org/latest/userguide/library/render/style.html> -
GeoTools 27-SNAPSHOT User Guide example:

 

        //

        // create the graphical mark used to represent a city

        Stroke stroke = sf.stroke(ff.literal("#000000"), null, null, null,
null, null, null);

        Fill fill = sf.fill(null, ff.literal(Color.BLUE), ff.literal(1.0));

 

        // OnLineResource implemented by gt-metadata - so no factory!

        OnLineResourceImpl svg = new OnLineResourceImpl(new
URI("file:city.svg"));

        svg.freeze(); // freeze to prevent modification at runtime

 

        OnLineResourceImpl png = new OnLineResourceImpl(new
URI("file:city.png"));

        png.freeze(); // freeze to prevent modification at runtime

 

        //

        // List of symbols is considered in order with the rendering engine
choosing

        // the first one it can handle. Allowing for svg, png, mark order

        List<GraphicalSymbol> symbols = new ArrayList<>();

        symbols.add(sf.externalGraphic(svg, "svg", null)); // svg preferred

        symbols.add(sf.externalGraphic(png, "png", null)); // png preferred

        symbols.add(sf.mark(ff.literal("circle"), fill, stroke)); // simple
circle backup plan

 

        Expression opacity = null; // use default

        Expression size = ff.literal(10);

        Expression rotation = null; // use default

        AnchorPoint anchor = null; // use default

        Displacement displacement = null; // use default

 

        // define a point symbolizer of a small circle

        Graphic circle = sf.graphic(symbols, opacity, size, rotation,
anchor, displacement);

        PointSymbolizer pointSymbolizer =

                sf.pointSymbolizer("point", ff.property("the_geom"), null,
null, circle);

 

Would it be possible to specify the SVG graphic dynamically using
"Expression" ?

I would like the SVG to be specified via ff.property() ?

 

Appreciate your help.

 

_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to