[Gdal-dev] hatches rendering issues

Frank Warmerdam warmerdam at pobox.com
Tue Nov 6 11:11:00 EST 2007


Eric Lemoine wrote:
>> It would be helpful to see the results, but generally it is hard to
>> downsample repeating patterns without odd aliasing effects.  The best
>> is to be very certain that exact factor of 2 downsamplings are done in
>> which case the algorithms should sample the data in a consistent way.
> 
> Thanks for your response Franck. Would you mind elaborate a bit more
> on your last sentence?
> 
> <http://dev.camptocamp.com/grandlyon_plu/problem_images/>
> 
> Three screenshots at 1/20000, 1/10000, and 1/5000.

Eric,

I've looked at the three images.  The 1/5000 is the original, right?  Is this
really the *original*?  It seems the hatching spacing is not exactly uniform
and darkness of the hatch is not uniform.  So if this is what you are working
from you are basically doomed to relatively poor and inconsistent results.

The hatching does not follow on nice power of 2 boundaries, so nearest
neighbour downsampling will certainly produce inconsistent results (some
hatches will be completely missed for instance).  Are the 1/10000 and
1/20000 samples you provide produced with averaging?  With MapServer or
gdaladdo?

MapServer's "averaging" does not always go back to the original image to
do the averaging (I think), so as you start to downsample a lot it will
suffer from nearest neighbour "missing a line" effects which seems to be
the case.  Gdaladdo on the other hand should not have this effect.

Basically raster hatching effects put through sampling processes suck,
and at most you can hope for not-too-bad in my opinion.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the gdal-dev mailing list