Convert Longitude/Latitude to cartesian x,y

Click For Summary

Discussion Overview

The discussion revolves around converting latitude and longitude coordinates into Cartesian x, y values for plotting on maps. The context includes practical applications related to mapping and geodesy, with a focus on achieving sufficient accuracy for visual representation.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant seeks advice on converting latitude and longitude to x, y coordinates for maps that are 512 pixels by 512 pixels.
  • Another participant suggests researching 'Universal Transverse Mercator' and mentions software for lat/long to UTM X/Y conversions.
  • The original poster notes that their current calculations are off by about 40 pixels and provides their calculation method, which includes adjustments for negative values.
  • A participant questions the type of map projection used, highlighting that most projections distort some features and that simple linear scaling may not yield accurate results.
  • The original poster clarifies that the maps use a gnomonic projection and are Lambert Conformal with specified standard parallels, expressing uncertainty about the implications of this information.

Areas of Agreement / Disagreement

Participants express differing views on the accuracy of the original poster's approach, with some suggesting that the choice of map projection significantly impacts the conversion process. There is no consensus on the best method for achieving accurate x, y values.

Contextual Notes

Participants note the potential inaccuracies in the original calculations and the importance of understanding map projections, but do not resolve the specific mathematical steps or assumptions involved in the conversion process.

3saul
Messages
3
Reaction score
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?
 
Physics news on Phys.org
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'
 
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
 
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.
 
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:

Similar threads

  • · Replies 19 ·
Replies
19
Views
27K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
2K
Replies
2
Views
2K
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 31 ·
2
Replies
31
Views
5K