Thanks for the hunting; this is where I have fun and go check the 
specification -see if we are allowed marks and external graphics at the 
same time.
> If the Graphic element is omitted from the parent element, then 
> nothing will be plotted. The Mark element is defined and discussed below.
> Graphics can either be referenced from an external URL in a common 
> format (such as GIF or SVG) or may be derived from a Mark. Multiple 
> external URLs and marks may be referenced with the semantic that they 
> all provide the equivalent graphic in different formats. The “hot 
> spot” to use for positioning the rendering at a point must either be 
> inherent in the external format or is defined to be the “central 
> point” of the graphic, where the exact definition “central point” is 
> system-dependent.
>
> The default if neither an ExternalGraphic nor a Mark is specified is 
> to use the default mark of a “square” with a 50%-gray fill and a black 
> outline, with a size of 6 pixels, unless an explicit Size is
Here is the schema:
<xsd:element name="Graphic">
<xsd:complexType>
<xsd:sequence>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="se:ExternalGraphic"/>
<xsd:element ref="se:Mark"/>
</xsd:choice>
<xsd:sequence>
<xsd:element ref="se:Opacity" minOccurs="0"/>
<xsd:element ref="se:Size" minOccurs="0"/>
<xsd:element ref="se:Rotation" minOccurs="0"/>
<xsd:element ref="se:AnchorPoint" minOccurs="0"/>
<xsd:element ref="se:Displacement" minOccurs="0"/>
</xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

So my understanding of this is that we should have multiple external 
graphics and/or marks; but the the first one that is understood should 
be used? So perhaps you could have an order like:
- svg
- png
- gif
- mark

What do you think?

Jody

Arto Pastinen wrote:
> Ok i found it..
>
> In my case when i create style programmatically, there is bug in
> geotools version which is included
> in uDIG 1.2M4 (i am not sure about revision, at least it is SNAPSHOT?),
> I am not sure which geotools version is included earlier udig releses,
> maby it works fine there..
> but there is no bug at least stable geotools 2.5.5, i check it from source.
>
> StyleFactoryImpl:
>     public Graphic createGraphic(ExternalGraphic[] externalGraphics,
>         Mark[] marks, Symbol[] symbols, Expression opacity, Expression size,
>         Expression rotation) {
>         Graphic graphic = new GraphicImpl();
>
>         symbols = symbols != null ? symbols : new Symbol[0];
>         graphic.setSymbols(symbols);
>
>         externalGraphics = externalGraphics != null ? externalGraphics
> : new ExternalGraphic[0];
>         graphic.setExternalGraphics(externalGraphics);
>
>         marks = marks != null ? marks : new Mark[0];
>         graphic.setMarks(marks);
> <snip>
>
> GraphicImpl:
>     @Deprecated
>     public void setMarks(Mark[] marks) {
>         graphics.clear();
>
>         for(Mark g : marks){
>             graphics.add(g);
>         }
>     }
>
>     @Deprecated
>     public void setExternalGraphics(ExternalGraphic[] externalGraphics) {
>         graphics.clear();
>
>         for(ExternalGraphic g : externalGraphics){
>             graphics.add(g);
>         }
>     }
>
> .. as you can see, when factory call setMarks, the external graphics is 
> cleared.
> In geotools 2.5.5 there was own collection for both external graphics
> and marks so they didnt get cleared.
>
> - Artsi
>   


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to