Community of VE/MapPoint Users and Developers
This is a discussion on As the crows flies and rail within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; MapPoint is a very nice tool to find road distances between two cities. Is there any way to do the ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Is there any way to do the same things with railway or as the crows flies distances? Thanks for your help A. Ouellet |
| |||
| Re: As the crows flies and rail
Hi, You can use Distance or DistanceTo methods.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: As the crows flies and rail Hi Wilfred and everybody, I succeed to find route and as the crow flies distances between two cities. However, I haven't any idea on how to find railway distance. I possibly also need to find maritime distance between two ports. Is there a way to do that? Thanks a lot, A. Ouellet P.S: I am a french Canadian. I am sorry for all possible English mistakes |
| |||
| Re: As the crows flies and rail
I just forgot. Here is the code I use. It work good. A. Ouellet Private Sub CommandButton1_Click() Dim oApp As MapPoint.Application Dim objMap As MapPoint.Map Dim objLocOne As MapPoint.Location Dim objLocTwo As MapPoint.Location Dim objRoute As Route Dim LocOne As String Dim LocTwo As String Dim sFileName As String Dim Distance As Long Dim i As Integer Set oApp = CreateObject("MapPoint.Application.NA.11") Set objMap = oApp.NewMap Set objRoute = objMap.ActiveRoute i = 3 Do Until Cells(i, 1) = 0 'As the crow flies LocOne = Cells(i, 1) LocTwo = Cells(i, 2) Set objLocOne = objMap.FindResults(LocOne).Item(1) Set objLocTwo = objMap.FindResults(LocTwo).Item(1) objMap.AddPushpin objLocOne objMap.AddPushpin objLocTwo Distance = objMap.Distance(objLocOne, objLocTwo) Cells(i, 3) = Distance Cells(i, 4) = Distance * 1.609344 'km 'Route distances objRoute.Waypoints.Add objMap.FindResults(LocOne).Item(1) objRoute.Waypoints.Add objMap.FindResults(LocTwo).Item(1) objRoute.Calculate Distance = objRoute.Distance Cells(i, 5) = Distance Cells(i, 6) = Distance * 1.609344 'km i = i + 1 Loop 'Insert map in Excel objMap.DataSets.ZoomTo 'Zoom sur la map sFileName = "\\Exchange-srv\Alexandre\Recherche\MapPoint\Map.ptm" objMap.SaveAs sFileName ActiveSheet.OLEObjects.Add(Filename:=sFileName, Link:=False,_ DisplayAsIcon:=False).Select End Sub |
| |||
| Re: As the crows flies and rail
Hi, For railway distance I think the only possible way is to put Location objects and calculate distance in segments. What exacly do you mean by 'maritime distance' ? Do you mean the distance in Nautical miles ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: As the crows flies and rail Hi Wilfried, For the railway distance, that’s what I though. By 'maritime distance', I mean distance between two ports in km. As a crow flies distance is a good approximation, but imprecise. For example, look at the way to get the Montreal port when coming from Europe. Thank you again, A. Ouellet P.S: Sorry again for english mistakes |
| |||
| Re: As the crows flies and rail
Hi, I understeand, thanks for clarify. I think with maritime distance it will be the same problem as for rail distance.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| ||||
| Posted By | For | Type | Date | |
| Minnesota Map and Map of Minnesota - MapPoint State Map Gallery - MP2K Magazine | This thread | Refback | 05-27-2007 04:58 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 05-25-2007 10:03 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Distances 'as the crow flies' | TRK | MapPoint 2006/2009 Discussion | 4 | 01-20-2007 03:25 AM |
Catered Ski Holidays
Book catered ski holidays online at Holiday Hypermarket. Our powerful ski holidays search will find you great deals for low prices.
Business Travel Agent
Leading Business Travel Agent. Personal service is at the heart of our business. Talk to one of our travel agents today.
Cape Town Flight
Book a Cape Town Flight for great value when you book through dealchecker.co.uk. It doesn't take long to find the latest great deals for you.
Barbados Holidays
Barbados holidays can be a wonderful break from the rat race or an exciting, action packed adventure. Plan the perfect holiday in Barbados.
Cheap Morocco Holidays
Cheap Morocco holidays may be the answer to your cheap holiday search. With sunshine throughout most of the year it can be great value if you avoid the peak season. Why not include a trip to the small tranquil town of Chefchaouen Tangier in your visit?
Holiday Comparison
We can help you with holiday comparison when you check out the options at Travel.co.uk
Holidays in Florida
Take a break! Enjoy stunning coastline! Info on holidays in Florida available at On The Beach!