MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Getting Lat/Lon from a given address

This is a discussion on Getting Lat/Lon from a given address within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I use this routine in my application: Private Sub Befehl0_Click() Dim objApp As New MapPoint.Application Dim objFindResults As MapPoint.FindResults objApp.Visible ...


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

Today's Posts Twitter Feed 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 08-13-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Getting Lat/Lon from a given address

I use this routine in my application:

Private Sub Befehl0_Click()
Dim objApp As New MapPoint.Application
Dim objFindResults As MapPoint.FindResults

objApp.Visible = False
objApp.UserControl = True

'Erstes Ergebnis der Suche ausgeben
Set objFindResults = objApp.ActiveMap.FindAddressResults("Römerstraße 12", "Düren", , , "52349", geoCountryGermany)
MsgBox "Das erste Element in der Ergebnisliste lautet: " _
+ objFindResults.Item(1).Name
objApp.Application.Quit
End Sub


But instead of the name of I would like to get back Lat/Lon. Is this possible?
Ralf
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 08-13-2003
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 3,041
Blog Entries: 2
It is.. see Gilles Kohl's article "A More Compact Method for Obtaining the Lat/Lon" in the articles section..

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 08-13-2003
Junior Member
White Belt
 
Join Date: Jun 2003
Posts: 9
I saw the article but isn´t there simpler way to get lat/lon from the FindAdressResult?
I don´t understand how I can get lat/lon from the given addresses with Gill Kohl´s routine.
Ralf
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 08-13-2003
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 3,041
Blog Entries: 2
There's not an easier way.. err, there are some compiled tools that use Gilles routine that you can use without programming, but using programming Gilles CalcPos is the way to go.

First create the Location or Pushpin and then use the CalcPos function to get the lat/lon. You could probably make a wrapper so it's all done in one step.

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
  #5 (permalink)  
Old 08-18-2003
Junior Member
White Belt
 
Join Date: Jun 2003
Posts: 9
Sorry but can you help me again?
I´m not able to call the function CalcPos.

Here is my routine:

Private Sub Befehl0_Click()
Dim MPApp As New MapPoint.Application
MPApp.Visible = True
MPApp.UserControl = True
Dim oMap As MapPoint.MAP, oLoc As Object, Strasse As String, Plz As String, stadt As String
Dim oPin As MapPoint.Pushpin
Dim objResults As MapPoint.FindResults
Dim strRevAddress As String
Dim lat As Double, lon As Double
Set oMap = GetObject(, "MapPoint.Application").ActiveMap
Strasse = "Römerstraße 12"
Plz = "52351"
Ort = "Düren"
Set oLoc = oMap.FindAddressResults(Strasse, Ort, , , Plz, geoCountryGermany)
Call CalcPos(oMap, oLoc.Location, lat, lon)
MsgBox oLoc.Item(1).Name & lat & " " & lon
End Sub


I allways get an error.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 09-12-2003
Junior Member
White Belt
 
Join Date: Aug 2003
Posts: 5
For the second argument of calcpos try using a mappoint.location object.
Define for instance the following

dim oLoc as mappoint.location

then do everything else the same and in the calcpos call just use oLoc instead of oLoc.location

hope this works
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
address, lat or lon


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
odd and even address chris2 MapPoint 2006/2009 Discussion 1 05-24-2006 11:07 AM
Anyone willing to look up an address for me? Anonymous MapPoint 2006/2009 Discussion 11 02-07-2004 07:09 PM


All times are GMT -5. The time now is 12:38 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Dalaman Holiday
Enjoy a wonderfully peaceful Dalaman holiday... Book through UlookUbook and save!



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 55 56 57 58 59