Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task 1: filter by mask #525

Open
knutole opened this issue Aug 24, 2016 · 14 comments
Open

Task 1: filter by mask #525

knutole opened this issue Aug 24, 2016 · 14 comments

Comments

@knutole
Copy link
Contributor

knutole commented Aug 24, 2016

Filter by mask

  • kun få opp pixlene som ligger under masken (snow)
  • kun vise snøen som ligger under snøfeltet (pile)
  • optional

Tid/arbeid:

  • query: filter by mask (10t)
  • gui: add filter to raster (5t)
  • refactor mask (5t)
  • buffer (4t)

Totalt: 24 timer

@knutole
Copy link
Contributor Author

knutole commented Aug 24, 2016

Use API for adding mask, uploading. Wait with GUI.

@knutole
Copy link
Contributor Author

knutole commented Aug 24, 2016

Kunne ha flere masker i samme prosjekt

  • må kunne trykke på Agder f.eks. og få grafen på det
  • kunne trykke på et annet lag og få grafen på det

Tid/arbeid:

  • seamless switching between graphs (3t)
  • refactor control of graph (3t)
  • refactor graph data input (3t)
  • click-functionality for mask (vector mask) (4t)
  • refactor, cleanup of graph/layers/mask (2t)
  • refactor vector vs raster mask (5t)
  • buffer (4t)

Totalt: 24 timer

@knutole
Copy link
Contributor Author

knutole commented Aug 26, 2016

Masks

  • This should be possible both for cubes and for normal rasters (and actually other vectors). filter by polygon should be a general way to filter.
  • Should be possible to add several masks to a cube (or other layer)
  • masks must be clickable. which is a problem with large polygons, which need to be simplified. could be done with topojson: http://shancarter.github.io/distillery/ Can easily simplify a 4MB geojson into 80kB topojson without visible changes.
  • Dropdown somewhere - to switch between masks. Or simply click on the mask.

Filters

  • Should be possible to add filters to cube.
  • Should be possible to use mask as filter

@knutole
Copy link
Contributor Author

knutole commented Aug 26, 2016

Refactors

Description controls

  • need to totally refactor legends/description box. This goes for all types, incl. standard, globesar, geode, snow, etc. Must be made into much more pluggable system, with special controls for each type of description box. The proper name is description box. Legends are part of this description box. Always in bottom right corner.
  • should be event driven only
  • it should be designated in the layer itself which type of description control is used
  • also need to refactor how multiple layers showing at the same time are represented in the description box. legends will need to show for all layers.
  • perhaps better to separate legends and description box.
  • css-wise, the different boxes should be able to co-exist (description, legends, custom), simply by blocking each other with pos:relative.

Custom controls

  • point-cloud controls (for akersvatn, etc.). This type of control is also custom, and should be added simply by designating it in the layer. this is different from description box however, as it appears on hover/click and does queries etc.
  • this should also be refactored into something much more streamlined.

Custom controls

  • Should be possible to add any type of control, with any size, to any corner of the map.
  • This type of control should also be able to interact with the layer, do queries from server, etc.
  • It can simply listen to events from map (incl. layer activated, deactivated, project change, etc.)
  • Event listeners as triggers is KEY to all custom modules.

@knutole
Copy link
Contributor Author

knutole commented Aug 28, 2016

Flow

  1. Upload mask to layer
  2. Mask is added as topojson + on server (postgis)
  3. Hover-capabilities on mask - filter is activated by clicking on the mask.
  4. Selectors in GUI for which mask should be active.
  5. Average data (for snow-raster chart) should be added separately, with an ID connecting it to the mask (how?) This data-type is so specific, it should be kept out of the GUI, really. Or made very general.
  6. GUI should be centered on the plugin - snow-chart plugin. Adding mask/filter must be more generic on the server-side, but could be stored directly on the layer.

Do this in API first, then GUI (if necessary) afterwards. Show added masks in GUI.

@knutole
Copy link
Contributor Author

knutole commented Aug 29, 2016

Options box

  1. List of masks - clickable (and showing if clicked)

@knutole
Copy link
Contributor Author

knutole commented Aug 29, 2016

Need to add 1) raster mask, 2) topojson representation of mask, 3) historical scf data for mask; all at the same time to API.

@knutole
Copy link
Contributor Author

knutole commented Sep 20, 2016

Scratch

Need to do it well the first time. No more patch work!

  1. API scripts for controlling all cube. No more GUI. Implement GUI after everything works perfectly.
    • con's: not possible to edit too much the cube
    • pro's: easier to keep clean and correct.
    • Datasets, mask must be added on upload
    • must take options, to separate deformation uploads (clicking on pixel to get history) from snow-raster (calculate averages, etc)
  2. Calculate the averages, don't upload average datasets. It's so unclean and ugly! Rather, when uploading, calculate the average of the whole, plus calculate average per mask. NB! Unfortunately not really possible, as it requires uploading 5000 rasters. It's actually better to use pre-calculated averages... Which sucks!
  3. Should be possible to add several masks.
  4. Masks must be selectable - perhaps in the custom plugin. Cleaner than in layer menu.
  5. Cubes are separate from single rasters. Focus on cubes now.
  6. Deformation will also become cubes. Keep this in mind. Deformation does not have any masks, so should work without mask also.
  7. Use geojson as mask for now. Implement topojson when everything works perfectly.

@knutole
Copy link
Contributor Author

knutole commented Sep 20, 2016

Difference between deformation and snow raster

  • Deformation functionality: click on pixel, get values of all similar pixels in cube
  • Snow functionality: calculate min, max, avg of all pixels in all datasets
  • Snow functionality: calculate min, max, avg of all pixels in all datasets based on mask
  • Snow: ability to add masks
  • Snow: filter: show only pixels under maks
  • Deformation: filter: show only pixels under mask
  • Deformation: does not necessarily have masks.
  • Snow: does not necessarily have masks.

Need an options object to control some of these options when uploading to API.

knutole added a commit to systemapic/api-scripts that referenced this issue Sep 20, 2016
- systemapic/wu#525
- Masks can have data key
- Geojson can be added directly as mask (not converted to geojson)
- `upload_rasters_to_cube.js` is deprectated
knutole added a commit to systemapic/pile that referenced this issue Sep 20, 2016
- systemapic/wu#525
- masks can be added as `geojson`
- masks can have data key (for average scf for example)
knutole added a commit to systemapic/systemapic.js that referenced this issue Sep 22, 2016
- see systemapic/wu#525
- todo: cleanup, bugfixes, stability
- todo: check 2015 data
knutole added a commit to systemapic/systemapic.js that referenced this issue Sep 23, 2016
- see systemapic/wu#525
- todo: bugfixing, stability
knutole added a commit that referenced this issue Sep 23, 2016
- added sheet for model.layer.geojson
- subcommits
- see #525
- todo: general bugfixing
- todo: tests
@knutole
Copy link
Contributor Author

knutole commented Sep 23, 2016

todo

for filter, mask issues

bugs

  • bug with double graph panes after switching projects (events, data, cache)
  • mask description bug
  • graph: SCF is one day off relative to red line (red line is one day ahead). red line is in the wrong, cause raster data corresponds well with SCF.
  • when changing mask, red line goes to end, instead of cursor.
  • sometimes (when changing projects a lot), the cursor is "stuck", ie. not showing any tiles, so need to be nudged one to the left or right. (connected to general cache bug, not always caching correct layer)

optimizations

  • optimize tile creation when mask is active, extent of geojson mask
  • convert all geojson masks to FeatureCollection on import
  • cache snow-query in browser, so no fetch when switching masks
  • add bbox to geojson masks on import
  • pregenerate all tiles (in conjunction with Publish button)
  • check for memory leaks
  • perhaps load less data on page load (especially masks are heavy.. topojson would help a lot)
  • remove double calls (for data, slider, etc)
  • move all cross-functions of cube/animator/graph to events

repo

  • add LICENCE.md to all repos
  • merge all code
  • commit fork to master
  • update code on px
  • /var/ ssd on px

tests

  • bugtest thoroughly
  • add pile tests
  • add tests for raster snow queries (with predefined coverage; check day per day)
  • add test for mask conversion
  • add tests for raster mask rendering

scripts

  • update api-scripts repo
  • ensure script for adding more rasters to cube is working
  • pull daily rasters from ftp. register as a cron type job

knutole added a commit to systemapic/systemapic.js that referenced this issue Sep 24, 2016
- more tasks controlled by events
- bugfixing
- todo: put slider events as events
- todo: remove all cross-functions and replace with events
- systemapic/wu#525
@knutole
Copy link
Contributor Author

knutole commented Sep 24, 2016

knutole added a commit to systemapic/systemapic.js that referenced this issue Sep 24, 2016
@knutole
Copy link
Contributor Author

knutole commented Sep 26, 2016

PRI

  1. årlige line-graphs
  2. update scripts for cube (til eirik)

@knutole
Copy link
Contributor Author

knutole commented Sep 28, 2016

Yearly chosen plots

  • utregne fra avg-data.json
  • dropdown for valg av ett eller flere år
  • plott per år i forskjellig farge (som den røde streken)
  • legend for år/farge, kanskje til høyre for hele grafen

Tid/arbeid:

  • Dataen er allerede laget (avg.json). Må lese fra dette formatet. (2t)
  • Dropdown må lages. (4t)
  • Grafen må kunne oppdateres mye mer fleksibelt. (4t)
  • Man må kunne legge til flere år i samme grafen. (5t)
  • Lage nye, dynamiske legends, som kan skrus av og på. (4t)
  • buffer (6t)

Totalt: 25 timer

@knutole
Copy link
Contributor Author

knutole commented Sep 29, 2016

Different scf data:

  • Average data, ie. scf for 2000-2015.
    • This data is parsed to create max/min/avg of all scf for all years.
    • This scf data comes from a file.
    • Used to create background graph of avg/min/max
    • this is NOT a specific year, it's ALL years... (so only 365 entries....)
  • Latest data, ie. data not contained in file
    • which is queried from server.
    • This is scf + date only. No min/max/avg is calculated here.
    • Used for red line graph, current year. ie SCF only for a current year.

Line graphs therefore are created from data from both sources. 2016 from query data, 2014 from file data.

Each mask has different data - both for years 2000-2015 and 2016. So each mask must keep own dataset...

When calculating averages, the last unfinished year should not be part. Not a problem.

Line graphs should read data for relevant year.

Average graph should read all full-year data.

_prepareData only needs to run once per mask.
_parseDates only needs to run once per mask.

When adding mask (which happens on click right now, could be done beforehand), data is queried from server and file-data is added.

this._cache.mask[mask.id] = {
    mma : [365...] // min, max, average of all full years
    years : {
        2016 : [], // queried data,
        2015 : [], // data from file
        2014 : [], // data from file
    }

}

knutole added a commit to systemapic/systemapic.js that referenced this issue Oct 4, 2016
- systemapic/wu#525
- option created
- todo: implement graph
knutole added a commit to systemapic/systemapic.js that referenced this issue Oct 4, 2016
- todo: optimization
- systemapic/wu#525
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant