|
|
| GeoCommunity Mailing List |
| |
| Mailing List Archives |
| Subject: | [gislist] finding the y of a latitude for a mercator projection |
| Date: |
03/04/2004 09:50:01 AM |
| From: |
Tor Kristensen |
|
|
Hi all,=20 =20 I'm developing a set of GIS libraries for flash, and have run into a problem.=20 =20 Using the formula from :=20 http://mathworld.wolfram.com/MercatorProjection.html log( (1.0 +sin(L) / (1.0 -sin(L) )/2.0: =20 =20 and the Gudermannian function: http://mathworld.wolfram.com/GudermannianFunction.html (2 * atan( sin(L) / cos(.5*L) ) ) =20 =20 I've succeeded in getting lat/lon correctly placed on a world map. (yay me) =20 However, when I am plotting points on a map which is not a world map, I cannot figure out how to scale the gudermannian values so that they are correctly positioned on the map.=20 =20 Essentially when I have a map whose latitude boundings are 70N 30N, I know that it is 300pixels tall. However, I cannot calculate the height of the total map from this, which is needed to scale the transformed lat positions. (As far as I can tell) =20 =20 Essentially V1 =3D gudermannian(degreesToRadians(-p3.latitude)): Y =3D (V1*WorldHeightInPixels)+offsetToMapTop: =20 I can calculate offsetToMapTop if I can figure out=20 WorldHeightInPixels. =20 My rusty trig is suggesting I've missed something pathetically obvious here. =20 Any suggestions, algorithms, and tips are greatly appreciated. Thanks in advance Tor Kristensen =20 _______________________________________________ gislist mailing list gislist@lists.geocomm.com http://lists.geocomm.com/mailman/listinfo/gislist
_________________________________ This list is brought to you by The GeoCommunity http://www.geocomm.com/
Get Access to the latest GIS & Geospatial Industry RFPs and bids http://www.geobids.com
|
|

Sponsored by:

For information regarding advertising rates Click Here!
|