Convert Longitude/Latitude to cartesian x,y

In summary, the conversation discusses using maps with 512 pixels by 512 pixels and approximate latitude and longitude values for plotting variable values. The suggestion to use the Universal Transverse Mercator and software from the US Army Corps of Engineers for lat/long to UTM X/Y conversions is given. The issue of accuracy and map projections is also raised, with the maps in question being gnomonic and Lambert Conformal with specific standard parallels.
  • #1
3saul
3
0
I have a series of maps from various parts of the world.

Each map is 512 pixels by 512 pixels. I also have approximate left, top, right and bottom latitude and longitude values for each map.

I'm wanting to plot variable lat/long value on the maps which need to be converted to x,y values - any advice on how to proceed?
 
Mathematics news on Phys.org
  • #2
3saul: You are getting involved in an area of surveying known as geodesy. I think you should Google the term 'Universal Transverse Mercator' to learn the basics. Software to handle lat/long - UTM X/Y conversions can be downloaded from the US Army Corps of Engineers website - Google 'CORPSCON'
 
  • #3
I forgot to mention, the map width is equal to 1024km - as is the height (so each pixel equates to approx. 2km).

SteamKing, thank you for your response. I've looked over some of the information, which seems relatively complicated for my purposes.

I don't need a huge amount of accuracy but my current calculations (below) aren't producing accurate enough results. The x/y are both off by about 40 (positive) pixels. This tells me my calculations are too simple.

currentlatitude = -27.445617
currentlongitude = 152.93503

--Make values positive
if currentlatitude < 0 then
currentlatitude = currentlatitude * -1
end

if currentlongitude < 0 then
currentlongitude = currentlongitude * -1
end
--The following are the coordinates for my map
mapLeftLong = 147.98
mapRightLong = 158.46
mapTopLat = -23.15 --was a negative figure
mapBottomLat = -32.31 --was a negative figure

--Make values positive
if mapLeftLong < 0 then
mapLeftLong = mapLeftLong * -1
end

if mapRightLong < 0 then
mapRightLong = mapRightLong * -1
end

if mapTopLat < 0 then
mapTopLat = mapTopLat * -1
end

if mapBottomLat < 0 then
mapBottomLat = mapBottomLat * -1
end


xadjusted = mapRightLong - currentlongitude
yadjusted = mapBottomLat - currentlatitude


ypoints = mapRightLong - mapLeftLong
xpoints = mapBottomLat - mapTopLat--Get pixel value
globalXTranslated = (512/xpoints) * xadjusted
globalYTranslated = (512/ypoints) * yadjusted
 
  • #4
3saul: What do you know about these maps you have? What kind of projection (Mercator, etc.) was used to make them? Most map projections distort some feature (direction, location, area, etc.) in order to produce a 2-D representation of the surface of a 3-D body. Unless you have a special map projection, a simple linear scaling of lat/long to X/Y will not be accurate.
 
  • #5
The projection for the map images is gnomonic. They are Lambert Conformal, with standard parallels of 18S and 40S.

I hope this helps you to help me further. It means very little to me.
 
Last edited:

Related to Convert Longitude/Latitude to cartesian x,y

1. How do I convert longitude and latitude coordinates to cartesian x,y coordinates?

To convert longitude and latitude coordinates to cartesian x,y coordinates, you can use the formula:
x = R * cos(lat) * cos(lon)
y = R * cos(lat) * sin(lon)
where R is the radius of the Earth and lat and lon are the latitude and longitude coordinates in radians.

2. What is the purpose of converting longitude and latitude to cartesian x,y coordinates?

Converting longitude and latitude to cartesian x,y coordinates can be useful for various purposes, such as plotting geographic data on a 2D map, performing calculations and measurements, and creating maps and visualizations.

3. Can I use any unit for the longitude and latitude coordinates when converting to cartesian x,y coordinates?

No, when using the formula to convert coordinates, the longitude and latitude values must be in radians. If your coordinates are in degrees, you will need to convert them to radians by multiplying by PI/180.

4. Do I need to consider the Earth's curvature when converting longitude and latitude to cartesian x,y coordinates?

Yes, the Earth's curvature must be taken into account when converting coordinates. This is why the formula for conversion includes the Earth's radius, as well as the cosine and sine functions that account for the curvature.

5. Are there any online tools or resources available for converting longitude and latitude to cartesian x,y coordinates?

Yes, there are various online tools and resources available for converting coordinates, such as websites and apps that offer conversion calculators and maps. Some programming languages also have built-in functions for converting coordinates.

Similar threads

Replies
3
Views
1K
Replies
19
Views
26K
  • Astronomy and Astrophysics
Replies
1
Views
1K
Replies
7
Views
5K
  • Programming and Computer Science
Replies
11
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
2K
Replies
10
Views
3K
  • Introductory Physics Homework Help
Replies
24
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
3K
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
Back
Top