Small differences in input and output

Ed McNierney ed at TOPOZONE.COM
Thu Jun 14 10:50:33 EDT 2007


Frank -

For MapServer EXTENT purposes Benoit will need to adjust the extents by one
whole pixel rather than by half a pixel?  If there are N pixels horizontally
measured from the center of the left-hand to the center of the right-hand
pixel, then there are N+1 pixels measured from the left of the left-hand to
the right of the right-hand pixel, rather than N+0.5.

That is, if you adjust all four corners "in" by 0.5 pixel you'll reduce the
height and width by 1 whole pixel each.

     - Ed

-- 
Ed McNierney
President and Chief Mapmaker
Maps a la carte, Inc. / TopoZone.com
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: (978) 251-4242
Fax: (978) 251-1396
ed at topozone.com

> From: Frank Warmerdam <warmerdam at POBOX.COM>
> Reply-To: Frank Warmerdam <warmerdam at POBOX.COM>
> Date: Thu, 14 Jun 2007 10:11:08 -0400
> To: <MAPSERVER-USERS at LISTS.UMN.EDU>
> Subject: Re: [UMN_MAPSERVER-USERS] Small differences in input and output
> 
> Benoit Andrieu wrote:
> ...
>> Theline that is inserted in the resulting output does not seem to come from
>> the input neither seems to be an interpolation of the input.
>> 
>> As a second test, I tried to offset my extent by half the resolution of my
>> input but in this output we can now see that a set of vertical lines is
>> offseted.
>> 
>> You can see my input and output :
>> http://benoit.andrieu.free.fr/images/input.png
>> http://benoit.andrieu.free.fr/images/output_1.png
>> http://benoit.andrieu.free.fr/images/output_2.png
>> 
>> As you'll see the difference is very small but I need to not have this
>> difference.
> 
> Benoit,
> 
> What are you using for your EXTENT line in the mapfile?  What does
> gdalinfo report for input.png?  The MapServer "extent" is from the
> center of corner pixel to center of corner pixel, while the GDAL extents
> are from the outer edge of the corner pixels.
> 
> So if you use gdalinfo to get the extents, you need to adjust them "in"
> by half a pixel.
> 
> I *suspect* this is what is happening to you.  If not, please file a bug,
> assigned to me, with a minimal map file, and input file that demonstrates
> the problem and I'll dig into it.
> 
> 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 mapserver-users mailing list