To do the heat maps on leaflet we need to pass the information as a GeoJSON which specifies the geometry in the geometry field and the data to be passed as values for each census tract on the "properties" field.
Applying the serializer directly does not seem to work as passing .values() (equivalent to GROUP BY) to a query set convert it to a ValuesQuerySet. Explore if there is a way around this problem.
"Manually" create the GeoJSON from the queryset results and then apply geojson.dumps(). Need to explore how geojson interacts with GEOS Geometry used by Django and could be more error prone (but certainly doable).
To do the heat maps on leaflet we need to pass the information as a GeoJSON which specifies the geometry in the geometry field and the data to be passed as values for each census tract on the "properties" field.
Solutions to explore:
Demographic
data model to be at the Census Tract level..values()
(equivalent to GROUP BY) to a query set convert it to a ValuesQuerySet. Explore if there is a way around this problem.Discuss with @benjaleivas, @kdumais111