Open CloudNiner opened 7 years ago
My memory of the situation is that the GeoJsonView
s 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).
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:latest=True
flag matching the analysis job endpoint, that allows us to filter to only neighborhoods with a complete AnalysisJobvisibility=PRIVATE
from the results if the request is not authenticatedEach of the three geojson endpoints should have the same filtering behavior.