accuracy of raster maps

Jan Hartmann j.l.h.hartmann at UVA.NL
Thu Aug 19 08:24:27 EDT 2004


Frank Warmerdam wrote:

>
> Jan,
>
> The general raster renderer in MapServer transforms the request window
> into a pixel/line window on the source file and loads and stretches that
> window.  The way this is done, all pixels in the selected window will be
> drawn with the same size (give or take a pixel depending on rounding).
> In cases such as yours (with extreme zoom in) you really want to do all the
> calculations on a subpixel level, so if the map edge falls in the middle of
> a pixel, only half that pixel would be displayed.  However, that isn't
> done.
>
> On the good side, I think you would get the proper results if you could
> force things to go through the image warping code used for transforming
> between projections.  This code does effectively do all the calculations
> at a subpixel level.
>
> There isn't currently a keyword or anything to force use of the warping
> code in preference to the simple stretch code, but I have successfully
> tricked mapserver into using it before by specifying coordinate systems
> for the map and the raster layer that differ in some very small way.
> For instance, a very subtle difference in datum shift.
>
> eg.
>   +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0
>
> and
>   +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0.001
>
> Try triggering the warping logic and let me know if it seems to
> improve display. Note that the warping logic will be slower than
> the simple case, often roughly doubling map rendering time.
>
> I am thinking it might be useful for me to add a special keyword to
> force use of the warper, likely via a PROCESSING directive.
>
> Best regards,


Hi Frank,

I didn't get your projection solution to work on these unreferenced
raster images. However, if I round all mapextents to whole numbers, the
error almost disappears. At least, the data points are always within the
same pixel, which is all I need.

This probably works because in this case map units and pixel units are
the same: one pixel is one map unit I'm not sure how this could be
generalized for georeferenced maps with pixel sizes other than map
units. I guess forced warping would be necessary in this more general case.

I could imagine that forced warping would make sense only for scales
where individual pixels are visible, e.g. when map extent is smaller
than map size. Perhaps this could be a further refinement to the
PROCESSING directive.

Thanks,

Jan



More information about the mapserver-users mailing list