This issue came up in the FarmOS Element. Here’s the discussion.
Hey all! I won’t be able to make the dev call today. I’ll catch up next week.
In terms of next steps in core, there’s an open feature request for adding a manual-entry measurement field to allow users to override the auto-computed measurements (in case they are incorrect).
https://www.drupal.org/project/farm/issues/3051971
It seems like that would be the first step… and then that field could be filled it automatically with a default value when an asset geometry gets saved (if it isn’t already set manually).
This would serve to expose those values via the API for both use cases (auto-calculated and manually overridden).
The big questions that remain to be answered are:
How do we handle units? Acres are not used globally. Do we need to store an additional unit with every measurement? Or do we standardize on meters and leave it to API consumers to convert?
Does this only get added to
land
assets?Another consideration in my mind is: what about other types of measurements? Like “length” of fencing (not area)? If that’s going to be needed in the future (seems likely), then we need to consider all these use-cases together so we don’t shoot ourselves in the foot with a short-sighted implementation that only focuses on area.
Motivation
I feel this would be very helpful to external consumers of the FarmOS API, and also to the Common Convention we’re building off of the FarmOS Data Model. Farmers often associate field size (and field shape) more easily than field name, so showing acreage or an svg of the field shape in a selector menu is really key. This is confirmed by the use of these items in other FMIS / ag tech systems as well. I wonder if others like @Symbioquine and @braught agree (?)
Suggestions on implementation
- How to handle units
IMO you should store a known value in a fixed units, and allow the end user to modify it. Modifying units is trivial and essentially errorless on the API consumer end., calculating internal geometry is not (… the calculations are often off, there are questions about multi-polygon or cutouts, etc.). I would suggest square meters as a common unit, and potentially include it in the name like area_sq_meters
to be explicit. This saves the need for additional units, and allows it to be an attribute
which is where (IMO) it should be.
- Does this only get added to
land
assets?
IMO no, it should apply to all assets with an area. Arguably, it should apply to any entities with a geometry
including logs. Area is so critical to so many things (calculating yield (per acre), calculating efficiency, animal growth based on areas grazed, sustainability or other supply chain calculations… the list goes on) IMO you should always calculate this if there is a geometry
. Where and how it’s displayed in FarmOS is another question, but it should always appear in the API.
- What about non-area geometries.
I think this is a fair point… but these can be addressed one at a time. Let’s start with the 80% solution here which is area or multi-area (whether in a geometry collection or not).
What do others thing???