azavea / pfb-network-connectivity

PFB Bicycle Network Connectivity
Other
40 stars 11 forks source link

Properly filter neighborhood geojson endpoints based on status and visibility #547

Open CloudNiner opened 7 years ago

CloudNiner commented 7 years ago

In #544 we added a global exclude of Neighborhoods with visibility=HIDDEN for the geojson endpoints. However, these endpoints should also all filter on the following:

Each of the three geojson endpoints should have the same filtering behavior.

KlaasH commented 7 years ago

My memory of the situation is that the GeoJsonViews use raw queries because the GeoJSON serialization was problematically slow and got way faster when done in Postgres instead of Django. One approach to filtering and DRYing might be to use a queryset as far as possible then get an ID list to feed to a raw query. Or maybe there's a cleaner solution, but it at least seems preferable to adding a bunch of filtering into the raw query. The total count wouldn't be very high (hundreds).