I think you're looking at the piece of code out of context, otherwise I don't
see how you're reaching such conclusions.

The array of attribute names coming down into the method is generated
in the queryLayer method, line 944, by the following call:
   attributes = findStyleAttributes(styles, schema);

So the attributes are not "all the attributes",  but only the ones the
SLD author
explictly mentioned in the SLD in the<geometry>  elements (plus the
default ones).
So to answer your question "Isn't it enough
  to create a BBOX for the geometry type that is used for rendering" the
answer is yes, that's exactly what we're doing.

You're right, it does only loop over the attributes used in the style, I did know that, perhaps I wasn't clear about that. I still don't understand why it loops over all the attributes used in the style's filters? The filters don't really have anything to do with the geometry that is used, have they? Isn't it just the default geometry that is used? That's what I understood from the drawing code. Why not simply take the default geometry attribute - the one that is used for drawing - and put a BBOX filter on that?

Alternatively we could have some kind of hint be passed down
in expression evaluation that forces the property accessors to
just throw an exception if the attribute is not there.
Haven't checked if that is possible at all, just thinking out loud here

Haha, but something like that already exists, because I implemented it! There is a property in AttributeExpressionImpl to make it throw an expection on invalid property names, for exactly that purpose, that is used by app-schema. (It was used because people had exactly the same problem with non-existing column names in the app-schema mapping file). We could use that to report the error at time of /the evaluation of the property name against a specific feature/, rather than in advance. One issue: I am not sure if this would eliminate the problem with polymorphism completely though. Because doesn't polymorphism imply that some x-paths won't be able to be evaluated against some features - in which case they probably should be ignored?


Niels

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to