Hi Martin (cc to the dev. list),
is there any setting to solve the problems depicted in the
attached screenshot? That is, the magnifier does not shows
the true countrie boundaries, but the decimated one, and the
result is a bit ugly...
Oh, by the way, the default decimation seems to be a bit too
heavy, sometimes I can see "holes" in the country layers even
without using the magnifier.
From: Martin Desruisseaux <martin.desruisseaux@te...> - 2004-02-24 15:19:52
Andrea Aime a =E9crit :
> is there any setting to solve the problems depicted in the
> attached screenshot? That is, the magnifier does not shows
> the true countrie boundaries, but the decimated one, and the
> result is a bit ugly...
Yes. It would not be very difficult, but would nevertheless requires a=20
little bit of work that I would prefer to do when the renderer will have=20
been refactored in a GeoAPI / GO-1 way...
I opened a JIRA task which describe the problem and the fix to apply:
> Oh, by the way, the default decimation seems to be a bit too
> heavy, sometimes I can see "holes" in the country layers even
> without using the magnifier.
After MapPane creation, you can invokes the following (where Hints is an=20
enumeration in org.geotools.renderer.j2d)
Renderer renderer =3D MapPane.getRenderer();
renderer.setRenderingHint(Hints. FINEST_RESOLUTION, new Float(0.25f));
renderer.setRenderingHint(Hints.REQUIRED_RESOLUTION, new Float(2.00f));
Here, 0.25 and 2.00 are the default values in pixel units. A new=20
decimation will be trigged if the distance between decimated points is=20
outside this range (i.e. smaller than 0.25 pixels or greater than 2 pixel=
According the default setting, the distance between decimated points=20
should never be greater than 2 pixels. However, I wonder if the distance=20
computation is really working right, because it seems to me that=20
sometime the distance is greater then 2 pixels. One possible explanation=20
may be that, if two neighbor geometries have a line 2 pixels away from=20
their normal position, then the total distance between the two=20
geometries would be 4 pixels.
I think that the FINEST_RESOLUTION and REQUIRED_RESOLUTION hints would=20
need some experiment in order to find the better compromise between=20
speed and accurate rendering. Once a better compromise have been found,=20
the default value in MapPane should be updated.