Community of VE/MapPoint Users and Developers
This is a discussion on Pixels [xy] to Lat/Long and vice Versa within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi all I want to select a map and copy the image into a picturebox. I know the four corners ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| I want to select a map and copy the image into a picturebox. I know the four corners of the map's lat/long coordinates. I want to return the Lat/Long coordinates of any point on the picture (for e.g. on click I would like to return the Lat/Long of the pixel clicked)' I will also need to pass Lat/Long coordinates to my system and convert these coordinates to pixels and show them on map. Any help would be appreciated. Thanks Bramu |
| |||
| Re: Pixels [xy] to Lat/Long and vice Versa
Hi, You can use Copy or CopyMap to copy the map to the clipboard. Then you can copy it to your picture box. You know the coordinates of 4 corners, you also know the width and height of your picturebox, so you can calculate the amount of latitude per pixel and for horizontal the amount of longitude per pixel. You have to recalculate this after every resizing of the box. In the Click event you know the x,y coordinates of the mouse cursor, so there you can given on the calculation you did before calculate the real lat + long of the clicked position. Back in mappoint you use GetLocation method to find the Location for these coordinates.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Pixels [xy] to Lat/Long and vice Versa
Hi, What exacly does not works with a very high altitude ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Pixels [xy] to Lat/Long and vice Versa
The translation from lat/long to pixels and vice versa. To give you an example: I had all europe visible (very high altitude) and when I clicked on Italy (to Zoom to italy) the returned image was not that of italy but another place. If I am at a low altitudes, it works fine. AT low altitudes, wherever I clicked it is ok. |
| |||
| Re: Pixels [xy] to Lat/Long and vice Versa
Hi, What was wrong the latitude or the longitude ? At high altitudes if you dont calculate a correction the longitude will be wrong. Latitude will always be ritht. You have to make a correction because 1 degree lat == 1 degree long only on the equator. If you get away from the equator you have to multiply longitude by the cosinus of the latitude to get the correct position (or is it the sine ?, I'm busy with something else at the moment so I can mistake, but you can try this in seconds).
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Pixels [xy] to Lat/Long and vice Versa
Bramu, Why don't you use XYToLocation? When a user clicks, you catch the mouseclick eventhandler and get the xy of the mouse and than call XYToLocation method of Map object. This is possible with Mappoint 2006. |
| |||
| Re: Pixels [xy] to Lat/Long and vice Versa Yes to calculate the distance. And in your case also because you start from pixel.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| lat or long, pixels, versa, vice |
| ||||
| Posted By | For | Type | Date | |
| vice versa - Zymboo | This thread | Refback | 02-25-2008 07:32 AM | |
| Using MS MapPoint in PowerBuilder - MapPoint Articles - MP2K Magazine | This thread | Refback | 04-05-2007 02:22 PM | |
| Working With Excel and MapPoint - MP2K Magazine | This thread | Refback | 03-29-2007 06:21 AM | |
| Map Visitors - Powered by Virtual Earth | This thread | Refback | 03-28-2007 10:32 AM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 03-28-2007 09:21 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Converting Lat/Long to x,y Pixels | Anonymous | MapPoint 2006/2009 Discussion | 2 | 09-08-2004 05:24 PM |
| Convert to Lat/Long | wallacech | MapPoint 2006/2009 Discussion | 1 | 02-26-2004 01:37 PM |
| Lat. and Long. | Anonymous | MapPoint 2006/2009 Discussion | 1 | 02-06-2004 03:09 AM |
| Lat/Long | lgeeck | MapPoint 2006/2009 Discussion | 1 | 07-01-2003 10:03 AM |
| get lat./long. | Anonymous | MapPoint 2006/2009 Discussion | 1 | 11-19-2002 06:56 AM |