Sign in to follow this  
Robinhood

Problem about convertion of coordinate

Recommended Posts

I want to convert longitude and latitude coordinate into a 2D X-Y system. So I need to know how far one coordinate(longitude and latitude sysem) is from another horizontally and vertically.Does anyone kown this?May it be something about Map Making?Any link or articles will be appreciated.

Share this post


Link to post
Share on other sites
Think about it terms of mapping one square into another square. That is if you had a point 75% in the x direction on a square and you want it to map to the same relative spot on a square twice as large, how would you do it?

To break it down even further: Think about the problem of mapping a point on a line to the same relative point on another line of a different size

|--*--| <-- length 5, point at 3

Map to this
|----------| <-- length 10, point would be where?

Well, the percentage the point on the first number line is 3/5 or 60%, so on the second number line you would want it to be 60% on that line. or 6/10.

In code:

float perFirstLine = value / lengthFirstLine;
float xLocationSecondLine = perFirstLine * lengthSecondLine;

The same can be applied to the y coordinate.

Share this post


Link to post
Share on other sites
It depends on how the latitude and longitude are constructed. Assuming the map uses a Mercator projection, this might help.

Share this post


Link to post
Share on other sites
Are you referring to the longitude and latitude as locations on Earth ?

Here is what you might find useful:

http://www.ngs.noaa.gov/TOOLS/Inv_Fwd/Inv_Fwd.html

From this site you can find a code to calculate a distance and a direction (in XY-coordinate) between two coordinates presented as longitude and latitude.

With this information, you'll be able to map position to the XY-coordinates.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this