Theuns Heydenrych ha scritto:
> aaime ha scritto:
>
>> The SLD standard allow you to specify params in the URL, but the
>> URL itself is static, you cannot pass feature parameters is it,
>> that's the main issue.
>> If you need to drive symbolization using feature attributes, by
>> following the standard as is, you'd have to create a rule
>> for each possible symbol. Which is not what you'd like to do
>> afaik, no?
>
> OK , the idea is to have the URL un the SLD like "wkicon://mil2525"
> So then in the SLDStyleFactory you correct the URL when the point style
> is created for the SLD to:
> "wkicon://mil2525/WellKnownIconName?cqlExpresions" or
> "wkicon://mil2525/WellKnownIconName?size=10&color=blue&..."
>
> So the SLD could look like this
> <sld:PointSymbolizer>
> <sld:Geometry>
> <sld:PropertyName>wkicon_name_attr</sld:PropertyName>
> </sld:Geometry>
> <sld:Graphic>
> <sld:ExternalGraphic>
> <sld:OnlineResource
>
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:type="simple"
> xlink:href="wkicon://mil2525"/>
> <sld:Format>image/wkicon</sld:Format>
> </sld:ExternalGraphic>
> <sld:Opacity>
> <ogc:Literal>1</ogc:Literal>
> </sld:Opacity>
> <sld:Size>
> <ogc:Literal>40.0</ogc:Literal>
> </sld:Size>
> <sld:Rotation>
> <ogc:Literal>0.0</ogc:Literal>
> </sld:Rotation>
> </sld:Graphic>
> </sld:PointSymbolizer>
>
>
> The next part in the SLD , will then provide the WellknownIcon that is
> associated with the Feature parameter in the CreatePointStyle()
> <sld:Geometry>
> <sld:PropertyName>wkicon_name_attr</sld:PropertyName>
> <sld:Geometry>
Ouch, no, this is not right. sld:Geometry is there to indicate
which attribute serves as the geometry (the point that is being
symbolized, that is) in the case where a Feature
has more than one geometric representation, we cannot coax it into
something else (the semantic would be just different).
What about the following:
<sld:PointSymbolizer>
<sld:Graphic>
<sld:ExternalGraphic>
<sld:OnlineResource
xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple"
xlink:href="mil2525://dynamic?symbol=wkicon_name_attr"/>
<sld:Format>image/mil2525</sld:Format>
</sld:ExternalGraphic>
<sld:Opacity>
<ogc:Literal>1</ogc:Literal>
</sld:Opacity>
<sld:Size>
<ogc:Literal>40.0</ogc:Literal>
</sld:Size>
<sld:Rotation>
<ogc:Literal>0.0</ogc:Literal>
</sld:Rotation>
</sld:Graphic>
</sld:PointSymbolizer>
where symbol is a cql expresion (in this case, just
an attribute name, but in the general case you could
use string composition and the like to drive the
symbolizer). In the simplest case it could be
"mil2425://SFGPUCAAA-*****" (if the symbol it's a constant).
Then we roll out an ExternalSymbolizerFactory working like this:
public interface ExternalSymbolizerFactory {
public boolean canHandle(URL url, String format);
public Image getSymbol(Feature, URL url, size);
public boolean isStatic(URL url);
}
SLDStyleFactory goes thru all ExternalSymbolizerFactory it can
find and looks for one that can handle the URL, after that,
it provides it with the current feature, the URL and
the size (grabbed from the Graphics element, in order
to build an appropriately sized BufferedImage).
The isStatic method is an optimization, if the graphic
defined by the url is not feature dependent we
can avoid re-evaluating the icon again and again
(something we already do, the SLDStyleFactory needs
to decide wheter a symbolizer is static or dynamic,
and will cache the static ones).
For the marks, the thing could be similar:
public interface MarkFactory {
public boolean canHandle(String markName);
public Shape getSymbol(Feature, String markName);
public boolean isStatic(String markName);
}
but in this case the result is a java.awt.Shape, a
vector representation that can be resized, filled
and stroked at will.
The mark names would follow the same principles,
could be simple names, or URL with cql expressions
to drive some of the shape generation.
How does this sound?
Cheers
Andrea
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel