ucd-cws / dwrat-app

MIT License
1 stars 0 forks source link

Add layers to visualize shortage by HUC #6

Closed brmagnuson closed 8 years ago

brmagnuson commented 9 years ago

Probably a few different visualizations would be most helpful. The two I have thought of are average percent shorted per HUC (how severe the shortages are) and some version of number of users shorted per HUC normalized by total of number of users in the HUC (how many are being shorted).

jrmerz commented 9 years ago

@qjhart There are two issues here.

1) The HUC layer is currently hosted on Google Maps Engine (https://mapsengine.google.com/) which is due to be shutdown on 1/29/2016. So a new hosting service will need to be found.

2) Assuming server side computation, we need to be able to compress the vectors and send those along as well.

qjhart commented 9 years ago

@jrmerz, here is the idea for this. When we have a watershed, we get back a set of points that show the individual shortages. What we'd like is to see this at the aggregated level. Each of these means aggregating the points on their HUC12 designation, and then attaching that to the exsiting HUC12 map (that is already in the legend).

filled = num_allocated / num_demands shorted = num_demand-num_allocated / num_demands

jrmerz commented 9 years ago

First, 'Assuming CLIENT side computation'. My bad.

So the HUC 12 layer is a raster layer. I can't do anything to the layer or render a new region. I can show a table of with the HUC 12 id, but nothing geographic, no 'attaching'.

Also, what sudo language are you writing in? I can't read it :/

qjhart commented 9 years ago

Ok, how about we make the HUCs available something as in https://github.com/ucd-cws/usbr-water-districts, then you pull the data in (via our as yet unmade gis-bower) or just via the release, and we verify we can make it more simple, and then we render it on the client?

Regarding lang: http://latex.codecogs.com/gif.latex?delivery&space;=&space;\sum_{points}&space;allocation_i&space;/&space;\sum_{points}&space;demand_i

jrmerz commented 9 years ago

OK, I like where you are going with this. Simplified geojson as part of the app and stored in the usbr-water-districts repo I like. I think a raster service is still best for visualization of entire layer... Don't we have a watersheds arcgis server now? seems like both watersheds and huc boundries are great candidates.

qjhart commented 9 years ago

Yes, we absolutely do (or should), however the colors need to change on every new data upload, so I don't see how the service would help. I will however nudge up the HUC development. Oh wait, I see for the entire layer yes, of course that makes sense.

jrmerz commented 9 years ago

Not sure if you answered your own comment or not. But to respond, yes the colored hucs would be svg overlays, but we would also need a basemap of all hucs, for browser performance reasons. we will also be limited in the number of rendered hucs we will be able to show.

jrmerz commented 9 years ago

I have added a function to the public view for fetching simplified HUC geometry by id. I am still playing around with how small I can make the geometry and still have it presentable.

Ex: http://watershed.ice.ucdavis.edu/vizsource/rest?view=get_huc_by_id(%27180101100103%27)&tq=SELECT%20*&tqx=reqId%3A1

jrmerz commented 9 years ago

Ok, I have added a simple overlay for HUC 12 data. It currently just renders the average percent demand for that HUC's. It only loads HUC's that have data. The rendering as shortage vs demand met is tied to the same toggle as the nodes. There is a new checkbox for disabling the HUC 12 averages.

Here is an ex: http://watershed.ice.ucdavis.edu/drought/#date=2014-04-28&river=EEL%20RIVER&zoom=9&ll=40.19880596447519%2C-122.958984375

Note. HUC latency is due to network requests. There is some work that can be done here to improve things but wanted to get this up so you can see where I am going.