Open ChloeRN opened 2 years ago
I never implemented this, but an earlier idea was to create a generic map-plotting function for NI-values. If we store NI-values together with its geographical scale, we could write a plot function that can plot this on a map. To this end I stored this data in NIcalc/data/indicator.area.rda
What I never got around to:
Perhaps add an attribute to the "indicatorData" class that holds a name of the largest geographic area the indicator value refers to (in the getIndicatorValues.R).
Then I thought we could perhaps store a hierarchical list of the geographical units of Norway in the NIcalc package, so that you optionally could plot the value for smaller regions.
Write a plot function that takes as options the value to plot, and the choosen area to plot it to, where you then could plot it to any area contained in the largest area. And gives an error message if the choosen area isn't part of the geographical scope of the indicator/index.
Accessing geodata stored in the NI database is somewhat cumbersome and access is tricky to implement efficiently according to @jenast. A good alternative for the future would be to store all relevant shapefiles as data within NI calc.