[Gdal-dev] hatches rendering issues

Eric Lemoine eric.c2c at gmail.com
Sun Nov 4 19:12:54 EST 2007


Hello

(Resending this since it didn't make it due to too big attachments)

I have some image rendering issues with Gdal and MapServer, and I'm
hoping someone here could help me.

Context: I have an original tif/tfw file (file-in.tif) from which I
want to generate jpeg or png images with MapServer. The image
resolution is for scale of 1/5000. One characteristic of this image is its
horizontal hatches. (The output of gdalinfo file-in.tif is given below)

I want to visualize that image at 1/5000 but also at smaller scales:
1/10000 and 1/20000.

I operate the following gdal operations on my file: compress and
convert to geotiff, and create overviews.

$gdal_translate -of "GTiff" -co "COMPRESS=PACKBITS" file-in.tif file-out.tif
$gdaladdo -r average file-out.tif 2 4

(Output of gdalinfo file-out.tif is given below)

On the MapServer side, I use PROCESSING "RESAMPLE=AVERAGE".

The result isn't satisfying as the horizontal hatches aren't equally
spaced as they should be for the scales 1/20000 and 1/10000. It is a
lot better for 1/5000, although some lines seem bolder than others.

(In my previous email, I attached some png images to illustrate the
problem, but my email didn't make it to the list because of these
attachments).

I've used several other combinations. For example, I tried to use "nearest"
both with Gdal and MapServer. The results are very very bad.

Do you have suggestions?

Thanks a lot,

--
Eric


----
$gdalinfo file-in.tif

Driver: GTiff/GeoTIFF
Size is 19811, 15416
Coordinate System is `'
Origin = (798523.321250,90776.398750)
Pixel Size = (0.31750000,-0.31750000)
Metadata:
 TIFFTAG_IMAGEDESCRIPTION=Image obtenue depuis HPGL
 TIFFTAG_SOFTWARE=SPRING : wtiff.c version 3.3 (26-mai-1998)
 TIFFTAG_XRESOLUTION=400
 TIFFTAG_YRESOLUTION=400
 TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
 COMPRESSION=LZW
Corner Coordinates:
Upper Left  (  798523.321,   90776.399)
Lower Left  (  798523.321,   85881.819)
Upper Right (  804813.314,   90776.399)
Lower Right (  804813.314,   85881.819)
Center      (  801668.318,   88329.109)
Band 1 Block=19811x24 Type=Byte, ColorInterp=Red
Band 2 Block=19811x24 Type=Byte, ColorInterp=Green
Band 3 Block=19811x24 Type=Byte, ColorInterp=Blue

----
$gdalinfo file-out.tif

Driver: GTiff/GeoTIFF
Size is 19811, 15416
Coordinate System is `'
Origin = (798523.321250,90776.398750)
Pixel Size = (0.31750000,-0.31750000)
Metadata:
 TIFFTAG_IMAGEDESCRIPTION=Image obtenue depuis HPGL
 TIFFTAG_SOFTWARE=SPRING : wtiff.c version 3.3 (26-mai-1998)
 TIFFTAG_XRESOLUTION=400
 TIFFTAG_YRESOLUTION=400
 TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
 COMPRESSION=PACKBITS
Corner Coordinates:
Upper Left  (  798523.321,   90776.399)
Lower Left  (  798523.321,   85881.819)
Upper Right (  804813.314,   90776.399)
Lower Right (  804813.314,   85881.819)
Center      (  801668.318,   88329.109)
Band 1 Block=19811x1 Type=Byte, ColorInterp=Red
 Overviews: 9906x7708, 4953x3854
Band 2 Block=19811x1 Type=Byte, ColorInterp=Green
 Overviews: 9906x7708, 4953x3854
Band 3 Block=19811x1 Type=Byte, ColorInterp=Blue
 Overviews: 9906x7708, 4953x3854



More information about the gdal-dev mailing list