You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the Access Score Street/Neighborhood APIs, on the back end, we are actually grabbing all labels within the bounding box specified in the query parameters. This can mean querying for way more labels than are necessary. We should update our queries to only get labels that are relevant to the streets/neighborhoods requested.
I believe that this was done to keep things more simple; we get to just reuse the same query we use for the Attributes API. But it's causing some performance problems. And in rare cases (in the Streets API) it can mean missing out on a couple labels on margins.
I believe that the changes should look something like:
For the Streets API, get the list of streets in the bounding box, then join the streets with the label table, since each label has a street_edge_id denoting the closest street to that label.
For the Neighborhoods API, we could either do an intersection in the same way (region -> street_edge_region -> label tables), or we could do a geographic intersection between the geometries in the region and label tables. I'm not super picky on which we choose.
Either way, I believe that we could potentially reuse some SQL code. Maybe this means building the query in getGlobalAttributesInBoundingBox(). And/or it might mean reusing the queries in selectStreetsIntersecting() and getNeighborhoodsWithin().
The text was updated successfully, but these errors were encountered:
Brief description of problem/feature
For the Access Score Street/Neighborhood APIs, on the back end, we are actually grabbing all labels within the bounding box specified in the query parameters. This can mean querying for way more labels than are necessary. We should update our queries to only get labels that are relevant to the streets/neighborhoods requested.
I believe that this was done to keep things more simple; we get to just reuse the same query we use for the Attributes API. But it's causing some performance problems. And in rare cases (in the Streets API) it can mean missing out on a couple labels on margins.
I believe that the changes should look something like:
label
table, since each label has astreet_edge_id
denoting the closest street to that label.region
->street_edge_region
->label
tables), or we could do a geographic intersection between the geometries in theregion
andlabel
tables. I'm not super picky on which we choose.getGlobalAttributesInBoundingBox()
. And/or it might mean reusing the queries inselectStreetsIntersecting()
andgetNeighborhoodsWithin()
.The text was updated successfully, but these errors were encountered: