45 Commits

Author SHA1 Message Date
579a2d9b8d Merged develop into master
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2025-01-29 15:21:33 +01:00
jenkins
2617e52a83 [ci skip] Updated project references #91
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-12-09 14:17:10 +00:00
jenkins
b935b3967c Updated project references #90
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-12-09 13:47:42 +00:00
jenkins
c227461eee [ci skip] Updated project references #89
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-12-09 13:17:46 +00:00
jenkins
6f0669ff4c Updated project references #88
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-12-09 13:01:48 +00:00
f12e735dd6 Merged develop into master
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-12-09 13:02:30 +01:00
jenkins
d1dff49fea [ci skip] Updated project references #87
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-10-23 07:21:15 +00:00
jenkins
c0f855d505 Updated project references #86
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-10-23 06:51:24 +00:00
jenkins
ef07bdef0b [ci skip] Updated project references #85
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-10-23 06:26:38 +00:00
jenkins
7658cf9c66 Updated project references #84
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-10-23 06:05:16 +00:00
bfee63f562 Merged develop into master
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-10-23 00:08:41 +02:00
jenkins
e2cb0649b5 [ci skip] Updated project references #82
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-09-24 21:07:08 +00:00
jenkins
74e30a0c80 Updated project references #81
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-09-24 20:36:33 +00:00
jenkins
d973289d4c [ci skip] Updated project references #80
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-09-24 20:06:16 +00:00
jenkins
23b6a0d620 Updated project references #79
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-09-24 19:44:31 +00:00
jenkins
65e4ed4755 Updated project references #77
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-09-24 19:22:11 +00:00
jenkins
d1a8976785 [ci skip] Updated project references #76
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-09-24 18:52:24 +00:00
jenkins
c6b7133d94 Updated project references #75
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-09-24 18:27:01 +00:00
jenkins
6a1ab4dc8a [ci skip] Updated project references #74
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-08-26 14:18:19 +00:00
jenkins
cd3a991157 Updated project references #73
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-08-26 13:46:57 +00:00
jenkins
075d5a6081 [ci skip] Updated project references #72
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-08-26 13:16:34 +00:00
jenkins
f78deaca8a Updated project references #71
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-08-26 12:51:17 +00:00
jenkins
1255865fb4 Updated project references #69
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-08-26 08:33:24 +00:00
jenkins
76a7adba55 [ci skip] Updated project references #68
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-08-26 08:07:22 +00:00
jenkins
0dafbf3250 Updated project references #67
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-08-26 07:51:41 +00:00
jenkins
0d1aecc6f5 [ci skip] Updated project references #66
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-07-22 16:15:08 +00:00
jenkins
d001c802f0 Updated project references #65
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-07-22 15:46:16 +00:00
jenkins
dc91e08072 [ci skip] Updated project references #64
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-07-22 15:17:27 +00:00
jenkins
815f95ca0c Updated project references #63
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-07-22 15:01:58 +00:00
2b80515c8e Merged develop into master
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-07-22 16:14:31 +02:00
b149eec39c Merged develop into master
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-06-11 11:12:11 +02:00
jenkins
94fc762de6 [ci skip] Updated project references #62
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-05-24 00:09:24 +00:00
jenkins
c1d200f1af Updated project references #61
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-05-23 23:39:41 +00:00
jenkins
09983e5d28 [ci skip] Updated project references #60
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-05-23 23:09:56 +00:00
jenkins
b42fa7f658 Updated project references #59
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-05-23 22:44:56 +00:00
jenkins
0b7e30d301 Updated project references #56
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-05-23 11:32:48 +00:00
jenkins
253a76e061 [ci skip] Updated project references #55
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-04-23 23:24:45 +00:00
jenkins
2ddd2e4b13 Updated project references #54
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-04-23 22:59:42 +00:00
jenkins
b5e0e049a2 [ci skip] Updated project references #53
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-04-23 22:33:39 +00:00
jenkins
00cad173c6 Updated project references #52
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-04-23 22:09:42 +00:00
jenkins
15656a964a [ci skip] Updated project references #52
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-03-19 17:57:23 +00:00
jenkins
bba50c65b1 [ci skip] Updated project references #51
Some checks reported errors
FarmMaps/CarbonLib/pipeline/head Something is wrong with the build of this commit
2024-03-19 17:31:19 +00:00
jenkins
3b5afbc5a9 Updated project references #50
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-03-19 16:56:00 +00:00
jenkins
cfacd6def4 [ci skip] Updated project references #49
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-03-19 16:32:19 +00:00
jenkins
34a94d858e Updated project references #48
All checks were successful
FarmMaps/CarbonLib/pipeline/head This commit looks good
2024-03-19 16:15:43 +00:00
7 changed files with 36 additions and 2657 deletions

View File

@@ -14,7 +14,6 @@ namespace CarbonLib
public abstract CarbonRequest MapFarmMapsToMiterra(FarmMapsCarbonRequest farmInput); public abstract CarbonRequest MapFarmMapsToMiterra(FarmMapsCarbonRequest farmInput);
public abstract string Validate(CarbonRequest farmInput); public abstract string Validate(CarbonRequest farmInput);
public abstract CarbonSummary Calculate(CarbonRequest farmInput); public abstract CarbonSummary Calculate(CarbonRequest farmInput);
public abstract CarbonSummary CalculateClimateScenario(CarbonRequest farmInput);
public double? GetCropYield(string cropCode, int year, int postalCode) public double? GetCropYield(string cropCode, int year, int postalCode)
{ {

View File

@@ -230,34 +230,9 @@ namespace FarmMapsAPI.Carbon
return cropYield; return cropYield;
} }
public CarbonSummary CalculateClimateScenario(CarbonRequest farmInput)
{
var simpleResult = Calculate(farmInput);
return simpleResult;
}
private List<double> GetMinMaxMedian(List<YearSummary> yearData, int year, string varName)
{
if (yearData.Count == 0)
{
}
var minValue = (double)yearData.Min(s => s.GetType().GetProperty(varName).GetValue(s));
var medianValue = CalculateMedian(yearData.Select(s => Convert.ToDouble(s.GetType().GetProperty(varName).GetValue(s))).ToList());
var maxValue = (double)yearData.Max(s => s.GetType().GetProperty(varName).GetValue(s));
return new List<double> { minValue, medianValue, maxValue };
}
public CarbonSummary Calculate(CarbonRequest farmInput) public CarbonSummary Calculate(CarbonRequest farmInput)
{
return Calculate(farmInput, 0);
}
public CarbonSummary Calculate(CarbonRequest farmInput, int climateScenarioNumber = 0, Dictionary<(string, string, int), ClimateVariable> climate = null)
{ {
var knmiFile = Helper.GetPlatformIndependentDirectoryPath(Path.Combine(configPath, "KNMI_data.csv")); var knmiFile = Helper.GetPlatformIndependentDirectoryPath(Path.Combine(configPath, "KNMI_data.csv"));
var climateFile = Helper.GetPlatformIndependentDirectoryPath(Path.Combine(configPath, "klimaatscenario.csv"));
// soilTypeData (external input) // soilTypeData (external input)
var soilTypeData = GetSoilTypeData(farmInput); var soilTypeData = GetSoilTypeData(farmInput);
@@ -430,15 +405,7 @@ namespace FarmMapsAPI.Carbon
} }
cropAreaFarm.Add(("Farmname", loopYear), croplist); cropAreaFarm.Add(("Farmname", loopYear), croplist);
Dictionary<string, List<ClimateVariable>> climateVariable; Dictionary<string, List<ClimateVariable>> climateVariable = GetClimateVariable(knmiFile, dataTransformationSet, gisSoilSet, loopYear, farmInput);
if (climateScenarioNumber == 0)
{
climateVariable = GetClimateVariable(knmiFile, dataTransformationSet, gisSoilSet, loopYear, farmInput, climateFile, climateScenarioNumber);
}
else
{
climateVariable = GetClimateVariable2(knmiFile, dataTransformationSet, gisSoilSet, loopYear, farmInput, climateFile, climateScenarioNumber, climate);
}
// Crop and soil areas // Crop and soil areas
// soilArea keys: (fieldname, year, soil) // soilArea keys: (fieldname, year, soil)
@@ -1959,7 +1926,7 @@ namespace FarmMapsAPI.Carbon
return soilBulkDensities; return soilBulkDensities;
} }
private Dictionary<(string, string, int), ClimateVariable> InitClimateFile(string knmiFile, string climateFile = null, int climateScenarioNumber = 0) private static Dictionary<string, List<ClimateVariable>> GetClimateVariable(string knmiFile, SetsForDataTransformation dataTransformationSet, GIS_Soils_Sets gisSoilSet, int loopYear, CarbonRequest farmInput)
{ {
var data = new List<string>(); var data = new List<string>();
using (StreamReader r = new StreamReader(knmiFile)) using (StreamReader r = new StreamReader(knmiFile))
@@ -1972,139 +1939,6 @@ namespace FarmMapsAPI.Carbon
} }
var dataClimate = new List<string>();
if (climateFile != null && climateScenarioNumber > 0)
{
using (StreamReader r = new StreamReader(climateFile))
{
string line;
while ((line = r.ReadLine()) != null)
{
dataClimate.Add(line);
}
}
}
// climate (zone, month, year)
var climate = new Dictionary<(string, string, int), ClimateVariable>();
if (dataClimate.Count() > 0)
{
foreach (var row in dataClimate)
{
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || row.Split(';')[0] == "KNMI_zone")
{
continue;
}
var rowArr = row.Split(';');
if (int.Parse(rowArr[3]) == climateScenarioNumber)
{
climate.Add(($"zone{rowArr[0]}", $"M{rowArr[2]}", int.Parse(rowArr[1])), new ClimateVariable(double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture), double.Parse(rowArr[6], CultureInfo.InvariantCulture)));
}
}
foreach (var row in data)
{
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0]))
{
continue;
}
var rowArr = row.Split(';');
if (int.Parse(rowArr[2]) <= 2023)
{
if (climate.Any(x => x.Key.Item1 == rowArr[0] && x.Key.Item2 == rowArr[1] && x.Key.Item3 == int.Parse(rowArr[2])))
{
climate[(rowArr[0], rowArr[1], int.Parse(rowArr[2]))].Temperature = double.Parse(rowArr[3], CultureInfo.InvariantCulture);
climate[(rowArr[0], rowArr[1], int.Parse(rowArr[2]))].Precipitation = double.Parse(rowArr[4], CultureInfo.InvariantCulture);
climate[(rowArr[0], rowArr[1], int.Parse(rowArr[2]))].Evapotranspiration = double.Parse(rowArr[5], CultureInfo.InvariantCulture);
}
else
{
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
}
}
else
{
if (climate.Any(x => x.Key.Item1 == rowArr[0] && x.Key.Item2 == rowArr[1] && x.Key.Item3 == int.Parse(rowArr[2])))
{
continue;
}
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
}
}
}
else
{
foreach (var row in data)
{
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0]))
{
continue;
}
var rowArr = row.Split(';');
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
}
}
return climate;
}
private static Dictionary<string, List<ClimateVariable>> GetClimateVariable2(string knmiFile, SetsForDataTransformation dataTransformationSet, GIS_Soils_Sets gisSoilSet, int loopYear, CarbonRequest farmInput, string climateFile = null, int climateScenarioNumber = 0, Dictionary<(string, string, int), ClimateVariable> climate = null)
{
var climateVariable = new Dictionary<string, List<ClimateVariable>>();
var farmPostalCode = farmInput.PostalCode;
if (farmInput.geometry != null)
{
// determine poatalcode from geometry
string res = GetPostalCodeFromGeometry(farmInput.geometry);
farmPostalCode = 8211;
}
var farmZone = dataTransformationSet.KNMI_zone_Reg.SingleOrDefault(x => x.Reg.Contains(farmPostalCode)).KNMI_zone;
foreach (var field in farmInput.CropFields.Select(s => s.Name))
{
var monthClimateList = new List<ClimateVariable>();
foreach (var month in gisSoilSet.AllMonths)
{
var climateYear = loopYear > 2050 || loopYear < 2011 ? 2012 : loopYear;
var monthData = climate.Single(x => x.Key.Item1 == farmZone && x.Key.Item2 == month && x.Key.Item3 == climateYear).Value;
var newMonthData = new ClimateVariable(monthData.Temperature, monthData.Precipitation, monthData.Evapotranspiration * 1.25);
monthClimateList.Add(newMonthData);
}
climateVariable.Add(field, monthClimateList);
}
return climateVariable;
}
private static Dictionary<string, List<ClimateVariable>> GetClimateVariable(string knmiFile, SetsForDataTransformation dataTransformationSet, GIS_Soils_Sets gisSoilSet, int loopYear, CarbonRequest farmInput, string climateFile = null, int climateScenarioNumber = 0)
{
var data = new List<string>();
using (StreamReader r = new StreamReader(knmiFile))
{
string line;
while ((line = r.ReadLine()) != null)
{
data.Add(line);
}
}
var dataClimate = new List<string>();
if (climateFile != null && climateScenarioNumber > 0)
{
using (StreamReader r = new StreamReader(climateFile))
{
string line;
while ((line = r.ReadLine()) != null)
{
dataClimate.Add(line);
}
}
}
var farmPostalCode = farmInput.PostalCode; var farmPostalCode = farmInput.PostalCode;
if (farmInput.geometry != null) if (farmInput.geometry != null)
{ {
@@ -2117,37 +1951,6 @@ namespace FarmMapsAPI.Carbon
// climate (zone, month, year) // climate (zone, month, year)
var climate = new Dictionary<(string, string, int), ClimateVariable>(); var climate = new Dictionary<(string, string, int), ClimateVariable>();
if (dataClimate.Count() > 0)
{
foreach (var row in dataClimate)
{
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || row.Split(';')[0] == "KNMI_zone")
{
continue;
}
var rowArr = row.Split(';');
if (int.Parse(rowArr[3]) == climateScenarioNumber)
{
climate.Add(($"zone{rowArr[0]}", $"M{rowArr[2]}", int.Parse(rowArr[1])), new ClimateVariable(double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture), double.Parse(rowArr[6], CultureInfo.InvariantCulture)));
}
}
foreach (var row in data)
{
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0]))
{
continue;
}
var rowArr = row.Split(';');
if (climate.Any(x => x.Key.Item1 == rowArr[0] && x.Key.Item2 == rowArr[1] && x.Key.Item3 == int.Parse(rowArr[2])))
{
continue;
}
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
}
}
else
{
foreach (var row in data) foreach (var row in data)
{ {
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0])) if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0]))
@@ -2157,8 +1960,6 @@ namespace FarmMapsAPI.Carbon
var rowArr = row.Split(';'); var rowArr = row.Split(';');
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture))); climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
} }
}
var climateVariable = new Dictionary<string, List<ClimateVariable>>(); var climateVariable = new Dictionary<string, List<ClimateVariable>>();
@@ -2268,29 +2069,5 @@ namespace FarmMapsAPI.Carbon
} }
} }
private static double CalculateMedian(List<double> numbers)
{
if (numbers == null || numbers.Count == 0)
{
throw new InvalidOperationException("The list is empty or null.");
}
numbers.Sort();
int count = numbers.Count;
if (count % 2 == 0)
{
// Even number of elements
double mid1 = numbers[count / 2 - 1];
double mid2 = numbers[count / 2];
return (mid1 + mid2) / 2.0;
}
else
{
// Odd number of elements
return numbers[count / 2];
}
}
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net6</TargetFramework>
<AssemblyName>CarbonLib</AssemblyName> <AssemblyName>CarbonLib</AssemblyName>
<PackageId>CarbonLib</PackageId> <PackageId>CarbonLib</PackageId>
<RuntimeIdentifiers>win-x64;linux-x64;linux-musl-x64</RuntimeIdentifiers> <RuntimeIdentifiers>win10-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>4.17.0</Version> <Version>4.13.0</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Base.Core.Common.Geometry" Version="4.17.0-prerelease.2113" /> <PackageReference Include="Base.Core.Common.Geometry" Version="4.13.0-prerelease.2107" />
<PackageReference Include="NetTopologySuite" Version="2.5.0" /> <PackageReference Include="NetTopologySuite" Version="2.5.0" />
<PackageReference Include="NetTopologySuite.IO.GeoJSON" Version="3.0.0" /> <PackageReference Include="NetTopologySuite.IO.GeoJSON" Version="3.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -13,7 +13,6 @@ namespace FarmMapsAPI.Carbon
string Validate(CarbonRequest farmInput); string Validate(CarbonRequest farmInput);
CarbonRequest MapFarmMapsToMiterra(FarmMapsCarbonRequest farmInput); CarbonRequest MapFarmMapsToMiterra(FarmMapsCarbonRequest farmInput);
CarbonSummary Calculate(CarbonRequest farmInput); CarbonSummary Calculate(CarbonRequest farmInput);
CarbonSummary CalculateClimateScenario(CarbonRequest farmInput);
double? GetCropYield(string cropCode, int year, int postalCode); double? GetCropYield(string cropCode, int year, int postalCode);
} }
} }

View File

@@ -11,14 +11,6 @@ namespace FarmMapsAPI.Carbon.Models
public List<CropFieldSummary> CropField { get; set; } public List<CropFieldSummary> CropField { get; set; }
} }
public class CarbonSummaryList
{
[JsonProperty("cropFieldClimate")]
public List<CropFieldSummaryList> CropFieldClimate { get; set; }
[JsonProperty("cropField")]
public CarbonSummary CarbonSummary { get; set; }
}
public class CropFieldSummary public class CropFieldSummary
{ {
[JsonProperty("name")] [JsonProperty("name")]
@@ -27,14 +19,6 @@ namespace FarmMapsAPI.Carbon.Models
public List<YearSummary> Summary { get; set; } public List<YearSummary> Summary { get; set; }
} }
public class CropFieldSummaryList
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("summary")]
public List<YearSummaryClimate> SummaryList { get; set; }
}
public class YearSummary public class YearSummary
{ {
[JsonProperty("crop")] [JsonProperty("crop")]
@@ -53,8 +37,6 @@ namespace FarmMapsAPI.Carbon.Models
public double IniCcontent { get; set; } public double IniCcontent { get; set; }
[JsonProperty("oM_ini")] [JsonProperty("oM_ini")]
public double OM_ini { get; set; } public double OM_ini { get; set; }
[JsonProperty("oM_ini_Climate")]
public List<double> OM_ini_Climate { get; set; }
[JsonProperty("cO2seq")] [JsonProperty("cO2seq")]
public double CO2seq { get; set; } public double CO2seq { get; set; }
[JsonProperty("soC_CarbonCompost")] [JsonProperty("soC_CarbonCompost")]
@@ -69,39 +51,6 @@ namespace FarmMapsAPI.Carbon.Models
public double Emision { get; set; } public double Emision { get; set; }
} }
public class YearSummaryClimate
{
[JsonProperty("crop")]
public string Crop { get; set; }
[JsonProperty("year")]
public int Year { get; set; }
[JsonProperty("bulk_Density")]
public List<double> Bulk_Density { get; set; }
[JsonProperty("total_crop_area")]
public double Total_crop_area { get; set; }
[JsonProperty("balance")]
public List<double> Balance { get; set; }
[JsonProperty("initial")]
public List<double> Initial { get; set; }
[JsonProperty("iniCcontent")]
public List<double> IniCcontent { get; set; }
[JsonProperty("oM_ini")]
public List<double> OM_ini { get; set; }
[JsonProperty("cO2seq")]
public List<double> CO2seq { get; set; }
[JsonProperty("soC_CarbonCompost")]
public List<double> SOC_CarbonCompost { get; set; }
[JsonProperty("soC_CarbonGreenManure")]
public List<double> SOC_CarbonGreenManure { get; set; }
[JsonProperty("soC_CarbonResidues")]
public List<double> SOC_CarbonResidues { get; set; }
[JsonProperty("soC_CarbonManure")]
public List<double> SOC_CarbonManure { get; set; }
[JsonProperty("emision")]
public List<double> Emision { get; set; }
}
public class FarmYearSummary public class FarmYearSummary
{ {
[JsonProperty("year")] [JsonProperty("year")]

View File

@@ -13,7 +13,7 @@ namespace FarmMapsAPI.Carbon.Models
{ {
public class FarmMapsCarbonRequest public class FarmMapsCarbonRequest
{ {
public string ModelYear { get; set; } public int? ModelYear { get; set; }
public string ScenarioName { get; set; } public string ScenarioName { get; set; }
public int PostalCode { get; set; } public int PostalCode { get; set; }