I am confused because one method calls the other; can you look at the resulting style object in the debugger and see what is going on.
I can see one source of confusion in -> sb.createStyle( featureTypeStyleName, lineSymbolizer ); -> calls createStyle( featureTypeStyleName, symbolizer, minScaleDenominator, maxScaleDenominator) -> calls createFeatureTypeStyle( featureTypeStyleName, symbolizer, minScaleDenominator, maxScaleDenominator); -> calls createFeatureTypeStyle( featureTypeName, symbolizer, minScaleDenominator, maxScaleDenominator) Notice they switched from featureTypeStyleName to featureTypeName! FeatureTypeStyle.getName(); is display only (ie description) and is just used for user interfaces and error reporting FeatureTypeStyle.getFeatureTypeName(); is *real* data (not description) and is used to figure out when to apply the FeatureTypeStyle object; it should be either very very specific (something like "RoadFeatureType"); or "Feature" (which is applied to all features). > The following code does not seem to work (ie nothing is rendered) > > StyleBuilder sb = new StyleBuilder(); > LineSymbolizer lineSymbolizer = > sb.createLineSymbolizer(ColorUtil.getRandomColor(), 1.5); > return sb.createStyle(featureTypeStyleName, lineSymbolizer); > What value did you use for featureTypeStyleName in your example? If it was not "Feature" you may have problems... > while this one does: > > StyleBuilder sb = new StyleBuilder(); > LineSymbolizer lineSymbolizer = > sb.createLineSymbolizer(ColorUtil.getRandomColor(), 1.5); > return sb.createStyle(lineSymbolizer); > This code would of used *null* for the featureTypeStyleName; which is probably taken to mean "Feature". > In other words the method createStyle(String featureTypeStyleName, Symbolizer > symbolizer) does not seem to do anything. > Gah; this is so messed up I am not quite sure how to document it; I have some ideas - but what do you think should be done? > gaby > > > > *************************************************************** > ** Gabriella Turek [EMAIL PROTECTED] ** > ** National Institute of Water & Atmospheric Research (NIWA) ** > ** PO Box 8602 Christchurch New Zealand +64-3-343-8067 ** > *************************************************************** > > ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
