moja-global / moja-global/FLINT

extendable land unit area concept.

Open
#56 7 comments 3 reactions 2 assignees View on GitHub

@vidhya001 is already working on this.

Since Apr 26, 2021.

Bug Doc Enhancement P1
Dominant language
C++
Stars
56
Forks
81
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
Currently the system calculates the Land UNit area using a method on the provider (area)

inline double ProviderSpatialRasterTiled::area(const CellIdx& cell) const {
   auto lat = _indexer->getLatFromIndex(cell);
   auto x = _indexer->cellDesc.latSize * DiameterOfEarthInMetersPerDeg;
   return x * x * cos(lat * DegToRadMultiplier) * 0.0001;
}

This can be overridden by having a variable called landUnitArea.

_landUnitController.initialiseData(true);
_spatiallocationinfo->_landUnitArea = _provider->area(cell);
_landUnitController.getVariable("landUnitArea")->set_value(_spatiallocationinfo->_landUnitArea);

This is clumsy and obscure.

Describe the solution you'd like

This should be definable in the system settings, in a similar fashion to Localdomain - simulateLandUnit. But perhaps in the Landscape object. Allowing the user to dwefine a variable that is the Area to use.

This way the variable can be used as a transform for eaxample. Either doing a SQL query or spatial layer lookup. Or just a differnt method to calculate the area.

Perhaps like: landUnitAreaVariable below:

{
	"LocalDomain": {
		"type": "spatial_tiled",
		"start_date": "2000/01/01",
		"end_date": "2020/12/31",
		"sequencer_library": "internal.flint",
		"sequencer": "CalendarAndEventFlintDataSequencer",
		"simulateLandUnit": "simulateLandUnit",
		"landUnitBuildSuccess": "landUnitBuildSuccess",
		"landUnitAreaVariable": "spatial_layer_area",
               ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.