Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

A client of mine is a courier. they want an estimate of the travel time between a client location and a courier (using a mobile phone that regularly uploads gps co-ords to a filemaker table). Courier may be on a bicycle or in a car. The desire is to prioritize dispatching to people who are in a time-based vicinity of the client.

So, you can assume there's a "Trip" table, with client_gps field, and courier table with "current_location_gps" field. and a time_between calculation.

Any thoughts?

 

 

 

 

When you say "gps co-ords" do you mean latitude and longitude? If so, look for the Haversine formula to calculate the distance between two locations. I am not sure how you translate that to time.

See also http://fmforums.com/topic/71942-limiting-number-of-portal-results/ where a technique for finding records within a given distance to a known point is discussed

I wrote a blog post that includes finding transit distance and time using a web service. That post demonstrates using the Google APIs, but I now recommend the MapQuest Open API first due to more permissive terms of use. The free Google API license terms specifically prohibit using it for the kind of solution you're working on.

Depending on how many couriers you have and how quickly you need to make dispatch decisions, using a web service to estimate transit times for all your couriers may not be practical. As Comment is hinting at, searching within a bounded location box is much faster. I wrote another blog post on the same idea. Since you're prioritizing, this is perfectly reasonable for most places. The peculiar relation between straight-line distance and transit distance in certain very dense cities aside, it's still a strongly monotonic relationship — ranking/sorting based on either usually gives you more-or-less the same order.

Comparing the transit times of cars and bikes is another matter. We expect a car to be faster than a bike to cover the same distance (unless the distance is small and traffic is bad), but how much closer does a bike have to be to be faster? Perhaps you could do a proximity find for the closest car, and the closest bike, and then you only have 2 web service requests to make to compare their estimated transit times.

  • Author

Yep. I mean long and lat. And thanks for the blog links jbante. The haversine formula might be sufficient, and involves no map requests. On the other hand, in some towns (like vancouver, with stupid things like oceans and rivers and mountains in the way), linear distance might not be enough.

 I"m thinking maybe using the haversine to shortlist to a few candidate couriers within a specific distance, then using web service to get transit times on the short list for a final result set.

Thanks for the feedback folks.

 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.