diff --git a/DEM.Net.Core/DEM.Net.Core.csproj b/DEM.Net.Core/DEM.Net.Core.csproj index 3f577dbd..2aa38ad8 100644 --- a/DEM.Net.Core/DEM.Net.Core.csproj +++ b/DEM.Net.Core/DEM.Net.Core.csproj @@ -3,7 +3,7 @@ netstandard2.0;net461 DEM.Net.Core - 0.1.0-beta0006 + 0.1.0-beta0007 Xavier Fischer, Frédéric Aubin Xavier Fischer, Frédéric Aubin Xavier Fischer diff --git a/DEM.Net.Core/DependencyInjection/IServiceCollectionExtensions.cs b/DEM.Net.Core/DependencyInjection/IServiceCollectionExtensions.cs index 33107d3f..10ef9550 100644 --- a/DEM.Net.Core/DependencyInjection/IServiceCollectionExtensions.cs +++ b/DEM.Net.Core/DependencyInjection/IServiceCollectionExtensions.cs @@ -1,5 +1,4 @@ using DEM.Net.Core.Imagery; -using DEM.Net.Core.Services.Mesh; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; diff --git a/DEM.Net.Core/Services/Elevation/ElevationService.cs b/DEM.Net.Core/Services/Elevation/ElevationService.cs index 7e652570..bf09378b 100644 --- a/DEM.Net.Core/Services/Elevation/ElevationService.cs +++ b/DEM.Net.Core/Services/Elevation/ElevationService.cs @@ -44,7 +44,7 @@ public class ElevationService : IElevationService private readonly IRasterService _IRasterService; private readonly ILogger _logger; - public ElevationService(IRasterService rasterService, ILogger logger) + public ElevationService(IRasterService rasterService, ILogger logger = null) { _IRasterService = rasterService; _logger = logger; diff --git a/DEM.Net.Core/Services/Imagery/ImageryService.cs b/DEM.Net.Core/Services/Imagery/ImageryService.cs index 1a62ce3e..c0d66a6b 100644 --- a/DEM.Net.Core/Services/Imagery/ImageryService.cs +++ b/DEM.Net.Core/Services/Imagery/ImageryService.cs @@ -23,7 +23,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using DEM.Net.Core.Services.Mesh; using System; using System.Collections.Generic; using System.IO; @@ -61,7 +60,7 @@ public class ImageryService : IImageryService #if NETSTANDARD private readonly IConfigurationRoot _config; - public ImageryService(IMeshService meshService, ILogger logger) + public ImageryService(IMeshService meshService, ILogger logger = null) { _logger = logger; _meshService = meshService; diff --git a/DEM.Net.Core/Services/Mesh/BoxBaseThickness.cs b/DEM.Net.Core/Services/Mesh/BoxBaseThickness.cs index 026f0d1f..17820283 100644 --- a/DEM.Net.Core/Services/Mesh/BoxBaseThickness.cs +++ b/DEM.Net.Core/Services/Mesh/BoxBaseThickness.cs @@ -23,7 +23,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; -namespace DEM.Net.Core.Services.Mesh +namespace DEM.Net.Core { public enum BoxBaseThickness { diff --git a/DEM.Net.Core/Services/Mesh/IMeshService.cs b/DEM.Net.Core/Services/Mesh/IMeshService.cs index 975953a6..03821cb6 100644 --- a/DEM.Net.Core/Services/Mesh/IMeshService.cs +++ b/DEM.Net.Core/Services/Mesh/IMeshService.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Numerics; -namespace DEM.Net.Core.Services.Mesh +namespace DEM.Net.Core { public interface IMeshService { diff --git a/DEM.Net.Core/Services/Mesh/MeshService.cs b/DEM.Net.Core/Services/Mesh/MeshService.cs index 18a305ef..97a55f94 100644 --- a/DEM.Net.Core/Services/Mesh/MeshService.cs +++ b/DEM.Net.Core/Services/Mesh/MeshService.cs @@ -31,13 +31,13 @@ using System.Text; using System.Threading.Tasks; -namespace DEM.Net.Core.Services.Mesh +namespace DEM.Net.Core { public class MeshService : IMeshService { private readonly ILogger _logger; - public MeshService(ILogger logger) + public MeshService(ILogger logger = null) { _logger = logger; } diff --git a/DEM.Net.Core/Services/Mesh/TriangulationResult.cs b/DEM.Net.Core/Services/Mesh/TriangulationResult.cs index a2019ab1..7dc9675b 100644 --- a/DEM.Net.Core/Services/Mesh/TriangulationResult.cs +++ b/DEM.Net.Core/Services/Mesh/TriangulationResult.cs @@ -30,7 +30,7 @@ using System.Text; using System.Threading.Tasks; -namespace DEM.Net.Core.Services.Mesh +namespace DEM.Net.Core { public class TriangulationResult { diff --git a/DEM.Net.Core/Services/Raster/GDALVRTFileService.cs b/DEM.Net.Core/Services/Raster/GDALVRTFileService.cs index f21cd348..8a7e1996 100644 --- a/DEM.Net.Core/Services/Raster/GDALVRTFileService.cs +++ b/DEM.Net.Core/Services/Raster/GDALVRTFileService.cs @@ -59,6 +59,7 @@ public GDALVRTFileService(string localDirectory, DEMDataSet dataSet) { _localDirectory = localDirectory; _dataSet = dataSet; + _cacheByDemName = new Dictionary>(); } /// diff --git a/DEM.Net.Core/Services/Raster/RasterService.cs b/DEM.Net.Core/Services/Raster/RasterService.cs index b3543cf1..40c5d746 100644 --- a/DEM.Net.Core/Services/Raster/RasterService.cs +++ b/DEM.Net.Core/Services/Raster/RasterService.cs @@ -52,10 +52,11 @@ public string LocalDirectory get { return _localDirectory; } } - public RasterService(ILogger logger) + public RasterService(ILogger logger = null) { _logger = logger; - _localDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), APP_NAME); + //_localDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), APP_NAME); + _localDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), APP_NAME); if (!Directory.Exists(_localDirectory)) Directory.CreateDirectory(_localDirectory); diff --git a/DEM.Net.Test/DEM.Net.Test.csproj b/DEM.Net.Test/DEM.Net.Test.csproj deleted file mode 100644 index 8b249ce5..00000000 --- a/DEM.Net.Test/DEM.Net.Test.csproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - netcoreapp2.2 - - false - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - diff --git a/DEM.Net.Test/DatasetTests.cs b/DEM.Net.Test/DatasetTests.cs deleted file mode 100644 index a77d7bf5..00000000 --- a/DEM.Net.Test/DatasetTests.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using DEM.Net.Lib; -using System.IO; -using System.Linq; - -namespace DEM.Net.Test -{ - [TestClass] - public class DatasetTests - { - IRasterService _rasterService; - IElevationService _elevationService; - - [TestInitialize()] - public void Initialize() - { - _rasterService = new RasterService("."); - _elevationService = new ElevationService(_rasterService); - - - } - - [TestMethod] - [TestCategory("Dataset")] - [Priority(1)] - public void DatasetTest_SRTM_GL1() - { - - DEMDataSet dataset = DEMDataSet.SRTM_GL1; - GDALVRTFileService vrtService = new GDALVRTFileService(_rasterService.GetLocalDEMPath(dataset), dataset); - vrtService.Setup(false); - - Assert.IsTrue(vrtService.Sources().Any()); - } - [TestMethod] - [TestCategory("Dataset")] - [Priority(1)] - public void DatasetTest_SRTM_GL3() - { - DEMDataSet dataset = DEMDataSet.SRTM_GL3; - GDALVRTFileService vrtService = new GDALVRTFileService(_rasterService.GetLocalDEMPath(dataset), dataset); - vrtService.Setup(false); - - Assert.IsTrue(vrtService.Sources().Any()); - - } - [TestMethod] - [TestCategory("Dataset")] - [Priority(1)] - public void DatasetTest_AW3D() - { - DEMDataSet dataset = DEMDataSet.AW3D30; - GDALVRTFileService vrtService = new GDALVRTFileService(_rasterService.GetLocalDEMPath(dataset), dataset); - vrtService.Setup(false); - - Assert.IsTrue(vrtService.Sources().Any()); - - } - - - - [TestMethod] - [TestCategory("Dataset")] - public void DownloadTile_Location() - { - - double lat = 43.537854; - double lon = 5.429993; - - DEMDataSet dataset = DEMDataSet.SRTM_GL3; - _elevationService.DownloadMissingFiles(dataset, lat, lon); - - var report = _rasterService.GenerateReportForLocation(dataset, lat, lon); - - Assert.IsNotNull(report); - Assert.IsTrue(report.Count > 0); - Assert.IsTrue(report.Values.First().IsExistingLocally); - } - - [TestMethod] - [TestCategory("Dataset")] - public void DownloadTile_BBox() - { - - const string WKT_BBOX_AIX_PUYRICARD = "POLYGON ((5.429993 43.537854, 5.459132 43.537854, 5.459132 43.58151, 5.429993 43.58151, 5.429993 43.537854))"; - - DEMDataSet dataset = DEMDataSet.SRTM_GL3; - BoundingBox bbox = GeometryService.GetBoundingBox(WKT_BBOX_AIX_PUYRICARD); - - _elevationService.DownloadMissingFiles(dataset, bbox); - var report = _rasterService.GenerateReport(dataset, bbox); - - Assert.IsNotNull(report); - Assert.IsTrue(report.Count > 0); - Assert.IsTrue(report.Values.First().IsExistingLocally); - Assert.AreEqual(Path.GetFileName(report.Values.First().LocalName), "N43E005.hgt", "Bad bbox query result"); - } - - [TestMethod] - [TestCategory("Dataset")] - public void GDALVrtPerDataset_Test() - { - double lat = 43.537854; - double lon = 5.429993; - - DEMDataSet dataset = DEMDataSet.SRTM_GL3; - var report_SRTM_GL3 = _rasterService.GenerateReportForLocation(dataset, lat, lon); - - // now change the dataset - dataset = DEMDataSet.AW3D30; - var report_AW3D30 = _rasterService.GenerateReportForLocation(dataset, lat, lon); - - Assert.IsNotNull(report_SRTM_GL3); - Assert.IsNotNull(report_AW3D30); - Assert.IsTrue(report_SRTM_GL3.Count == 1); - Assert.IsTrue(report_AW3D30.Count == 1); - Assert.AreNotEqual(report_SRTM_GL3.Values.First().LocalName - , report_AW3D30.Values.First().LocalName - , "Raster service is using the same instance of GDALVrtService !"); - } - - - - - - } -} diff --git a/DEM.Net.Test/ElevationTests.cs b/DEM.Net.Test/ElevationTests.cs deleted file mode 100644 index 77ca64f2..00000000 --- a/DEM.Net.Test/ElevationTests.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using DEM.Net.Lib; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace DEM.Net.Test -{ - [TestClass] - public class ElevationTests - { - IRasterService _rasterService; - IElevationService _elevationService; - - [TestInitialize()] - public void Initialize() - { - _rasterService = new RasterService("."); - _elevationService = new ElevationService(_rasterService); - } - - [TestMethod] - [TestCategory("Elevation")] - public void TestMethod1() - { - } - } -} diff --git a/DEM.Net.Test/GeometryTests.cs b/DEM.Net.Test/GeometryTests.cs deleted file mode 100644 index 69c9de66..00000000 --- a/DEM.Net.Test/GeometryTests.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Linq; -using DEM.Net.Lib; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace DEM.Net.Test -{ - [TestClass] - public class GeometryTests - { - GeoPoint[] _linePoints; - - [TestInitialize()] - public void Init() - { - _linePoints = new GeoPoint[] { - new GeoPoint(43.429923, 0.517782), - new GeoPoint(43.093901, 0.451817), - new GeoPoint(42.610654, 0.27591), - new GeoPoint(42.237605, 0.165969), - new GeoPoint(41.796848, -0.053915) - }; - - } - [TestMethod] - public void SegmentsTest() - { - - - var lineGeom = GeometryService.ParseGeoPointAsGeometryLine(_linePoints); - - Assert.IsNotNull(lineGeom, "Line construction from points failed"); - Assert.IsTrue(lineGeom.Coordinates.Length == _linePoints.Length, "Coordinate count mismatch"); - - var segments = GeometryService.Segments(lineGeom); - Assert.IsTrue(segments.Count() == lineGeom.Coordinates.Length - 1, "Segment enumeration failed"); - } - - } -} diff --git a/DEM.Net.Test/HeightMapTests.cs b/DEM.Net.Test/HeightMapTests.cs deleted file mode 100644 index a047eddf..00000000 --- a/DEM.Net.Test/HeightMapTests.cs +++ /dev/null @@ -1,62 +0,0 @@ -using DEM.Net.Lib; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace DEM.Net.Test -{ - [TestClass] - public class HeightMapTests - { - - [TestMethod] - public void BoudingBoxConservationTest() - { - - string bboxWKT = "POLYGON((5.54888 43.519525, 5.61209 43.519525, 5.61209 43.565225, 5.54888 43.565225, 5.54888 43.519525))"; - - RasterService rasterService = new RasterService(); - ElevationService elevationService = new ElevationService(rasterService); - BoundingBox bbox = GeometryService.GetBoundingBox(bboxWKT); - - Assert.IsNotNull(bbox); - Assert.AreEqual(bbox.WKT, bboxWKT); - - HeightMap heightMap = elevationService.GetHeightMap(bbox, DEMDataSet.SRTM_GL1); - - heightMap = heightMap.ReprojectGeodeticToCartesian().BakeCoordinates(); - Assert.IsTrue(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); - - heightMap = heightMap.ZScale(2.5f).BakeCoordinates(); - Assert.IsTrue(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); - - heightMap = heightMap.CenterOnOrigin().BakeCoordinates(); - Assert.IsTrue(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); - - heightMap = heightMap.FitInto(30f).BakeCoordinates(); - Assert.IsTrue(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); - - } - - [TestMethod] - public void BoudingBoxEqualityTest() - { - - string bboxWKT = "POLYGON((5.54888 43.519525, 5.61209 43.519525, 5.61209 43.565225, 5.54888 43.565225, 5.54888 43.519525))"; - - RasterService rasterService = new RasterService(); - ElevationService elevationService = new ElevationService(rasterService); - BoundingBox bbox = GeometryService.GetBoundingBox(bboxWKT); - - Assert.IsNotNull(bbox); - Assert.AreEqual(bbox.WKT, bboxWKT); - - HeightMap heightMap = elevationService.GetHeightMap(bbox, DEMDataSet.SRTM_GL1); - - Assert.AreNotEqual(bbox, null); - Assert.AreNotEqual(heightMap.Coordinates.GetBoundingBox(), null); - Assert.IsTrue(heightMap.BoundingBox == heightMap.Coordinates.GetBoundingBox()); - Assert.IsFalse(heightMap.BoundingBox != heightMap.Coordinates.GetBoundingBox()); - - } - - } -} diff --git a/DEM.Net.Test/MiscTests.cs b/DEM.Net.Test/MiscTests.cs deleted file mode 100644 index 7ae2ea81..00000000 --- a/DEM.Net.Test/MiscTests.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Linq; -using DEM.Net.Lib; -using GeoAPI.Geometries; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace DEM.Net.Test -{ - [TestClass] - public class MiscTests - { - - [TestMethod] - [TestCategory("Misc / Geometry")] - public void LineLineIntersectionTest() - { - string wkt1 = "LINESTRING(-5.888671875 47.90161354142077,3.4716796875 44.11914151643737)"; - string wkt2 = "LINESTRING(-2.8564453125 44.30812668488613,5.625 48.166085419012525)"; - IGeometry geom1 = GeometryService.ParseWKTAsGeometry(wkt1); - IGeometry geom2 = GeometryService.ParseWKTAsGeometry(wkt2); - - - IGeometry intersection = geom1.Intersection(geom2); - - GeoSegment seg1 = geom1.Segments().First(); - GeoSegment seg2 = geom2.Segments().First(); - GeoPoint intersectionResult = GeoPoint.Zero; - - bool intersects = GeometryService.LineLineIntersection(out intersectionResult, seg1, seg2); - - - double dist = intersection.Coordinate.ToGeoPoint().DistanceTo(intersectionResult); - - - Assert.IsTrue(dist < 0.05d, "Problem in intersection calculation."); - } - } -} diff --git a/DEM.Net.Test/RasterTests.cs b/DEM.Net.Test/RasterTests.cs deleted file mode 100644 index 89dbc1b7..00000000 --- a/DEM.Net.Test/RasterTests.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.IO; -using System.IO.Compression; -using DEM.Net.Lib; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace DEM.Net.Test -{ - [TestClass] - public class RasterTests - { - IRasterService _rasterService; - IElevationService _elevationService; - - [TestInitialize()] - public void Initialize() - { - _rasterService = new RasterService("."); // local dir - _elevationService = new ElevationService(_rasterService); - - } - - [TestMethod] - [TestCategory("Raster")] - [DeploymentItem(@"TestData\N043E005_AVE_DSM.tif.zip")] - public void Test_FileFormat_GeoTIFF() - { - string fileName = "N043E005_AVE_DSM.tif"; - bool fileOk = File.Exists(fileName + ".zip"); - - Assert.IsTrue(fileOk, "DeploymentItem is not enabled. Please use the .testsettings file provided in the project."); - - if (!File.Exists(fileName)) - { - ZipFile.ExtractToDirectory(fileName + ".zip", "."); - } - - Assert.IsTrue(File.Exists(fileName), "Unzip failed."); - - - using (IRasterFile raster = _rasterService.OpenFile(fileName, DEMFileFormat.GEOTIFF)) - { - FileMetadata metaData = raster.ParseMetaData(); - Assert.IsNotNull(metaData); - - float elevation = raster.GetElevationAtPoint(metaData, 1000, 200); - Assert.AreEqual(elevation, 304); - - elevation = raster.GetElevationAtPoint(metaData, 200, 1000); - Assert.AreEqual(elevation, 95); - - } - } - - [TestMethod] - [TestCategory("Raster")] - [DeploymentItem(@"TestData\N43E005.hgt.zip")] - public void Test_FileFormat_HGT() - { - string fileName = "N43E005.hgt"; - bool fileOk = File.Exists(fileName + ".zip"); - - Assert.IsTrue(fileOk, "DeploymentItem is not enabled. Please use the .testsettings file provided in the project."); - - if (!File.Exists(fileName)) - { - ZipFile.ExtractToDirectory(fileName + ".zip", "."); - } - - Assert.IsTrue(File.Exists(fileName), "Unzip failed."); - - - using (IRasterFile raster = _rasterService.OpenFile(fileName, DEMFileFormat.SRTM_HGT)) - { - FileMetadata metaData = raster.ParseMetaData(); - Assert.IsNotNull(metaData); - - float elevation = raster.GetElevationAtPoint(metaData, 300, 10); - Assert.AreEqual(elevation, 751); - - elevation = raster.GetElevationAtPoint(metaData, 10, 300); - Assert.AreEqual(elevation, 297); - } - } - - [TestMethod] - [TestCategory("Raster")] - [ExpectedException(typeof(IndexOutOfRangeException))] - [DeploymentItem(@"TestData\N43E005.hgt.zip")] - public void Test_FileFormat_HGT_OutOfRange() - { - string fileName = "N43E005.hgt"; - bool fileOk = File.Exists(fileName + ".zip"); - - Assert.IsTrue(fileOk, "DeploymentItem is not enabled. Please use the .testsettings file provided in the project."); - - if (!File.Exists(fileName)) - { - ZipFile.ExtractToDirectory(fileName + ".zip", "."); - } - - Assert.IsTrue(File.Exists(fileName), "Unzip failed."); - - - using (IRasterFile raster = _rasterService.OpenFile(fileName, DEMFileFormat.SRTM_HGT)) - { - FileMetadata metaData = raster.ParseMetaData(); - Assert.IsNotNull(metaData); - - float elevation = raster.GetElevationAtPoint(metaData, 10000, 10000); - - // Expect exception - } - } - } -} diff --git a/DEM.Net.Test/TestData/N043E005_AVE_DSM.tif.zip b/DEM.Net.Test/TestData/N043E005_AVE_DSM.tif.zip deleted file mode 100644 index 60d12d0e..00000000 Binary files a/DEM.Net.Test/TestData/N043E005_AVE_DSM.tif.zip and /dev/null differ diff --git a/DEM.Net.Test/TestData/N43E005.hgt.zip b/DEM.Net.Test/TestData/N43E005.hgt.zip deleted file mode 100644 index 78a3eb67..00000000 Binary files a/DEM.Net.Test/TestData/N43E005.hgt.zip and /dev/null differ diff --git a/DEM.Net.Test/TestData/lauzannier.gpx b/DEM.Net.Test/TestData/lauzannier.gpx deleted file mode 100644 index a04cb25c..00000000 --- a/DEM.Net.Test/TestData/lauzannier.gpx +++ /dev/null @@ -1,297 +0,0 @@ - - - 8976541-Lac des Hommes - - - 1995 - - - - 1940 - - - - 1912 - - - - 1915 - - - - 1907 - - - - 1910 - - - - 1937 - - - - 1947 - - - - 1934 - - - - 1971 - - - - 1976 - - - - 1989 - - - - 2040 - - - - 2052 - - - - 2083 - - - - 2097 - - - - 2127 - - - - 2208 - - - - 2242 - - - - 2287 - - - - 2300 - - - - 2324 - - - - 2355 - - - - 2424 - - - - 2430 - - - - 2442 - - - - 2524 - - - - 2595 - - - - 2613 - - - - 2640 - - - - 2654 - - - - 2616 - - - - 2631 - - - - 2631 - - - - 2553 - - - - 2524 - - - - 2454 - - - - 2368 - - - - 2272 - - - - 2214 - - - - 2154 - - - - 2088 - - - - 2084 - - - - 2048 - - - - 2045 - - - - 2015 - - - - 1994 - - - - 1984 - - - - 1978 - - - - 1974 - - - - 1970 - - - - 1960 - - - - 1942 - - - - 1935 - - - - 1930 - - - - 1929 - - - - 1924 - - - - 1913 - - - - 1907 - - - - 1906 - - - - 1916 - - - - 1915 - - - - 1919 - - - - 1916 - - - - 1922 - - - - 1941 - - - - 1973 - - - - 1993 - - - - 1994 - - - - 1985 - - - - 1997 - - - - 1996 - - - - \ No newline at end of file diff --git a/DEM.Net.Test/settings.runsettings b/DEM.Net.Test/settings.runsettings deleted file mode 100644 index e58f775a..00000000 --- a/DEM.Net.Test/settings.runsettings +++ /dev/null @@ -1,61 +0,0 @@ - - - - - 1 - - .\TestResults - - - - x86 - - - Framework45 - - - - - - - 1000000 - - - - - - - - - - diff --git a/DEM.Net.TestWinForm/CtrlTestLab.cs b/DEM.Net.TestWinForm/CtrlTestLab.cs index 18a019dd..4fe36976 100644 --- a/DEM.Net.TestWinForm/CtrlTestLab.cs +++ b/DEM.Net.TestWinForm/CtrlTestLab.cs @@ -17,6 +17,8 @@ using DEM.Net.Core.Services.VisualisationServices; using NetTopologySuite.Diagnostics.Tracing; using GeoAPI.Geometries; +using DEM.Net.Core.Services.Mesh; +using Microsoft.Extensions.Logging; namespace DEM.Net.TestWinForm { @@ -257,7 +259,7 @@ private void btnTestFacettes_Click(object sender, EventArgs e) } } // - IglTFService glTFService = new glTFService(); + IglTFService glTFService = new glTFService(null, new MeshService(null)); MeshPrimitive v_trianglesMesh = glTFService.GenerateTriangleMesh(v_beanToVisu3d.p00_geoPoint, v_beanToVisu3d.p01_listeIndexPointsfacettes.SelectMany(c => c).ToList()); Model model = glTFService.GenerateModel(v_trianglesMesh, "Test Triangles"); diff --git a/DEM.Net.TestWinForm/DEM.Net.TestWinForm.csproj b/DEM.Net.TestWinForm/DEM.Net.TestWinForm.csproj index 99a75b3a..a9db3508 100644 --- a/DEM.Net.TestWinForm/DEM.Net.TestWinForm.csproj +++ b/DEM.Net.TestWinForm/DEM.Net.TestWinForm.csproj @@ -51,6 +51,9 @@ ..\packages\glTF2Loader.1.1.3-alpha\lib\net35\glTFLoader.dll + + ..\..\..\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.logging.abstractions\2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll + ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll True diff --git a/DEM.Net.TestWinForm/EchantillonsTestsServices.cs b/DEM.Net.TestWinForm/EchantillonsTestsServices.cs index 6b1febde..c7aeccc9 100644 --- a/DEM.Net.TestWinForm/EchantillonsTestsServices.cs +++ b/DEM.Net.TestWinForm/EchantillonsTestsServices.cs @@ -15,8 +15,8 @@ public List GetPointsTestsByBBox(string p_bbox, DEMDataSet d List v_pointsToTest = new List(); try { - IRasterService v_rasterService = new RasterService(); - IElevationService v_elevationService = new ElevationService(v_rasterService); + IRasterService v_rasterService = new RasterService(null); + IElevationService v_elevationService = new ElevationService(v_rasterService, null); BoundingBox v_bbox = GeometryService.GetBoundingBox(p_bbox); v_elevationService.DownloadMissingFiles(dataset, v_bbox); // diff --git a/DEM.Net.glTF/DEM.Net.glTF.csproj b/DEM.Net.glTF/DEM.Net.glTF.csproj index 16e2494e..f79df696 100644 --- a/DEM.Net.glTF/DEM.Net.glTF.csproj +++ b/DEM.Net.glTF/DEM.Net.glTF.csproj @@ -3,7 +3,7 @@ netstandard2.0;net461 DEM.Net.glTF - 0.1.0-beta0006 + 0.1.0-beta0007 Xavier Fischer Xavier Fischer Xavier Fischer diff --git a/DEM.Net.glTF/DependencyInjection/IServiceCollectionExtensions.cs b/DEM.Net.glTF/DependencyInjection/IServiceCollectionExtensions.cs index e54c1cd0..56fd0a2c 100644 --- a/DEM.Net.glTF/DependencyInjection/IServiceCollectionExtensions.cs +++ b/DEM.Net.glTF/DependencyInjection/IServiceCollectionExtensions.cs @@ -1,5 +1,5 @@ -using DEM.Net.Core.Imagery; -using DEM.Net.Core.Services.Mesh; +using DEM.Net.Core; +using DEM.Net.Core.Imagery; using DEM.Net.glTF.Export; using Microsoft.Extensions.DependencyInjection; using System; diff --git a/DEM.Net.glTF/Export/STLExport.cs b/DEM.Net.glTF/Export/STLExport.cs index 108adcd9..663a97f7 100644 --- a/DEM.Net.glTF/Export/STLExport.cs +++ b/DEM.Net.glTF/Export/STLExport.cs @@ -42,7 +42,7 @@ public class STLExportService : ISTLExportService { private readonly ILogger _logger; - public STLExportService(ILogger logger) + public STLExportService(ILogger logger = null) { _logger = logger; } diff --git a/DEM.Net.glTF/IglTFService.cs b/DEM.Net.glTF/IglTFService.cs index a7f42b3e..12031d83 100644 --- a/DEM.Net.glTF/IglTFService.cs +++ b/DEM.Net.glTF/IglTFService.cs @@ -28,7 +28,6 @@ using AssetGenerator.Runtime; using DEM.Net.Core; using DEM.Net.Core.Imagery; -using DEM.Net.Core.Services.Mesh; using System; using System.Collections.Generic; using System.Linq; diff --git a/DEM.Net.glTF/glTFService.cs b/DEM.Net.glTF/glTFService.cs index 48b2e8f3..d7aad866 100644 --- a/DEM.Net.glTF/glTFService.cs +++ b/DEM.Net.glTF/glTFService.cs @@ -28,7 +28,6 @@ using AssetGenerator.Runtime; using DEM.Net.Core; using DEM.Net.Core.Imagery; -using DEM.Net.Core.Services.Mesh; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -44,7 +43,7 @@ public class glTFService : IglTFService private readonly ILogger _logger; private IMeshService _meshService; - public glTFService(ILogger logger, IMeshService meshService) + public glTFService(IMeshService meshService, ILogger logger = null) { _logger = logger; _meshService = meshService;