ProjectSidewalk / SidewalkWebpage

Project Sidewalk web page
http://projectsidewalk.org
MIT License
84 stars 24 forks source link

Many Streets Not Included in New Taipei and Keelung #3301

Open jonfroehlich opened 1 year ago

jonfroehlich commented 1 year ago

Now that we have RouteBuilder, it's easy to check which streets we have in our Project Sidewalk database available for routing and which we do not.

In New Taipei, I just checked and it seems like quite alot of streets are not included. The gray are the included streets, the white are excluded.

image

image

It seems to be even more pronounced in Keelung (again, the gray overlays are the included streets):

image image

This is related to a recent Issue we were discussing where Seattle streets are not included either (but I can't seem to find that ticket).

This seems like a pretty important Issue to resolve before our Taiwan partners begin recruiting people, advertising, etc.

jonfroehlich commented 1 year ago

I found the related Issues I was looking for, including https://github.com/ProjectSidewalk/SidewalkWebpage/issues/1814#issuecomment-513384471 and https://github.com/ProjectSidewalk/SidewalkWebpage/issues/1814.

To me, this seems like a high priority as we can't really cast our system as evaluating all possible sidewalks in a city if our road networks are incomplete. For Seattle, we should retrospectively fix. For New Taipei, Keelung, Teaneck, and Burnaby, we have an opportunity to fix them before we deploy.

I believe @misaugstad checks the Project Sidewalk road networks before deploying (as part of our standard deployment protocol) but we should also involve our partners in this so that we (the PS team + our local partners) are confident and comfortable with the included streets.

misaugstad commented 1 year ago

Those streets are marked as either "service roads" or "alleys". I'm sure that some are misclassified as such, but we don't have any programmatic way of dealing with that other than casting a super wide net by including all of those minor road types. I messaged our partner in Taiwan to ask what they think about the situation.

jonfroehlich commented 1 year ago

@misaugstad and I spoke this week during our 1:1 about this. Currently, our process is to use OSM to download all streets of given type within a lat,lng bounding box. The currently supported streets are (see this Google Colab):

roadTypes = ['trunk', 'primary', 'secondary', 'tertiary', 'residential', 'unclassified', 'pedestrian', 'living_street']

I asked Mikey if Google Maps had an API to return all streets within an area—side-stepping OSM altogether. Neither of us were sure. I just asked Google Bard and here's what it said:


No, there is no Google Maps API call that will specifically return all streets within a lat, lng bounding box. However, you can use the Places API to get a list of all places within a bounding box, and then filter the results to only include streets.

The following code shows how to do this:

const bbox = {
  lat_lo: -34.0,
  lng_lo: 151.0,
  lat_hi: -33.0,
  lng_hi: 152.0,
};

const request = new google.maps.places.PlacesSearchRequest({
  bounds: bbox,
  types: ["street"],
});

request.setFields(["place_id", "name"]);

request.execute((results, status) => {
  if (status === google.maps.places.PlacesServiceStatus.OK) {
    for (const result of results) {
      console.log(result.name);
    }
  }
});

This code will first create a bounding box object with the latitude and longitude coordinates of the bounding box. Then, it will create a PlacesSearchRequest object and set the bounds and types properties. The bounds property specifies the bounding box, and the types property specifies the types of places that you want to return. In this case, we are only interested in streets, so we set the types property to ["street"].

Finally, we call the execute() method on the PlacesSearchRequest object. This will return a list of places that are within the bounding box and are of the specified types. The code then iterates through the results and prints out the name of each street.

This code will only return a list of streets that are known to Google Maps. If there are streets that are not in the Google Maps database, then they will not be returned by this code.

image
misaugstad commented 1 year ago

There's a nuanced discussion of the different OSM way types in #2547, as I did a larger analysis of them. I looked at a lot of these specifically in Burnaby. @jonfroehlich do you think it's a good use of my time soon to sample some streets from New Taipei & Keelung to see if I see different results? Or should we just close this issue for now?