[Fwd: Re: [ka-Map-users] ka-Map Maths]

Stephen Woodbridge woodbri at swoodbridge.com
Thu Aug 24 09:52:27 EDT 2006

Oops forgot to send it to the list.

-------- Original Message --------
Subject: Re: [ka-Map-users] ka-Map Maths
Date: Thu, 24 Aug 2006 09:51:44 -0400
From: Stephen Woodbridge <woodbri at swoodbridge.com>
To: Christopher Brown <chris at basebloc.com>
References: <20060824110350.694312FA40 at mx01.citylink.com.kh>

Christopher Brown wrote:
> Hi Guys,
> I’ve been studying the tile generation code for ka-map and as I’m not 
> used GIS type calculations am having some trouble with understanding 
> some of the maths regarding scale etc, in the kaMap zoomToExtents 
> method, especially the following line and its significance: 
> this.cellSize = newScale/(oMap.resolution * inchesPerUnit[oMap.units]);, 
> which translates in my case to scale/(72*39.3701).
> For example if I had the following 529.166 = 1500000/(2834.6472) with 
> the first part being my scale and the second part being how many pixels 
> there are in a meter, what is the significance of 529.166?

This is the number of meters per pixel.

> The cellsize variable is then used in the later equations and methods to 
> ultimately produce the tiles in tile.php without having to pass a geo 
> extent for each image to tile.php, I have been modifying the system and 
> it works but I would like to understand how it is working, if anyone has 
> any insight for someone who should have paid more attention to his maths 
> teacher at school, it would be most appreciated.

So at this scale 0,0 of the the geo space is mapped to 0,0 of the pixel
space. and we use this number to calculate the top left of a tile or a
meta tile and we know the size of a tile and a meta tile from the
information in returned by init.php which you set in the config.php file.


> Thanks
> Chris
> ------------------------------------------------------------------------
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

More information about the ka-Map-users mailing list