From: Adair, M. <Mike.Adair@CCRS.NRCan.gc.ca> - 2006-04-14 21:57:55
|
>>In mapbuilder/lib/tool/Extent.js we have functions getXY() and getPL() Actually getXY() returns map projected XY value, which is lat/lon only if the maps are displayed with EPSG:4326 (or equivalent). To get lat/lon to or from map projected XY you need the Proj/cscs forward()/inverse() methods, which happen to be the identity for lat/lon. Google's Mercator projection is a map projection like any other (unless I'm missing something) so we should continue to use the same design where Proj/cscs implements the math to convert between Mercator and lat/lon. It's in that code that non-linear axes is taken care of. The Extent object will only ever go between pixel-line on the screen and map projected XY. Mike > -----Original Message----- > From: Cameron Shorter [mailto:cam...@gm...] > Sent: Friday, April 14, 2006 5:06 PM > To: Richard Greenwood > Cc: map...@li...; Adair, Mike; > Patrice Cappelaere > Subject: Re: Pixel Coords <--> Lat Long coords > > I can see I'm showing up my lack of training in geography. > > I agree that we should be using cscs as soon as you are ready > to share > it with the world. I only suggest using Proj.js as an > interum measure > until your code is ready. > > In cscs do you have a function which converts pixels to latlong? > > Richard Greenwood wrote: > > On 4/14/06, Cameron Shorter <cam...@gm...> wrote: > > > >>Richard, Mike, > >> > >>In mapbuilder/lib/tool/Extent.js we have functions getXY() > and getPL() > >>which translate between Pixel coords and Lat/Long coords. > >> > >>The functions make the bold assumption that both the X and > Y axes are > >>linear (which they are for EPSG:4326) but is not the case > for Mercator > >>which is used by Google Maps and many other projections. > > > > > > In my mind, I do not see a longitude/latitude coordinate system as > > "linear" but I don't know what you're trying to do either. At the > > equator, a degree of longitude==latitude, but 45 degrees north or > > south a degree of longitude/2==latitude. > > > > > > > >>What needs to be done to correct this? Can we extend the existing > >>Proj.js code to handle pexel->latlong translation? > > > > > > I was kind of hoping to see cscs employed over Proj. > > > > Rich > > > > -- > > Richard Greenwood > > ric...@gm... > > www.greenwoodmap.com > > > > > -- > Cameron Shorter > http://cameron.shorter.net > |