Small differences in input and output

Ed McNierney ed at TOPOZONE.COM
Thu Jun 14 11:11:13 EDT 2007


Frank -

Yes, thanks very much - that's what I meant (the EXTENT is 990 in each
direction), not what I typed <g>.

    - 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 11:07:03 -0400
> To: <MAPSERVER-USERS at LISTS.UMN.EDU>
> Subject: Re: [UMN_MAPSERVER-USERS] Small differences in input and output
> 
> Ed McNierney wrote:
>> 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,
> 
> If the original file is 100 x 100 (for instance) with gdal reported extents
> of (0,0) to (1000,1000) then the mapfile should contain:
> 
>   EXTENT 5 5 995 995
>   SIZE 100 100
> 
> So the size is determined by the SIZE keyword - not the extents.
> 
> Note that mapserver macros like MS_CELLSIZE already account for the fact
> that the extents represent a region that is in a sense n-1 pixels wide/long.
> 
> eg.
> 
> #define MS_CELLSIZE(min,max,d)    ((max - min)/(d-1))
> 
> 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