Well, ok then. Here are then my notes on the two different workarounds to control decimation as things stand:
1. Switching to StreamingRenderer when you don't want decimation. StreamingRenderer uses in-memory Decimators and already has a nice setGeneralizationDistance() method which could be used to eliminate decimation. Too bad it doesn't respect it, but that would be easy to change: I guess getDecimator() could just check the distance and if appropriate return a Decimator with spanx=spany=-1, which does nothing. 2. Multiplying the screen area by a large number, and at the same time setting an appropriate scale to the Graphics before calling renderer.paint(). This works with any renderer but doesn't absolutely guarantee decimation. Moreover, it has a little side effect because it visually affects the stroke: this happens since the stroke is given in screen units, which in this case represent a lot less (given that we artificially increased the resolution by scaling the screen area) Well, I guess I'd prefer to use solution 1 since performance is not critical when exporting to an SVG. If you're ok with that change I proposed to StreamingRenderer, I could do it and send you a patch. What do you think? Milton Andrea Aime wrote: > Milton Jonathan ha scritto: >> Hello Andrea >> >> > The closest workaround I can think of is to define a huge width/height >> > param so that no generalization is going to be needed. >> >> Thanks for answering. By width/height "param" do you mean the actual >> mapArea passed over to GTRenderer.paint? I actually tried to set the >> renderer hint "declaredScaleDenominator" to get the same effect but it >> didn't do any good. > > Yep, that hint is not actually hooked to the code anymore. I noticed > only this morning, not sure when it happened (the hint is many years > old). > >> Actually, I am a little lost as to where decimation is really done in >> the code. I thought the Decimator class would be used, but debugging >> the code it seems to be decimating the geometries without >> instantiating a single Decimator! I am clearly missing something big.. >> >> As a sidenote, I am using shapefiles with ShapefileRenderer, don't >> know if that affects the decimation process. > > Aah, yeah. ShapefileRenderer does the decimation in the code that reads > the shapefile (has custom shapefile handlers). Extreme, and as some > of my tests show, not fully necessary. I would like to get rid of > ShapefileRenderer sometime this year. I already have a set of patches > that make the standard streaming renderer just as fast when you're > not too zoomed out, but I have to work on them more, and this is > all on my spare time, there is no funding to back this work, so > I'm not sure when I'll commit it. > > Cheers > Andrea > -- Milton Jonathan Grupo GIS e Meio Ambiente Tecgraf/PUC-Rio Tel: +55-21-3527-2502 ------------------------------------------------------------------------------ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
