[ka-Map-users] equidistant projection assumption

Daniel Morissette dmorissette at dmsolutions.ca
Tue Jan 31 17:02:20 EST 2006

```The short answer is that whatever projection your data projected to, the
projected coordinates, usually in meters or feet relative to the
projection's origin, are in a cartesian system, i.e. the x and y axis in
projected coordinates are linear, and it is safe to use this kind of
maths to convert from projected coordinates to pixels and back.

This being said, the relationship between geographical coordinates (lat
and lon, the absolute/unprojected reference ssytem) and the projected
coordinates (x and y in meters, feet, whaetver) is not linear... but
MapServer deals with that part inside the mapfile and ka-Map doesn't
need to worry about it, unless you would like to offer multiple
projection choices to your users in the user interface... in which case
you would probably be better with Chameleon or another more gis-ish
webmapping framework than with ka-Map.

I hope that helps

Daniel

Moran Ben-David wrote:
> Hi all,
>
>
>
> I have been going through the kaMap code and noticed what I think is an
> assumption that the projection of the map that it is using is
> equidistant.  Am I right?
>
>
>
> I am about to write my own version of various functions such as zoomTo
> (where I noticed this assumption), however, I just want to make sure I’m
> not wrong in this before I proceed.
>
>
>
> Here’s a code snippet (kaMap.js) in zoomTo()
>
>
>
> this.cellSize = newScale/(oMap.resolution * inchesPerUnit[oMap.units]);
>
> …
>
> var cpX = cgX / this.cellSize;
>
> var cpY = cgY / this.cellSize;
>
>
>
> The translation there from geo to pixel space seems to assume that y
> (pixel) is proportional to y (geo) linearly… I think… am I off track
> here entirely?
>
>
>
>
> Moran Ben-David
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

--
------------------------------------------------------------
Daniel Morissette               dmorissette at dmsolutions.ca
DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
```