pserwylo / herri

"Find your place in your community" - A project for govhack.org 2014
1 stars 3 forks source link

Make legend use quintiles from server #7

Open pserwylo opened 10 years ago

pserwylo commented 10 years ago

Currently I believe it is using hard coded values which worked for the "total population" model we used during govhack.

It would help if the server includes this info in the JSON it sends back with the model/name description. That way, additional ajax requests are not required.

It would be perfect if it came back with the geojson data, because that is where the actual attributes live. However, this is more difficult than sending it with the name/description. The reason is that geoserver sends back the geojson data according to a specific query that only returns the geometry (and attributes). I'm not sure if it is even possible to make that response also include summary statistics. As such, the data will probably be easier to get from a request to django.

logworthy commented 10 years ago

Hmmm.... there are possibly a few issues here.

  1. I believe the quintile colours at the moment are static, so if you choose a model with extreme values (e.g. lots of variables at 100% vs a single variable at 10%) you will get mostly dark or mostly light. At present geoserver does have a parameterized view for handling this: model_results_geoserved_q

It returns "quintile" instead of "value" in the properties. It takes values 1-5, and 0 for errors). It hasn't been fully tested. Do we need a test environment? I might raise this as an issue as well.

  1. Are you asking what are the qunitile breaks, so that we could display them in the legend? I agree this would be good, except that the values of a model (and hence the colours on the map) don't really mean anything. If you want to start a service/business in an area our map doesn't give you any specific numbers that you can use to help business case it. I think it would be good to have something more tangible, but I'm not sure if there's a solution.
pserwylo commented 10 years ago

Oh, I didn't realise that we could return the quintiles. That's perfect and solves my problems. In the future it would be nice to allow a sort of "drill down" when you click on a LGA. In that case, then perhaps a secondary request for more details may be worthwhile.