Closed misaugstad closed 1 month ago
Thanks for this idea Mikey! Would this work internationally? Looks like it may cost per API call?
Right, I forgot to include that info! Looks like they have it everywhere we're in right now except for Ecuador! Here is the coverage: https://developers.google.com/maps/coverage
Unclear whether we should constantly be requesting, or trying to check all of the streets at once and saving it, or requesting at streets as we get to them, and then saving it at that time. Not sure what the cost of the API would end up being right now.
check all of the streets at once and saving it
I'm all for this!
Great re: coverage.
Starting to think about what this would actually look like implementation-wise. If we are determining speed limit once ahead of time, how exactly do we keep track of that? My initial thought is to attach the speed limit to a street segment, doing one API call at the center of each street segment. We could add a new Python script for this purpose, and run it after we check for missing GSV imagery when setting up a database. The script would likely very closely mirror the check_streets_for_imagery.py
script.
For visuals, would love to have a speed limit sign in the top-right corner of the GSV window with the speed limit written on it. Do speed limit signs look different in different regions? :eyes:
I like this. And sounds good to me. I've traveled to many countries across the world (5 of 7 continents) and speed limit signs are reasonably similar.
I think white rounded rectangle with the following format would work well:
OOPS so sorry @justyeethan it looks like we are not actually allowed to use Google's Roads API (and therefore speed limits API). We would need some sort of "asset tracking" contract with Google link.
On June 3, 2019, a new Asset Tracking plan was launched on Google Maps Platform. This plan is only available for customers with large fleets (thousands of assets) and a specific use case. ... Notice: The Speed Limit service is available to all customers with an Asset Tracking license
The documentation doesn't make it clear enough that you can only use the API if you are part of an asset tracking license, but that is indeed the case.
I am looking into alternative data sources.
@justyeethan can you try out this website to see if we can get the info we need from it? It's called HERE. It looks like we'd want the "Map Attributes API". It sounds like you can create a free account and get 2.5k free monthly requests without providing payment info. But lmk if there's an issue there!
If that doesn't work, then we can just plan to include whatever data we can get from OSM when creating new databases. Mostlylikely the way we'll do that is:
@misaugstad I'm currently experimenting with using OSM's overpass API to get speed limit info through the maxspeed
tag.
I was thinking of making a request on every street view "movement" to fetch the speed limit at the current coordinate point, then displaying it. I'd probably need to create a new endpoint like /speedlimit?...
. I realize that this might be too request heavy or slow. What do you think?
I think it's worth a shot! One thing you could also try to reduce the number of requests is to try to request using the osm_way_id of the street that the user is on. If we get a response for it, we can use that speed limit for the entire street that the user is on. But I wouldn't worry about making that improvement until we have it working by requesting at every point.
I don't think that you should need to make a new endpoint in Project Sidewalk, though. You should be able to just query the Overpass API using JavaScript, right?
I don't think that you should need to make a new endpoint in Project Sidewalk, though. You should be able to just query the Overpass API using JavaScript, right?
I was worried I might run into CORS issues but upon further inspection, it seems to be okay :)
Oh and you may find some HTML/styling for the speed limit signs in #3300! I ended up taking the speed limit stuff out of this PR, so you won't see it in the Files Changed tab, but you should be able to find the code in the commit history.
Made a PR: #3611
Brief description of problem/feature
Google has a speed limit API that we can request using lat/lngs. This could be nice to add, maybe in the top-right corner? We initially thought of this as useful when determining whether or not to include Missing Curb Ramp labels. We could include it on the Validate page as well, specifically when looking at Missing Curb Ramp labels.
I could also see this being useful in the context of crosswalks or pedestrian signals in the future if we start labeling their absence!
Looking at the API, they have a parameter that we can use to get the response in either MPH or KPH!