diff --git a/CarbonConsoleApp/Program.cs b/CarbonConsoleApp/Program.cs index d6f9108..58e956e 100644 --- a/CarbonConsoleApp/Program.cs +++ b/CarbonConsoleApp/Program.cs @@ -1,8 +1,7 @@ using CarbonService.Models; -using FarmMapsAPI.Carbon; +using CarbonLib.Carbon; using Newtonsoft.Json; - namespace CarbonConsoleApp { class Program @@ -10,7 +9,7 @@ namespace CarbonConsoleApp static void Main(string[] args) { var configPath = "config25"; - ICarbonCalculation carbonCalc = new FarmMapsAPI.Carbon.CarbonCalculation25(configPath); + ICarbonCalculation carbonCalc = new CarbonLib.Carbon.CarbonCalculation25(configPath); var request = new CarbonRequest(); using (var reader = new StreamReader("input.txt")) { diff --git a/CarbonLib/CarbonCalculation.cs b/CarbonLib/CarbonCalculation.cs index 5e46f0b..f3134ac 100644 --- a/CarbonLib/CarbonCalculation.cs +++ b/CarbonLib/CarbonCalculation.cs @@ -1,11 +1,7 @@ -using CarbonService.Models; -using FarmMapsAPI.Carbon; -using FarmMapsAPI.Carbon.Models; +using CarbonLib.Carbon; +using CarbonService.Models; +using CarbonLib.Carbon.Models; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace CarbonLib { diff --git a/CarbonLib/CarbonCalculation24.cs b/CarbonLib/CarbonCalculation24.cs index d729fe4..6d1ce32 100644 --- a/CarbonLib/CarbonCalculation24.cs +++ b/CarbonLib/CarbonCalculation24.cs @@ -1,18 +1,12 @@ -//using Base.Core.Common; -//using Base.Core.Common.Geometry; -using CarbonLib; -using CarbonService.Models; -using FarmMapsAPI.Carbon.Models; -using NetTopologySuite.Geometries; -using OSGeo.OGR; +using CarbonService.Models; +using CarbonLib.Carbon.Models; using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using System.Threading.Tasks; -namespace FarmMapsAPI.Carbon +namespace CarbonLib.Carbon { public class CarbonCalculation24 : ICarbonCalculation { diff --git a/CarbonLib/CarbonCalculation25.cs b/CarbonLib/CarbonCalculation25.cs index cca81f3..bf4b616 100644 --- a/CarbonLib/CarbonCalculation25.cs +++ b/CarbonLib/CarbonCalculation25.cs @@ -1,7 +1,8 @@ //using Base.Core.Common.Geometry; using CarbonLib; +using CarbonLib.Carbon; using CarbonService.Models; -using FarmMapsAPI.Carbon.Models; +using CarbonLib.Carbon.Models; using NetTopologySuite.Geometries; using OSGeo.OGR; using System; @@ -12,7 +13,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace FarmMapsAPI.Carbon +namespace CarbonLib.Carbon { public class CarbonCalculation25 : ICarbonCalculation { diff --git a/CarbonLib/GamsSets.cs b/CarbonLib/GamsSets.cs index 8f190bf..c767bb4 100644 --- a/CarbonLib/GamsSets.cs +++ b/CarbonLib/GamsSets.cs @@ -5,7 +5,7 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -namespace FarmMapsAPI.Carbon +namespace CarbonLib.Carbon { public class GamsSets { diff --git a/CarbonLib/ICarbonCalculation.cs b/CarbonLib/ICarbonCalculation.cs index 33171a0..ff99532 100644 --- a/CarbonLib/ICarbonCalculation.cs +++ b/CarbonLib/ICarbonCalculation.cs @@ -1,12 +1,12 @@ using CarbonService.Models; -using FarmMapsAPI.Carbon.Models; +using CarbonLib.Carbon.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace FarmMapsAPI.Carbon +namespace CarbonLib.Carbon { public interface ICarbonCalculation { diff --git a/CarbonLib/Models/CarbonSummary.cs b/CarbonLib/Models/CarbonSummary.cs index eb396eb..a033a75 100644 --- a/CarbonLib/Models/CarbonSummary.cs +++ b/CarbonLib/Models/CarbonSummary.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class CarbonSummary { diff --git a/CarbonLib/Models/ClimateVariable.cs b/CarbonLib/Models/ClimateVariable.cs index 95d017e..2c1b1b6 100644 --- a/CarbonLib/Models/ClimateVariable.cs +++ b/CarbonLib/Models/ClimateVariable.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class ClimateVariable { diff --git a/CarbonLib/Models/ColumnValue.cs b/CarbonLib/Models/ColumnValue.cs index 5a07fc8..2eeee1b 100644 --- a/CarbonLib/Models/ColumnValue.cs +++ b/CarbonLib/Models/ColumnValue.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class ColumnValue { diff --git a/CarbonLib/Models/CropCoverMonthsModel.cs b/CarbonLib/Models/CropCoverMonthsModel.cs index cbeaf32..9f412f1 100644 --- a/CarbonLib/Models/CropCoverMonthsModel.cs +++ b/CarbonLib/Models/CropCoverMonthsModel.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class CropCoverMonthsModel { diff --git a/CarbonLib/Models/CropPropertyModel.cs b/CarbonLib/Models/CropPropertyModel.cs index 3187dee..8bff7c6 100644 --- a/CarbonLib/Models/CropPropertyModel.cs +++ b/CarbonLib/Models/CropPropertyModel.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class CropPropertyModel { diff --git a/CarbonLib/Models/CropSets.cs b/CarbonLib/Models/CropSets.cs index 6671eab..bbf9de8 100644 --- a/CarbonLib/Models/CropSets.cs +++ b/CarbonLib/Models/CropSets.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class StrawCrp { diff --git a/CarbonLib/Models/CropYieldModel.cs b/CarbonLib/Models/CropYieldModel.cs index dc2f3ae..307571c 100644 --- a/CarbonLib/Models/CropYieldModel.cs +++ b/CarbonLib/Models/CropYieldModel.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class YearData { diff --git a/CarbonLib/Models/FarmInputsetsModel.cs b/CarbonLib/Models/FarmInputsetsModel.cs index 71ae5bc..01f624c 100644 --- a/CarbonLib/Models/FarmInputsetsModel.cs +++ b/CarbonLib/Models/FarmInputsetsModel.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class ManureSourcesLiv { diff --git a/CarbonLib/Models/FarmMapsCarbonRequest.cs b/CarbonLib/Models/FarmMapsCarbonRequest.cs index 7eeabfe..0c3699d 100644 --- a/CarbonLib/Models/FarmMapsCarbonRequest.cs +++ b/CarbonLib/Models/FarmMapsCarbonRequest.cs @@ -9,7 +9,7 @@ using System.Runtime.Serialization; using System.Text.Json.Serialization; using System.Threading.Tasks; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class FarmMapsCarbonRequest { diff --git a/CarbonLib/Models/GIS_Soils_Sets.cs b/CarbonLib/Models/GIS_Soils_Sets.cs index 1cf69ba..3e0a1ae 100644 --- a/CarbonLib/Models/GIS_Soils_Sets.cs +++ b/CarbonLib/Models/GIS_Soils_Sets.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class GIS_Soils_Sets { diff --git a/CarbonLib/Models/GamsParameter.cs b/CarbonLib/Models/GamsParameter.cs index 868485a..bae80b8 100644 --- a/CarbonLib/Models/GamsParameter.cs +++ b/CarbonLib/Models/GamsParameter.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class GamsThreeKeyParameter { diff --git a/CarbonLib/Models/ManCcontModel.cs b/CarbonLib/Models/ManCcontModel.cs index 3084214..a3ee930 100644 --- a/CarbonLib/Models/ManCcontModel.cs +++ b/CarbonLib/Models/ManCcontModel.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class ManCcontModel { diff --git a/CarbonLib/Models/MappingCropFarmmapsMiterraRothC.cs b/CarbonLib/Models/MappingCropFarmmapsMiterraRothC.cs index d305b27..b6b8dc5 100644 --- a/CarbonLib/Models/MappingCropFarmmapsMiterraRothC.cs +++ b/CarbonLib/Models/MappingCropFarmmapsMiterraRothC.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class MappingCropFarmmapsMiterraRothC { diff --git a/CarbonLib/Models/MappingGreenManureFarmmapsMiterraRothC.cs b/CarbonLib/Models/MappingGreenManureFarmmapsMiterraRothC.cs index b2dcc07..41a6eb5 100644 --- a/CarbonLib/Models/MappingGreenManureFarmmapsMiterraRothC.cs +++ b/CarbonLib/Models/MappingGreenManureFarmmapsMiterraRothC.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class MappingGreenManureFarmmapsMiterraRothC { diff --git a/CarbonLib/Models/ParameterSet.cs b/CarbonLib/Models/ParameterSet.cs index 47fe643..87cd669 100644 --- a/CarbonLib/Models/ParameterSet.cs +++ b/CarbonLib/Models/ParameterSet.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class ParameterSet { diff --git a/CarbonLib/Models/SetsForDataTransformation.cs b/CarbonLib/Models/SetsForDataTransformation.cs index c022af7..281edf2 100644 --- a/CarbonLib/Models/SetsForDataTransformation.cs +++ b/CarbonLib/Models/SetsForDataTransformation.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class KNMIZoneReg { diff --git a/CarbonLib/Models/SoilBulkDensityType.cs b/CarbonLib/Models/SoilBulkDensityType.cs index 4551b80..34c5a00 100644 --- a/CarbonLib/Models/SoilBulkDensityType.cs +++ b/CarbonLib/Models/SoilBulkDensityType.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class SoilBulkDensityType { diff --git a/CarbonLib/Models/SoilPropertyType.cs b/CarbonLib/Models/SoilPropertyType.cs index 328e422..9b81ace 100644 --- a/CarbonLib/Models/SoilPropertyType.cs +++ b/CarbonLib/Models/SoilPropertyType.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class SoilPropertyType { diff --git a/CarbonLib/Models/YieldGreenManureModel.cs b/CarbonLib/Models/YieldGreenManureModel.cs index a5f2fe2..fe79d9c 100644 --- a/CarbonLib/Models/YieldGreenManureModel.cs +++ b/CarbonLib/Models/YieldGreenManureModel.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace FarmMapsAPI.Carbon.Models +namespace CarbonLib.Carbon.Models { public class YieldGreenManureModel { diff --git a/README.md b/README.md index b61e40a..75fd800 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ # CarbonLib -# +# + +Library with model based on the scientifically acknowledged carbon model RothC. +This code in .NET Core c# is adapted from a a project written in GEMS. + +An test console app is included with an example input request. The output in written a a file. + + +## Building a sample + +Build the sample using the .NET Core CLI, which is installed with [the .NET Core SDK](https://www.microsoft.com/net/download). Then run +these commands from the CLI in the directory of the CarbonConsoleApp: + +```console +dotnet build +dotnet run +``` + +These will install any needed dependencies, build the project, and run +the project respectively.