Jesse Eichar ha scritto:
>>
>> a) is probably the wrong default behavior to start with. I mean,
>> bbox fitting is ok during printing, but both uDig and Geoserver do
>> render images that are parts of a bigger map.
>> One way would be to simply have the labels ignore bbox limits unless
>> an "optimize for printing" flag is set (as an extra parameter, useful
>> when rendering to PDF for example).
>> This is easy, but may have a glitch a the actual map borders,
>> because labels may well go beyond the total MapContext area...
>> so another way could be to keep on adjusting label position, but against
>> the MapContext bbox instead of using the current rendering bbox.
>> This should be ok for uDig, less so for Geoserver, since MapContext
>> gets re-created (we cannot cache the bbox as a result), and usually
>> we don't see the real map extent, clients such as OpenLayer make
>> separate request for separate layers.
>> So, the overall bbox may well become a custom parameter as well,
>> so that we can use a global bbox on the web as well, and avoid
>> having to recompute bounds at each request.
> 
> My concern with using the MapContext is that in uDig we use a number of 
> MapContexts, one for each layer but the entire MapBounds may be larger 
> since the other layers would be in seperate MapContext objects.  And 
> same as Geotools we keep recreating the MapContext object.

So we're in the same boat, you need to use LABELING_MODE = SEAMLESS
or LABELING_MODE = DATA_BOUNDS and then provide the LABELING_BOUNDS
hint as well. You can compute the LABELING_BOUNDS before rendering,
cache it, update it when you add/remove layers.
Would that work for you?

Oh, btw, removing bbox label constraints will get us a pretty nice
speed improvement. On the Geoserver tiger demo all the intersections
needed to contraint labels into the rendering bbox are sucking
20-25% of the whole rendering time, and that's for very simple
line geometries (the bigger hitter is still the stroked shape
computation needed to draw halo, I have ideas on how to optimize
that one too, but for the moment I don't have time).

Cheers
Andrea

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to