How to calculate x and y pixel width for world file?

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Mon Aug 21 08:19:43 PDT 2006


Something like this would do the trick:

x_pixel_width = abs((maxx - minx)) / width
y_pixel_width = abs((maxy - miny)) / height

..Tom


> -----Original Message-----
> From: UMN MapServer Users List 
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Paul Maine(ATS)
> Sent: 21 August, 2006 11:11 AM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] How to calculate x and y pixel 
> width for world file?
> 
> I am using ESRI SOAP webservices to obtain a map for use with 
> Mapserver. I know that in order to use the map that is 
> formatted as a gif - that I need to create world file.
> 
> Since I know the extent of the map image - do I need to use a 
> world file?
> 
> See the following for info on how to create a world file:
> 
> http://mapserver.gis.umn.edu/docs/howto/raster_data/#georefere
> nce-with-world
> 
> 
> How can I obtain the x and y pixel widths from the following 
> information that is returned from the web service? I am 
> creating the map as an 800 x 800 pixel gif file.
> 
> Here is the relevant information that is returned by the webservice:
> 
> 
> <n2:MapImageInfo xsi:type='n2:MapImageInfo'> ...
>       <mapArea xsi:type='n2:MapArea'>
> ...
>        <extent xsi:type='n3:Envelope'>
> ...        <projection xsi:type='xsd:string'>4326</projection>
> ...
>         <maxX xsi:type='xsd:double'>-117.10667</maxX>
>         <maxY xsi:type='xsd:double'>34.13056</maxY>
>         <minX xsi:type='xsd:double'>-117.25667</minX>
>         <minY xsi:type='xsd:double'>33.98056</minY>
> 
> 
> 
> Thank You
> 



More information about the MapServer-users mailing list