Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Drawing Drivetime Zones Around a List of Lat/Lon's

This is a discussion on Drawing Drivetime Zones Around a List of Lat/Lon's within the MapForums Plus Downloads forums, part of the MapForums Plus category; Eric Thanks for this. In the meantime I've been struggling with my VBA and have converted to EU (and realise ...

  1. #11
    Kirsten Tisdale is offline Junior Member Yellow Belt
    Join Date
    Aug 2009
    Posts
    20

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    Eric

    Thanks for this. In the meantime I've been struggling with my VBA and have converted to EU (and realise that a problem before was asking for drivetimes round US addresses when I have European version!). And can convert postcodes to lat longs. But... it would be good to set speeds before doing the drivetimes. Is this possible?

    Kirsten

  2. #12
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    Did you try setting the options via the menu? Did that have an effect?
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  3. #13
    Kirsten Tisdale is offline Junior Member Yellow Belt
    Join Date
    Aug 2009
    Posts
    20

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    I tried setting in MP inc using a speed add-on which sets default, but it made no diff to drivetime. I also tried integrating a little old macro, but that required MP to be open, and your v2 VBA up top opens a fresh copy. Then my VBA knowledge gave out - I'm going on a course at the end of the month! K

  4. #14
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    Yes, see the Routing Options. I'm not 100% sure these speeds affect the Drivetime polygons however. Programmatically there is the DriverProfile object which does the same thing.
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  5. #15
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    Quote Originally Posted by Kirsten Tisdale View Post
    I tried setting in MP inc using a speed add-on which sets default, but it made no diff to drivetime. I also tried integrating a little old macro, but that required MP to be open, and your v2 VBA up top opens a fresh copy. Then my VBA knowledge gave out - I'm going on a course at the end of the month! K
    Hehe, do you want to post the code you have so far? I can give some pointers.
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  6. #16
    Kirsten Tisdale is offline Junior Member Yellow Belt
    Join Date
    Aug 2009
    Posts
    20

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    Eric - thanks for all your help with this - here is relevant code:

    Code:
    Option Explicit
    Public oApp As MapPoint.Application
    Public oMap As MapPoint.Map
    Public oRoute As MapPoint.Route
    
    Sub SetMappointSpeeds()
    On Error Resume Next
    Set oApp = GetObject(, "MapPoint.Application") 'Add
    If Err.Number = 0 Then
    Set oMap = oApp.ActiveMap
    Set oRoute = oMap.ActiveRoute
    oApp.Units = geoKm
    Call SetSpeeds(oRoute)
    Set oRoute = Nothing
    Set oMap = Nothing
    Set oApp = Nothing
    End If
    End Sub
    
    Sub SetSpeeds(oRoute As MapPoint.Route)
    'put the road speeds into Mappoint
    
    oRoute.DriverProfile.Speed(1) = InputBox("Enter motorway speed in kph")
    oRoute.DriverProfile.Speed(2) = InputBox("Enter dual carriageway speed")
    oRoute.DriverProfile.Speed(3) = InputBox("Enter Main road speed")
    oRoute.DriverProfile.Speed(4) = InputBox("Enter Minor road speed")
    oRoute.DriverProfile.Speed(5) = InputBox("Enter street speed")
    ' If MainForm.DislikeFerriesCB = True Then
    ' oRoute.DriverProfile.PreferredRoads(geoRoadFerry) = 0#
    ' End If
    End Sub
    
    Private Sub CommandButton1_Click()
    Call SetMappointSpeeds
    End Sub

  7. #17
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    Where is it failing or what do you want to do or need help with specifically? Thanks! Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  8. #18
    Kirsten Tisdale is offline Junior Member Yellow Belt
    Join Date
    Aug 2009
    Posts
    20

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    Eric

    What I was originally hoping to do was to set the speeds using this code or similar, and then create drivetime zones using those speeds with your code probably in an already open map. Sounds as if I might be attempting the impossible given your comments a couple of posts ago. And also sounds as if I've not realised a potential issue with drivetime zones.

    Kirsten

  9. #19
    Kirsten Tisdale is offline Junior Member Yellow Belt
    Join Date
    Aug 2009
    Posts
    20

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    Eric, driving speeds do change drivetime zones - just tried. Phew, worried myself there! K

  10. #20
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Drawing Drivetime Zones Around a List of Lat/Lon's

    So are you all good with the setting speeds part and just need a loop to do the drivetime zones?

    Here is the essential part of the code for the new tool I posted earlier.

    Where are your postal codes coming from? Is it an Excel list or a table?

    Code:
      'test to see if there is a postcode in column 3 (B) for the current row
      Do While Cells(nReadRow, 3) <> ""
        
        
        fDriveTime = Cells(nReadRow, 5)
        nColor = AssignColor(Cells(nReadRow, 6))
        
        Set objLoc = objMap.FindAddressResults(, , , , Cells(nReadRow, 3), Cells(nReadRow, 4))(1)
      
        objMap.AddPushpin objLoc, Cells(nReadRow, 2)
    
        objMap.Shapes.AddDrivetimeZone objLoc, fDriveTime * geoOneMinute
        objMap.Shapes.Item(nShapeIndex).Fill.Visible = True
        objMap.Shapes.Item(nShapeIndex).ZOrder (geoSendBehindRoads)
        objMap.Shapes.Item(nShapeIndex).Fill.ForeColor = nColor
        objMap.Shapes.Item(nShapeIndex).Line.ForeColor = vbBlack
        objMap.Shapes.Item(nShapeIndex).Line.Weight = 1
        
        nShapeIndex = nShapeIndex + 1
        nReadRow = nReadRow + 1
      Loop
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Automate drivetime zones
    By econalan in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 08-30-2005, 01:20 PM
  2. Exclusive Drivetime zones
    By IamRascal in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-24-2005, 12:18 PM
  3. Drivetime Zones
    By Anonymous in forum Wish List
    Replies: 2
    Last Post: 01-03-2003, 04:23 PM
  4. Find Nearby and DriveTime zones.
    By DaveB in forum Wish List
    Replies: 0
    Last Post: 12-20-2002, 09:30 AM
  5. Exporting info outside drivetime zones
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 10-08-2002, 11:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 60 61 62 63 64 65 66