Hello Andrea, really nice work.
Though I favour simple solutions (like yours), I think you should be aware of: http://www.geographie.uni-bonn.de/karto/Thematic-SLD.LBS-Telecarto2007.pdf Just sending this for reference's sake. Anyway, if your solution was fast to implement - and it certainly serve its perposes - then stick to it. Cheers, Ugo Andrea Aime said: > Hi, > I would like to create a new community module that is going > to provide chart rendering for ExternalGraphic leveraging > ExternalGraphic, the dynamic symbolizers feature, and the > JFreeChart library by means of the Eastwood charts project: > http://www.jfree.org/eastwood/ > > Eastwood is basically a reimplementation of the Google Charts > API (http://code.google.com/intl/it-IT/apis/chart/) on top > of the JFreeChart library. It can be used as a stand alone > servlet, as an applet, or as an in process library. > > The dynamic symbolizer abilities to pass over feature attributes > in ExternalGraphics url has already been leveraged in GeoServer > land to use Google Charts API directly, but that is subject > to some limitations: > - performance is poor due to the remote requests to compute > charts > - dependency on a free service that has no guarantees to be > there or be performant enough > - issues with Google deciding, one day, to change the terms > of service. > > Eastwood was created to address these points, and made > it very easy to add support for in process charting in > GeoTools by adding a new dynamic symbolizer factory. > > I'm attaching some sample maps I've created along with > the SLD. > First, look at bars.png, it's a simple one bar chart, > the bar is taller the more inhabitants are located in > a certain area. Some bars do not appear due to an > issue in Eastwood not parsing numbers is scientific notation > properly (reported in Eastwood tracker already). > > Then look at piesPS.png, a pie chart showing the distribution > of male/female population with a point symbolizer, with > the size of the pie proportional to the total amount of > people in the state. The style creating it is statesPiePSS.sld. > (to have that showing up fine I had to fix another couple > of bugs in Eastwood, reported them too, it was impossible > to get a transparent background). > > Having charts display with this level of overlap is not > too nice thought. Would be nicer to have conflict resolution, > and have bigger pies get higher priorities. > And it's doable, too, with a hack. > As some of you may know, our TextSymbolizer can also accept > a Graphic, which in origin was to be used for road plates. > Well, we can use it for charts too, thus benefiting from > the label cache ability to deal with priorities and conflict > resolution. The result you can see in piesTS1 and piesTS2. > The style generating it is statesPieTS.sld: notice how > I made the label fill transparent in order to have only > the chart appear. > > Whilst still a big rough, it shows promise, and it is > fast enough for interactive map drawing > (the pie maps draw in less than 0.2s on my PC). > > Ok to commit as a community module? > > Cheers > Andrea > > > PS: hmmm, I already hear someone saying that having > a full blown ChartSymbolizer would have been nicer. > And well, it would have been, no doubt about it. > Yet, going down that route would have taken much more > time I have available, whilst I managed to do this in > a bit more than one day. > If anyone is interested in making a ChartSymbolizer, > create the parsers, the javabeans, the support in > SLDStyleFactory and whatnot, he's more than welcomed, > I would like that better than putting togheter > urls with embedded CQL expressions ;-) > (thought, using the google charts api has the nice side > effect that you can test your charts configs against > the live Google charts service before turning those > into a symbolizer) > > -- > Andrea Aime > OpenGeo - http://opengeo.org > Expert service straight from the developers. > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensign option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects_______________________________________________ > Geotools-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-devel > ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
