Hi,
I’m working on http://jira.codehaus.org/browse/GEOS-4100 to add support for custom dpi to the
GetLegendGraphics code. Some changes in that directions (with support for UOM too)
were already made by a user contributed patch (http://jira.codehaus.org/browse/GEOS-4927)
however proper dpi support needed some fixes.
Done that, and then realized a discussion is needed about a couple of details, about interactions
with other code.
Let’s have a look at a sample output from the states layer:
Now, when applying dpi=180 the expected result is to have all lines get thicker, all point symbols grow bigger,
and have text grow as well. The result I have so far is this one:
The behavior is as expected, but there is maybe one gotcha, see the square blocks also grew?
I’m not 100% sure about that. The request asks for 20x20 legend icons, and that amount has
been multiplied by 2 due to the dpi.
The result looks natural to me, however if we look at how GetMap works, we can see that
adding dpi does not make the map bigger, it’s the caller tha has to ask for a larger raster instead.
Would GetLegendGraphics do the same, assume the caller asks for a larger sample width/height,
instead?
There are implications when putting the legend into a layout. For example, see how the current
code works:
Scaling up the samples seems desirable behavior here, if we don’t, in order to have symbols proportional to the fonts
we’d need to create by hand a custom layout file that has different values for the samples size.
Notice however how the scale line did not grow in size… I’m inclined to consider this a bug, everything in the layout
should grow according to the dpi to get something that can be printed.
Soo… long story short, I’m inclined to leave the legend graphics work as is, and eventually fix the rest of map decorations
to account for dpi values, even if the behavior does not seem consistent with the GetMap one… but I definitely
could use some feedback
Cheers
Andrea
–
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf