Convert Longitude/Latitude to cartesian x,y

AI Thread Summary
To convert latitude and longitude to Cartesian coordinates for 512x512 pixel maps, understanding the map's projection is crucial, as it affects accuracy. The maps in question use a gnomonic projection, specifically Lambert Conformal, which distorts certain features. Current calculations are yielding inaccuracies of about 40 pixels, indicating that a simple linear scaling approach is insufficient. For better results, utilizing tools like CORPSCON for UTM conversions is recommended, as they can handle the complexities of geodesy. Accurate conversion requires considering the map's specific projection and applying appropriate mathematical adjustments.
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?
 
Mathematics 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:
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Back
Top