Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature - Discussion] Roughly Conform to Speed Limits in Drive Mode #139

Open
daturadev opened this issue Oct 28, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@daturadev
Copy link

First of all, I love this application. Beautifully designed.

Lately, I've been considering doing some research and figuring a way to adjust speeds based on current roads/highways being traveled - adjusting to walking speeds if ever off-road, varying over/under the speed-limit in a realistic fashion. This would require me to research the source code and learn how the GPS manipulation works - if it is even possible to scrape speed-limits using whatever API/module/framework is used in this application. I am willing to contribute, but it would take a considerable amount of time to do on my own.

Does anybody else think this concept is worth implementing? Anyone interested in contributing? I think this would add an insane level of realism to the application.

@daturadev daturadev added the enhancement New feature or request label Oct 28, 2022
@Schlaubischlump
Copy link
Owner

Schlaubischlump commented Oct 28, 2022

Hi @daturadev,

Great that you like the application !

I have thought about this feature, but sadly I don't have time to implement it myself and do the necessary research to find a working API.

Information

The speed handling is done in the LocationSpoofer library which you can find on my github page as well. The LocationSpoofer class has a speed property which you can change while the location is updated.

Internally the route is calculated using MapKit (provided by Apple). MapKit does not provide a way to get a speed limit or information about the route you are traveling on.

How could this feature be implemented?

  1. Find an API that provides speed limit information (OpenStreetMap probably has one)
  2. Get the current spoofed location from the LocationSpoofer instance
  3. Use the API in 1 to fetch the speed limit for the current location retrieved in 2
  4. Change the speed property of the LocationSpoofer instance to the speed limit retrieved in 3
  5. Repeat step 1 to 4 if the location was changed successfully (or changed significantly) or after a period of time to update the speed limit

If you or someone else feels up to the task to implement a prototype feel free to ask me for support.

Edit:
Maybe the Overpass API could work:

Overpass Example:
https://stackoverflow.com/questions/15749133/get-speed-limits-from-openstreetmap

Swift API:
https://github.com/younata/SwiftOpenStreetMap

@Schlaubischlump Schlaubischlump changed the title [Feature Suggestion] Roughly Conform to Speed Limits in Drive Mode [Feature] Roughly Conform to Speed Limits in Drive Mode Oct 28, 2022
@Schlaubischlump Schlaubischlump changed the title [Feature] Roughly Conform to Speed Limits in Drive Mode [Feature - Discussion] Roughly Conform to Speed Limits in Drive Mode Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants