10 Commits

Author SHA1 Message Date
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
eb2e80d312 aw6383: cleanup
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-11-17 15:01:27 +01:00
25ee9ff819 aw6373: init property
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-11-14 15:57:10 +01:00
9e63a86e1e aw6373: ignore property
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-11-14 15:21:37 +01:00
346b6eaf78 aw6373: read organic matter from eurofins if available
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-11-14 13:51:34 +01:00
jenkins
7f510c7c8e Updated project references #109
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
2024-10-29 13:00:18 +00: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
3 changed files with 26 additions and 66 deletions

View File

@@ -217,7 +217,15 @@ namespace FarmMapsAPI.Carbon
{ {
string provinceCode = GetProvinceCode(dataTransformationSet, postalCode); string provinceCode = GetProvinceCode(dataTransformationSet, postalCode);
var crpYield = cropYieldConfig.SingleOrDefault(x => x.CropName.ToLower() == cropCode.ToLower()); var crpYield = cropYieldConfig.SingleOrDefault(x => x.CropName.ToLower() == cropCode.ToLower());
if (crpYield == null)
{
return 0;
}
var crpYieldProvince = crpYield.Yields.SingleOrDefault(x => x.ProvinceCode == provinceCode); var crpYieldProvince = crpYield.Yields.SingleOrDefault(x => x.ProvinceCode == provinceCode);
if (crpYieldProvince == null)
{
return 0;
}
var cropYield = crpYieldProvince.YearData.SingleOrDefault(x => x.Year == year)?.YieldValue; var cropYield = crpYieldProvince.YearData.SingleOrDefault(x => x.Year == year)?.YieldValue;
return cropYield; return cropYield;
} }

View File

@@ -8,75 +8,13 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>4.11.0</Version> <Version>4.12.0</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Base.Core.Common.Geometry" Version="4.11.0-prerelease.2103" /> <PackageReference Include="Base.Core.Common.Geometry" Version="4.12.0-prerelease.2104" />
<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>
<ItemGroup>
<None Update="config\CropCoverMonth.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropProperties.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropSets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropYield.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\CropYield.json.old">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\Farm_input_sets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\GIS_Soil_Sets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\KNMI_data.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\ManCcont.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\Mapping\MappingCropsFarmmapsMiterraRothC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\Mapping\MappingGreenManureFarmmapsMiterraRothC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\ParametersRothC.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.cpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.dbf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.prj">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.shp">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\PC4\PC4.shx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\RegionSets.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\SetsForDataTransformation.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config\YieldGreenManure.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@@ -21,6 +21,9 @@ namespace FarmMapsAPI.Carbon.Models
//added //added
public int CalculateUntil { get; set; } public int CalculateUntil { get; set; }
[JsonIgnore]
public int CalculateFrom { get; set; } = 0;
} }
public class CropFieldFarmMaps public class CropFieldFarmMaps
@@ -31,10 +34,11 @@ namespace FarmMapsAPI.Carbon.Models
public double Area { get; set; } public double Area { get; set; }
[Required] [Required]
public string SoilType { get; set; } public string SoilType { get; set; }
public string SoilTypeDefault { get; set; }
[Required] [Required]
public SoilPropertyFarmMaps SoilProperty { get; set; } public SoilPropertyFarmMaps SoilProperty { get; set; }
[Required] [Required]
public List<HistoricalCropDataFarmMaps> HistoricalCropData { get; set; } public List<HistoricalCropDataFarmMaps> HistoricalCropData { get; set; }
} }
public class HistoricalCropDataFarmMaps public class HistoricalCropDataFarmMaps
@@ -78,10 +82,20 @@ namespace FarmMapsAPI.Carbon.Models
{ {
public double? OM_Const { get; set; } public double? OM_Const { get; set; }
public double? C_Const { get; set; } public double? C_Const { get; set; }
public double? OM_ConstDefault { get; set; }
public string OM_Choice { get; set; } public string OM_Choice { get; set; }
public double? Clay_Content { get; set; } public double? Clay_Content { get; set; }
public double? Clay_ContentDefault { get; set; }
public bool Depth10 { get; set; } public bool Depth10 { get; set; }
public int? Depth { get; set; } public int? Depth { get; set; }
[JsonIgnore]
public List<OrganicMatterFarmMaps> OrganicMatters { get; set; }
}
public class OrganicMatterFarmMaps
{
public int Year { get; set; }
public double OrganicMatter { get; set; }
} }
public class GreenManureTypeFarmMaps public class GreenManureTypeFarmMaps