MapPoint Forums

MapForums

Community of VE/MapPoint 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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #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: 2,322
Blog Entries: 1
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: 2,322
Blog Entries: 1
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


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 04:16 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

Catered Chalet Ski Holidays
Looking for catered chalet ski holidays? Your search is over! Here at Holiday Hypermarket you can choose your style of accommodation with ease.

Honeymoon Holidays
Book your Honeymoon holiday with Travel Counsellors. A personal advisor will help you plan the perfect honeymoon holiday.

Cheap Holidays to Turkey
If you’re looking for cheap holidays to Turkey then dealchecker.co.uk is the place for you! Our search helps you see real prices from the UK’s top holiday companies all in one go.

Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!

Cheap Cyprus Holidays
Finding cheap Cyprus holidays can be difficult unless you know where to look and where to book. With ulookubook.com you can conduct a simple search to find the latest holiday deals to your particular destination.

Holidays Package
Make use of our service at Travel.co.uk to compare holidays. We can find you a package deal that will delight you.

Fuerteventura Holidays
Visit one of the closest Canary Islands to Africa! Book Fuerteventura holidays at On The Beach!


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