|
From: Jody G. <jga...@re...> - 2007-08-10 05:09:58
|
You are the first person to ask a style question since I started my documentation kick. I will try to answer your questions as children on this page when I get the chance. - http://docs.codehaus.org/display/GEOTDOC/08+Render The Style interfaces should not be too bad - we were waiting on an update from GeoAPI (where they are going to update to the SLD 1.1 spec) before we try to clean up anything. The interfaces in GeoTools are spot on against the Filter 1.0 specification so we do not expect any methods to change names. Rather than loop through set up a StyleVisitor that is also a FilterVisitor, you should be able to retrieve all the rules with just a few lines of code. There are some examples of this style of coding here: - http://docs.codehaus.org/display/GEOTDOC/FilterVisitor+Examples StyleVisitor works the same way, there are a couple abstract StyleVisitor classes you can extend .. leaving you to only implement the visit methods for the subject matter you are interested in. For a lot of the work you are talking about helper methods exist in the SLDs utility class; they will let you update stuff pretty quickly, if you need any more methods added to this class (such as the problem you describe) please email the code to the list - or attach them to a Jira bug report - and I will see that they get on trunk. Cheers, Jody Gabriella Turek wrote: > Jody said: > >> The 2.3 branch >> has had a lot of trouble with filters, 2.4 will be much better when >> justin manages to release it. >> > I guess this is true for styles as well? I am trying to figure out > a clean way to obtain rules information for a given attribute type so I > can allow the user to edit predefined colors for given attribute type > values. > > Right now the only way I can see doing this for a particular SLD is a > looping over rules and finding the rule whose PropertyIsEqualTo filter > contains the name of the attribute type and the value of the attribute > type I am interested in. > > It seems very labourious, not very general, and I am kind of stuck on > how to obtain the filter's properties. > > > My layer descriptor like. > > > Thanx > gaby > |