Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Re: More questions about expressions and styles

Matthias Basler wrote:
Hi GeoTools community, hi Jody,

I am making my way through the current GeoTools styling API and noticed a few strange things about which I want to complain ... err, I mean, I'd like to ask some innocent questions. ;-)

1. All values within styles are expressions. All? No, there seem to be a few exceptions, for whatever reason. Please try to explain to me why
    org.geotools.styling.Stroke
has following method signatures (among others)
    Expression getDashOffset();
    float[] getDashArray();

If I interpret this correctly, the dash offset may vary depending on the feature while the dash array is the same by definition. Doesn't make sense to me...
My guess is this stems directly from the XML Schema for Filter. In one case they used <Expression> and in the other had an element defined as a list of xsd:float
As another example, the point symbolizer contains Marks and/or Symbols, actually two equivalent things with different implementations (vector vs. raster).
The interface "Mark" has the signature
    Expression getWellKnownName();
This one is suppoed to turn into a String eventually used to encode known things like "circle" or "SOME16CHARACTERCODE" from Mil2525B specification
whereas the interface "Symbol" has no such method the subinterface "ExternalGraphic" has the method URL getLocation()
This one (the URL) lets you point to an external file like a PNG or SVG file.
Again, the former is a potentially variable expression the latter a literal by definition. Why?
Yep; it is not our choice to make in these cases - if you see something you hate let us know and we can make Symbol2 with the
method you want.
2. I infer from the interface source code that a "Graphic" contains (among others) size, rotation and several marks. The "Mark" interface defines size and rotation again for this mark.
That's redundant information, isn't it?
Yes and no - they use this to compose a Graphic out of a bunch of icons (think of a person, now think of the person under water etc...). Note the MIL2525B specification does the same thing within their 16 character code (makes for a very very very long document).
Actually the "Mark" interface doesn't comment on size and rotation in it's Javadoc, and the functions look like they were added afterwards, possibly as a "quick hack" for somebody.
That sounds bad - we should take this to the GeoAPI list (if you want to formally review the interfaces we should make corrections against the specification as we go).
Now assume I get a graphic where the graphic tells me the size is 32 pixels and the marks within tell me they want to be drawn with a size of 24 pixels. Who should I believe?
I don't think we have to think here - the specification tells us which ones to belive (my guess is they draw to 24 pixels and then rescale up to 32).
So far so good. These are just minor issues, but I thought I should mention them anyway.

Good stuff,
Jody


Back to the top