MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




getting the coordinates of puspins within MapPoint

This is a discussion on getting the coordinates of puspins within MapPoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have a set of customer-defined pushpins and I want the coordinates of them. I have some code-snipplet (com-addin .dll ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-08-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
getting the coordinates of puspins within MapPoint

I have a set of customer-defined pushpins and I want the coordinates of them. I have some code-snipplet (com-addin .dll with VB) for one pushpin. Everybody out there who did the stuff I explained before. Or has an idea where to start?

Thanks a lot

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-08-2003
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,470
Blog Entries: 1
The simplest way would probably be to get the Pushpin Tool: http://www.mp2kmag.com/downloads/pushpin.tool/

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-10-2003
Junior Member
Yellow Belt
 
Join Date: Jan 2003
Posts: 17
Send a message via ICQ to brianmcg
How about if you want to get the Lat/Long of pushpins programatically?

I have considered using the .LocationToX and .LocationToY methods and interpolating values by referencing a set of pushpins with known coordinates, but this would be approximate at best. MapPoint for .NET has API calls which allow access to the Lat/Long of a location.

Any ideas? Please?

Brian.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 02-06-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Lon/Lat from Location

Picked this up from the web somewhere:

Option Explicit

Const PI = 3.14159265358979
Dim locNorthPole As MapPoint.Location
Dim locSantaCruz As MapPoint.Location ' Center of western hemisphere
Dim dblHalfEarth As Double ' Half circumference of the earth (as a sphere)
Dim dblQuarterEarth As Double ' Quarter circumference of the earth (as a sphere)

' Compute latitude and longitude given a location object
' Author: Gilles Kohl
' (gilles@compuserve.com)
'
' This code is copyrighted freeware - use freely, but please leave this
' header intact. Suggestions and comments welcome.

Function Arccos(x As Double) As Double
If x = 1 Then
Arccos = 0
Exit Function
End If
Arccos = Atn(-x / Sqr(-x * x + 1)) + 2 * Atn(1)

End Function

Function CalcPos(objMap As MapPoint.Map, locX As MapPoint.Location, dblLat As Double, dblLon As Double) As Boolean

Dim l As Double
Dim d As Double

On Error GoTo CalcPosError

' Check if initialization already done
If locNorthPole Is Nothing Then
Set locNorthPole = objMap.GetLocation(90, 0)
Set locSantaCruz = objMap.GetLocation(0, -90)

' Compute distance between north and south poles == half earth circumference
dblHalfEarth = objMap.Distance(locNorthPole, objMap.GetLocation(-90, 0))

' Quarter of that is the max distance a point may be away from locSantaCruz and still be in western hemisphere
dblQuarterEarth = dblHalfEarth / 2
End If

' Compute latitude from distance to north pole
dblLat = 90 - 180 * objMap.Distance(locNorthPole, locX) / dblHalfEarth

' Compute great circle distance to locX from point on Greenwich meridian and computed Latitude
d = objMap.Distance(objMap.GetLocation(dblLat, 0), locX)

' convert latitude to radian
l = (dblLat / 180) * PI

' Compute Longitude from great circle distance
dblLon = 180 * Arccos((Cos((d * 2 * PI) / (2 * dblHalfEarth)) - Sin(l) * Sin(l)) / (Cos(l) * Cos(l))) / PI

' Correct longitude sign if located in western hemisphere
If objMap.Distance(locSantaCruz, locX) < dblQuarterEarth Then dblLon = -dblLon

CalcPos = True

CalcPosExit:
Exit Function

CalcPosError:
CalcPos = False
MsgBox Err.Description, , "CalcPos"
Resume CalcPosExit

End Function

Function InitialiseCalcPos() As Boolean
'1.1
On Error Resume Next

Set locNorthPole = Nothing
Set locSantaCruz = Nothing

End Function
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 02-06-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Lat/long from location

Just remembered where I found it. It was here!!! (http://www.mp2kmag.com/articles.asp?ArticleID=13)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
coordinates, mappoint, puspins


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Getting a MapPoint.Location from a set of coordinates BobFromBoston MapPoint 2006/2009 Discussion 2 07-20-2005 04:19 PM
Getting edge coordinates of zoomed in screen in Mappoint '04 jliao81 MapPoint 2006/2009 Discussion 0 07-04-2005 11:17 AM
Extracting GPS coordinates from MapPoint Anonymous MapPoint 2006/2009 Discussion 1 03-28-2005 01:44 AM
newbie wants help in getting mappoint to return coordinates Anonymous MapPoint 2006/2009 Discussion 1 05-02-2003 03:36 PM
Can I use MapPoint to generate map coordinates on a book map Anonymous MapPoint 2006/2009 Discussion 3 04-23-2003 07:33 PM


All times are GMT -5. The time now is 03:54 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54