From 31e9605848e4b38a0b142cf5c1e26b98dd299423 Mon Sep 17 00:00:00 2001 From: xfischer Date: Mon, 1 Jul 2019 11:56:25 +0200 Subject: [PATCH 1/2] tokens check --- .../Services/Imagery/IImageryService.cs | 2 ++ .../Services/Imagery/ImageryService.cs | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/DEM.Net.Core/Services/Imagery/IImageryService.cs b/DEM.Net.Core/Services/Imagery/IImageryService.cs index 37379736..6408fe32 100644 --- a/DEM.Net.Core/Services/Imagery/IImageryService.cs +++ b/DEM.Net.Core/Services/Imagery/IImageryService.cs @@ -15,5 +15,7 @@ public interface IImageryService TileRange DownloadTiles(BoundingBox bbox, ImageryProvider provider, int minTilesPerImage = 4); TextureInfo GenerateNormalMap(HeightMap heightMap, string outputDirectory); + Dictionary GetConfiguredTokens(); + } } \ No newline at end of file diff --git a/DEM.Net.Core/Services/Imagery/ImageryService.cs b/DEM.Net.Core/Services/Imagery/ImageryService.cs index e95b5f1d..bca835d4 100644 --- a/DEM.Net.Core/Services/Imagery/ImageryService.cs +++ b/DEM.Net.Core/Services/Imagery/ImageryService.cs @@ -349,7 +349,18 @@ public Uri BuildUri(ImageryProvider provider, int x, int y, int zoom) return new Uri(url, UriKind.Absolute); } - #endregion + + public Dictionary GetConfiguredTokens() + { +#if NETFULL + throw new NotImplementedException("GetConfiguredTokens for .Net full"); +#else + + return _config.GetSection("Tokens").GetChildren().ToDictionary(c => c.Key, c => c.Value); +#endif + } + +#endregion #region Normal map generation @@ -430,9 +441,9 @@ private Color FromVec3NormalToColor(Vector3 normal) } #endif - #endregion +#endregion - #region UV mapping +#region UV mapping public List ComputeUVMap(HeightMap heightMap, TextureInfo textureInfo) { @@ -463,7 +474,7 @@ public List ComputeUVMap(HeightMap heightMap, TextureInfo textureInfo) return uvs; } - #endregion +#endregion } From 373c2a5b68245c24c121c2e89c3d49835a707672 Mon Sep 17 00:00:00 2001 From: Xavier Fischer Date: Mon, 1 Jul 2019 12:07:56 +0200 Subject: [PATCH 2/2] 0.1.4 token check for samples --- DEM.Net.Core/DEM.Net.Core.csproj | 8 ++++---- DEM.Net.Core/Services/Imagery/ImageryService.cs | 13 ++++++++----- DEM.Net.glTF/DEM.Net.glTF.csproj | 6 +++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/DEM.Net.Core/DEM.Net.Core.csproj b/DEM.Net.Core/DEM.Net.Core.csproj index 8a7779b2..887c8dea 100644 --- a/DEM.Net.Core/DEM.Net.Core.csproj +++ b/DEM.Net.Core/DEM.Net.Core.csproj @@ -3,12 +3,12 @@ netstandard2.0;net461 DEM.Net.Core - 0.1.2 + 0.1.4 Xavier Fischer, Frédéric Aubin Xavier Fischer, Frédéric Aubin Xavier Fischer https://github.com/dem-net/DEM.Net - DouglasPeucker is now public + Get config Tokens DEM, Terrain, Elevation DEM.Net DEM.Net @@ -18,8 +18,8 @@ GitHub MIT https://raw.githubusercontent.com/dem-net/Resources/master/images/DEMnet_512.png - 0.1.2.0 - 0.1.2.0 + 0.1.4.0 + 0.1.4.0 diff --git a/DEM.Net.Core/Services/Imagery/ImageryService.cs b/DEM.Net.Core/Services/Imagery/ImageryService.cs index bca835d4..4596d7a0 100644 --- a/DEM.Net.Core/Services/Imagery/ImageryService.cs +++ b/DEM.Net.Core/Services/Imagery/ImageryService.cs @@ -353,14 +353,19 @@ public Uri BuildUri(ImageryProvider provider, int x, int y, int zoom) public Dictionary GetConfiguredTokens() { #if NETFULL - throw new NotImplementedException("GetConfiguredTokens for .Net full"); + Dictionary tokens = new Dictionary(); + foreach (var key in ConfigurationManager.AppSettings.AllKeys) + { + tokens[key] = ConfigurationManager.AppSettings[key]; + } + return tokens; #else return _config.GetSection("Tokens").GetChildren().ToDictionary(c => c.Key, c => c.Value); #endif } -#endregion + #endregion #region Normal map generation @@ -441,9 +446,8 @@ private Color FromVec3NormalToColor(Vector3 normal) } #endif -#endregion + #endregion -#region UV mapping public List ComputeUVMap(HeightMap heightMap, TextureInfo textureInfo) { @@ -474,7 +478,6 @@ public List ComputeUVMap(HeightMap heightMap, TextureInfo textureInfo) return uvs; } -#endregion } diff --git a/DEM.Net.glTF/DEM.Net.glTF.csproj b/DEM.Net.glTF/DEM.Net.glTF.csproj index f495369d..19530b50 100644 --- a/DEM.Net.glTF/DEM.Net.glTF.csproj +++ b/DEM.Net.glTF/DEM.Net.glTF.csproj @@ -3,12 +3,12 @@ netstandard2.0;net461 DEM.Net.glTF - 0.1.2 + 0.1.4 Xavier Fischer Xavier Fischer Xavier Fischer https://github.com/dem-net/DEM.Net.glTF - DouglasPeucker is now public + Get config tokens DEM, Terrain, Elevation, Mesh, 3D, glTF, Map, STL DEM.Net DEM.Net @@ -18,7 +18,7 @@ GitHub MIT https://raw.githubusercontent.com/dem-net/Resources/master/images/DEMnet_512.png - 0.1.2.0 + 0.1.4.0