[ka-Map-users] equidistant projection assumption

Moran Ben-David moran at placebase.com
Tue Jan 31 18:38:59 EST 2006


Thanks, Daniel.  That was very helpful!  My initial issue/question was due
to my confusion about projections as you pointed out.

As you point out, I'll have to project my lat/lon (absolute) and pass the
projected values to kamap's functions.

Thanks,
Moran


> -----Original Message-----
> From: Daniel Morissette [mailto:dmorissette at dmsolutions.ca]
> Sent: Tuesday, January 31, 2006 5:02 PM
> To: Moran Ben-David
> Cc: ka-map-users at lists.maptools.org
> Subject: Re: [ka-Map-users] equidistant projection assumption
> 
> 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?
> >
> >
> >
> > Thanks in advance,
> >
> > 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/
> ------------------------------------------------------------



More information about the ka-Map-users mailing list