This project is read-only.

How to use the WGS84 (Latitude, Longitude) projection

Apr 14, 2014 at 7:14 PM
I want to ask how i can integrate this nice library with a GIS library that i want to draw a 3D shape but instead of using the plan (X,Y,Z) corrdinates, i want to use the __(Latitude, Longitude) __corrdinates to place the shape in its real position

Thanks
Apr 14, 2014 at 8:00 PM
Hi as mentioned on the codeproject just convert the lat/long to cartesian coordiates:

x = R * cos(lat) * cos(lon)

y = R * cos(lat) * sin(lon)

z = R *sin(lat)
Apr 14, 2014 at 8:24 PM
Thanks for the fast reply

I'll give it a try.
Apr 22, 2014 at 9:36 AM
Hi i tried your code assuming R (earth radius) = 6371000.0 and i convert the Lat, Lon to radians

i gives me the values for X, Y and they are too much like the following example:

I want to draw any shape with the given center point in geographic coordinates (Lat, Lon) and i want to draw this shape in the 3D plan viewer

Lat = 26.0813055
Lon = -80.1098043
R = 6371000.0

the results :

X = 982856.322980458
Y = -5637208.03609824
Z = 2800985.54193462

when i tried to draw the shape with the given Cartesian (X, Y, Z) values it drawn too far away from the origin (0, 0, 0) so i dont want to map the world i'm only wants to view a smal area about 10km X 10km, so how to map the result point to a small scale in order to be able to draw many shapes beside it and not far from the origin which will be the 3D plan center.

Thanks