UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Calculate Travel Time, Access 2003    
 
   
FrankVenditti
post Nov 17 2017, 01:44 PM
Post#1



Posts: 44
Joined: 29-August 08
From: Long Island, NY


Greetings Everyone,
Does anyone have, or know of, an AccessVB routine that accepts the Latitude and Longitude coordinates of 2 different locations (from and to) and returns the 'Travel Time' from one location to the other. (Public Transit time would be best)

I can do it by passing the street addresses but I need to do it by passing both sets of Latitude and Longitude coordinates.

It would be nice if the code is portable between MSACCESS 2003, 2010 and 2013, but not absolutely necessary.

Thanks in Advance,
Frank
Go to the top of the page
 
JonSmith
post Nov 17 2017, 01:58 PM
Post#2



Posts: 3,161
Joined: 19-October 10



QUOTE
I can do it by passing the street addresses but I need to do it by passing both sets of Latitude and Longitude coordinates.


I'd imagine you'd need to use some sort of plugin like google maps?
How are you doing it with the street names? I would think you'd be able to go from there and get what you need
Go to the top of the page
 
moke123
post Nov 17 2017, 02:23 PM
Post#3



Posts: 1,148
Joined: 26-December 12
From: Western Ma.,L.I.,N.Y.,Jupiter,Fl.



Frank,
As a former Long Islander I think I can tell you with absolute certainty there is no way to calculate travel time on The L.I.E. or the L.I.R.R.smile.gif

edit: That aside, I think I have something at home that uses the Havesine formula and the Great Cicle distance that gives you the distance between 2 points using Lat/Lng.
I'll have a look tonight and post back if I find it.
Go to the top of the page
 
FrankVenditti
post Nov 17 2017, 03:06 PM
Post#4



Posts: 44
Joined: 29-August 08
From: Long Island, NY


John,
I am indeed using google maps. I have not been able to figure out how to pass the latitude and longitude. It works beautifully with the street address, but since I have the latitude and longitude I would like to pass those parameters to arrive at the Travel Time.
Go to the top of the page
 
RJD
post Nov 17 2017, 03:45 PM
Post#5


UtterAccess VIP
Posts: 7,840
Joined: 25-October 10
From: Gulf South USA


Hi: If you can get what you want with the address, you should be able to substitute latitude and longitude instead and get what you want. For example ... from Denver to Seattle, enter ...

From 39.7392N,104.9903W
To 47.6062N,122.3321W

This works fine manually in Google Maps. I haven't tried to automate from Access, but should be worth a try.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
FrankVenditti
post Nov 17 2017, 03:55 PM
Post#6



Posts: 44
Joined: 29-August 08
From: Long Island, NY


RJD, I'll give that a try. Thanks
Go to the top of the page
 
FrankVenditti
post Nov 17 2017, 03:56 PM
Post#7



Posts: 44
Joined: 29-August 08
From: Long Island, NY


Thanks, I'll be on the L.I.E. in about an hour!
Anything that you can find I'd appreciate.
Thanks.
Go to the top of the page
 
RJD
post Nov 18 2017, 12:20 AM
Post#8


UtterAccess VIP
Posts: 7,840
Joined: 25-October 10
From: Gulf South USA


Frank: Let us know how this works out. Others may need to apply the same approach if it works out.

Regards,
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
moke123
post Nov 18 2017, 08:02 AM
Post#9



Posts: 1,148
Joined: 26-December 12
From: Western Ma.,L.I.,N.Y.,Jupiter,Fl.



Heres a sample db with the haversine and great circle calculations.
Hopefully if you dig through it, It'll make sense.
Post back if you have questions.

Attached File  HaversineFormula.zip ( 58.71K )Number of downloads: 6
Go to the top of the page
 
FrankVenditti
post Nov 20 2017, 09:14 AM
Post#10



Posts: 44
Joined: 29-August 08
From: Long Island, NY


Thanks everyone. FYI: The results of my testing were:

This worked:
strTravelTime = getGoogleTravelTime("1 KNOX STREET #1 STATEN ISLAND NY, 10309", "365 BRIDGE STREET #10G Brooklyn NY, 11201")

This did NOT work:
strTravelTime = getGoogleTravelTime("44.0935501,-70.2134819", "42.6497092,-71.303679")
The return status was "OVER QUERY LIMIT"

The following DID work.
Dim strFromAddress As String
Dim strToAddress As String
strFromAddress = "44.0935501,-70.2134819"
strToAddress = "42.6497092,-71.303679"

strTravelTime = getGoogleTravelTime(strFromAddress, strToAddress)

Thanks again, Happy Thanksgiving.
Go to the top of the page
 
RJD
post Nov 20 2017, 09:18 AM
Post#11


UtterAccess VIP
Posts: 7,840
Joined: 25-October 10
From: Gulf South USA


You are very welcome, from all of us. Glad you found a way to make the L/L work in code.

Continued success with your project. And a Happy Thanksgiving to you as well!

Regards,
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th December 2017 - 03:18 AM