Welcome to MapForums!

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

## Converting Lat/Long to x,y Pixels

This is a discussion on Converting Lat/Long to x,y Pixels within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi all: I have a number of pushpins with their associated lat/long values within mappoint. I want to select a ...

1. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## Converting Lat/Long to x,y Pixels

Hi all:

I have a number of pushpins with their associated lat/long values within mappoint. I want to select a map portion and copy it to the clipboard. I will know the four corners of the map's lat/long coordinates. I will also know the altitude. After I save the map from the clipboard memory as a bitmap or jpeg, I would like to somehow convert the Lat/Long pushpins into x,y coordinates. The lat/long will change periodically and I need an algorithm that will yield good x,y pixel values taking into account the earth's curvature etc.

Any help would be appreciated.

Thanks
Robert

2. Junior Member White Belt
Join Date
May 2004
Posts
9
Ok, so you're generating a map and saving it as an image somewhere.

When you say that you want to convert lat/long to X,Y coords, are you talking about X,Y coords within the map you generated I assume?

You can get the location object of the lat/long you have with the GetLocation method:
http://msdn.microsoft.com/library/de...etLocation.asp

Then you might look into the LocationToX and LocationToY methods:
http://msdn.microsoft.com/library/de...ocationToX.asp
http://msdn.microsoft.com/library/de...ocationToY.asp

This should give you the X,Y coords of the locations you have visible on your map.

Did that helps?

-TG

3. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## Converting Lat/Long to x,y Pixels

Hello TG:

I will try your recommendations. I will post once I get answers.

Thanks
Robert