[Gdal-dev] hatches rendering issues

Eric Lemoine eric.c2c at gmail.com
Tue Nov 6 17:26:26 EST 2007


On 11/6/07, Frank Warmerdam <warmerdam at pobox.com> wrote:
> 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?

The original tiff is 1/5000 yes.

> Is this
> really the *original*?

Well no. It went through gdal_translate (tiff to geotiff), gdaladdo,
and got handled by MapServer.

> 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?

Average is used both in gdaladdo and MapServer. If I use nearest in
MapServer, or gdaladdo, or both, the results get very bad. Average
with both gdaladdo and MapServer is what's given me the best results,
which aren't good enough to my customer ;-)

> 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.

I'm going to tell my customer about this :-)

Thanks a lot for your response Frank. This helps me understand the problem.
--
Eric



More information about the gdal-dev mailing list