We have a use case that needs to represent multiple area values associated with the same plant asset. I’m curious for thoughts on doing this in a more generalized way than just creating separate fields for each value… if possible.
The different “area values” represent different attributes on the asset:
- field area (our standard geometry, basically the perimeter)
- planted area
- irrigated area
- spray area
- etc…
These are necessary because the total area associated with each “attribute” isn’t necessarily the same. These differences are significant when performing calculations over the total area: 20k gallons water applied to 20 acres vs 18 acres.
A good example of this is an Orchard. The field area might cover an area larger than the actual planted area due to access roads around the perimeter or other natural obstacles. The irrigated area is likely smaller than the planted area due to rows/roads in within the orchard. Similarly, the spray area could be different than the other values.
I see the argument for keeping the field acres and planted acres as separate assets with separate geometries, and assigning one asset as being located in the other. But (in my opinion) this added complexity shouldn’t be the only option.
One complexity is how to store these values… a couple options…
- As a percentage of the total area (doesn’t seem as flexible)
- As the actual total area value (decimal)
- But how to account for different units? save in metric and convert as needed? or save the value as a quantity w/ specified units?
- Store separate geometries for each, and compute the total area
- Hard to store a specific value
- Not needed for my use case where only the total area is needed, but this could be useful if the geometry is inherently important to the attribute. Is the irrigated area a straight line or curved??
Then there is also the matter of how/where to associate the values with an asset…
- Create a separate field on the asset for each value - asset.planted_area, asset.irrigated_area, etc.
- Maybe a single quantity field?? Then a quantity could be added for each of the above area attributes with value, units and a label.
- Save the data in a log that references the asset
- Don’t like this, these values do seem like they should be “attributes” of the asset
- But this might be the best way to save some additional geometries describing the asset… like a geometry of all obstacles in a field as an observation log
- Take it a step further and create a concept of “area attributes” as a single field, where assets could provide values for only the “area attributes” applicable to them (only provide planted & irrigated).
- This is similar to a quantity field, but could be more tailored to the area attributes.
This reminds me of the “farm_trait” concept @Symbioquine proposed awhile ago: Implement a farm_trait module by symbioquine · Pull Request #285 · farmOS/farmOS · GitHub. Not quite the same, but similar.
Anyways, curious if this seems useful to others and if so, how it could be abstracted a bit more than just separate fields for each value.