MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / getFieldCenter

Function getFieldCenter

src/components/FieldComparisonColumn.tsx:61–66  ·  view source on GitHub ↗
(field: Field)

Source from the content-addressed store, hash-verified

59 );
60};
61
62function getFieldCenter(field: Field) {
63 const coords = field.coordinates[0];
64 const lat = coords.reduce((sum, c) => sum + c[1], 0) / coords.length;
65 const lng = coords.reduce((sum, c) => sum + c[0], 0) / coords.length;
66 return { lat, lng };
67}
68
69const GEE_ANALYTICS_CACHE_KEY = "gee-analytics-cache";

Callers 1

fetchWeatherDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected