Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFeaturesFactory.cs
===================================================================
diff -u -r5ad8e6d01f15a280162b76b688ab30487e78e206 -r36828a0ba71303efd79ccb1123c8c427b8028b24
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision 5ad8e6d01f15a280162b76b688ab30487e78e206)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -32,7 +32,6 @@
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.Data.FailureMechanism;
-using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Common.Data.Structures;
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Common.Forms.Properties;
@@ -235,7 +234,7 @@
var i = 0;
foreach (StructureBase structure in structures)
{
- MapFeature feature = CreateSinglePointMapFeature(structure.Location);
+ MapFeature feature = RingtoetsMapDataFeaturesFactoryHelper.CreateSinglePointMapFeature(structure.Location);
feature.MetaData[Resources.MetaData_Name] = structure.Name;
mapFeatures[i] = feature;
@@ -309,34 +308,9 @@
return new MapFeature[0];
}
- ///
- /// Creates a map feature with one single point.
- ///
- /// The point of the map feature.
- /// The map feature with the as geometry.
- /// Thrown when is null.
- public static MapFeature CreateSinglePointMapFeature(Point2D point)
- {
- if (point == null)
- {
- throw new ArgumentNullException(nameof(point));
- }
-
- return new MapFeature(new[]
- {
- new MapGeometry(new[]
- {
- new[]
- {
- point
- }
- })
- });
- }
-
private static MapFeature CreateHydraulicBoundaryLocationFeature(AggregatedHydraulicBoundaryLocation location)
{
- MapFeature feature = CreateSinglePointMapFeature(location.Location);
+ MapFeature feature = RingtoetsMapDataFeaturesFactoryHelper.CreateSinglePointMapFeature(location.Location);
feature.MetaData[Resources.MetaData_ID] = location.Id;
feature.MetaData[Resources.MetaData_Name] = location.Name;
feature.MetaData[Resources.MetaData_WaterLevelCalculationForFactorizedSignalingNorm] = location.WaterLevelCalculationForFactorizedSignalingNorm;
Index: Ringtoets/Common/src/Ringtoets.Common.Util/Ringtoets.Common.Util.csproj
===================================================================
diff -u -r5ddc9c8c424e9a85e22bde50f7133111cbf16348 -r36828a0ba71303efd79ccb1123c8c427b8028b24
--- Ringtoets/Common/src/Ringtoets.Common.Util/Ringtoets.Common.Util.csproj (.../Ringtoets.Common.Util.csproj) (revision 5ddc9c8c424e9a85e22bde50f7133111cbf16348)
+++ Ringtoets/Common/src/Ringtoets.Common.Util/Ringtoets.Common.Util.csproj (.../Ringtoets.Common.Util.csproj) (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -20,6 +20,7 @@
True
Resources.resx
+
Index: Ringtoets/Common/src/Ringtoets.Common.Util/RingtoetsMapDataFeaturesFactoryHelper.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.Util/RingtoetsMapDataFeaturesFactoryHelper.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.Util/RingtoetsMapDataFeaturesFactoryHelper.cs (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -0,0 +1,59 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Core.Common.Base.Geometry;
+using Core.Components.Gis.Features;
+using Core.Components.Gis.Geometries;
+
+namespace Ringtoets.Common.Util
+{
+ ///
+ /// Helper class for map data features factory.
+ ///
+ public static class RingtoetsMapDataFeaturesFactoryHelper
+ {
+ ///
+ /// Creates a map feature with one single point.
+ ///
+ /// The point of the map feature.
+ /// The map feature with the as geometry.
+ /// Thrown when is null.
+ public static MapFeature CreateSinglePointMapFeature(Point2D point)
+ {
+ if (point == null)
+ {
+ throw new ArgumentNullException(nameof(point));
+ }
+
+ return new MapFeature(new[]
+ {
+ new MapGeometry(new[]
+ {
+ new[]
+ {
+ point
+ }
+ })
+ });
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Factories/RingtoetsMapDataFeaturesFactoryTest.cs
===================================================================
diff -u -r5ad8e6d01f15a280162b76b688ab30487e78e206 -r36828a0ba71303efd79ccb1123c8c427b8028b24
--- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Factories/RingtoetsMapDataFeaturesFactoryTest.cs (.../RingtoetsMapDataFeaturesFactoryTest.cs) (revision 5ad8e6d01f15a280162b76b688ab30487e78e206)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Factories/RingtoetsMapDataFeaturesFactoryTest.cs (.../RingtoetsMapDataFeaturesFactoryTest.cs) (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -706,35 +706,6 @@
Assert.AreEqual(foreshoreProfiles[2].Name, features.ElementAt(1).MetaData["Naam"]);
}
- [Test]
- public void CreateSinglePointMapFeature_PointNull_ThrowArgumentNullException()
- {
- // Call
- TestDelegate test = () => RingtoetsMapDataFeaturesFactory.CreateSinglePointMapFeature(null);
-
- // Assert
- var exception = Assert.Throws(test);
- Assert.AreEqual("point", exception.ParamName);
- }
-
- [Test]
- public void CreateSinglePointMapFeature_WithPoint_CreatesASinglePointMapFeature()
- {
- // Setup
- var point = new Point2D(0, 0);
-
- // Call
- MapFeature pointMapFeature = RingtoetsMapDataFeaturesFactory.CreateSinglePointMapFeature(point);
-
- // Assert
- MapGeometry[] mapGeometries = pointMapFeature.MapGeometries.ToArray();
- Assert.AreEqual(1, mapGeometries.Length);
- MapGeometry mapGeometry = mapGeometries.First();
- IEnumerable[] geometryPointCollections = mapGeometry.PointCollections.ToArray();
- Assert.AreEqual(1, geometryPointCollections.Length);
- Assert.AreSame(point, geometryPointCollections.First().First());
- }
-
private static void AssertEqualFeatureCollections(Point2D[] points, IEnumerable features)
{
Assert.AreEqual(points.Length, features.Count());
Index: Ringtoets/Common/test/Ringtoets.Common.Util.Test/Ringtoets.Common.Util.Test.csproj
===================================================================
diff -u -r5ddc9c8c424e9a85e22bde50f7133111cbf16348 -r36828a0ba71303efd79ccb1123c8c427b8028b24
--- Ringtoets/Common/test/Ringtoets.Common.Util.Test/Ringtoets.Common.Util.Test.csproj (.../Ringtoets.Common.Util.Test.csproj) (revision 5ddc9c8c424e9a85e22bde50f7133111cbf16348)
+++ Ringtoets/Common/test/Ringtoets.Common.Util.Test/Ringtoets.Common.Util.Test.csproj (.../Ringtoets.Common.Util.Test.csproj) (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -23,6 +23,7 @@
+
Index: Ringtoets/Common/test/Ringtoets.Common.Util.Test/RingtoetsMapDataFeaturesFactoryHelperTest.cs
===================================================================
diff -u
--- Ringtoets/Common/test/Ringtoets.Common.Util.Test/RingtoetsMapDataFeaturesFactoryHelperTest.cs (revision 0)
+++ Ringtoets/Common/test/Ringtoets.Common.Util.Test/RingtoetsMapDataFeaturesFactoryHelperTest.cs (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -0,0 +1,64 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Core.Common.Base.Geometry;
+using Core.Components.Gis.Features;
+using Core.Components.Gis.Geometries;
+using NUnit.Framework;
+
+namespace Ringtoets.Common.Util.Test
+{
+ [TestFixture]
+ public class RingtoetsMapDataFeaturesFactoryHelperTest
+ {
+ [Test]
+ public void CreateSinglePointMapFeature_PointNull_ThrowArgumentNullException()
+ {
+ // Call
+ TestDelegate test = () => RingtoetsMapDataFeaturesFactoryHelper.CreateSinglePointMapFeature(null);
+
+ // Assert
+ var exception = Assert.Throws(test);
+ Assert.AreEqual("point", exception.ParamName);
+ }
+
+ [Test]
+ public void CreateSinglePointMapFeature_WithPoint_CreatesASinglePointMapFeature()
+ {
+ // Setup
+ var point = new Point2D(0, 0);
+
+ // Call
+ MapFeature pointMapFeature = RingtoetsMapDataFeaturesFactoryHelper.CreateSinglePointMapFeature(point);
+
+ // Assert
+ MapGeometry[] mapGeometries = pointMapFeature.MapGeometries.ToArray();
+ Assert.AreEqual(1, mapGeometries.Length);
+ MapGeometry mapGeometry = mapGeometries.First();
+ IEnumerable[] geometryPointCollections = mapGeometry.PointCollections.ToArray();
+ Assert.AreEqual(1, geometryPointCollections.Length);
+ Assert.AreSame(point, geometryPointCollections.First().First());
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Factories/DuneErosionMapDataFeaturesFactory.cs
===================================================================
diff -u -r397eafbec8987f6aa2e31318745c4e07ed575981 -r36828a0ba71303efd79ccb1123c8c427b8028b24
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Factories/DuneErosionMapDataFeaturesFactory.cs (.../DuneErosionMapDataFeaturesFactory.cs) (revision 397eafbec8987f6aa2e31318745c4e07ed575981)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Factories/DuneErosionMapDataFeaturesFactory.cs (.../DuneErosionMapDataFeaturesFactory.cs) (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -24,6 +24,7 @@
using Core.Components.Gis.Data;
using Core.Components.Gis.Features;
using Ringtoets.Common.Forms.Factories;
+using Ringtoets.Common.Util;
using Ringtoets.DuneErosion.Data;
using Ringtoets.DuneErosion.Forms.Properties;
using RingtoetsDuneErosionDataResources = Ringtoets.DuneErosion.Data.Properties.Resources;
@@ -58,7 +59,7 @@
{
DuneLocation location = duneLocations[i];
- MapFeature feature = RingtoetsMapDataFeaturesFactory.CreateSinglePointMapFeature(location.Location);
+ MapFeature feature = RingtoetsMapDataFeaturesFactoryHelper.CreateSinglePointMapFeature(location.Location);
feature.MetaData[RingtoetsCommonFormsResources.MetaData_ID] = location.Id;
feature.MetaData[RingtoetsCommonFormsResources.MetaData_Name] = location.Name;
feature.MetaData[Resources.MetaData_CoastalAreaId] = location.CoastalAreaId;
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Ringtoets.DuneErosion.Forms.csproj
===================================================================
diff -u -r701e2f2f7db6be7e172b2eaeb46f24a964281d9f -r36828a0ba71303efd79ccb1123c8c427b8028b24
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Ringtoets.DuneErosion.Forms.csproj (.../Ringtoets.DuneErosion.Forms.csproj) (revision 701e2f2f7db6be7e172b2eaeb46f24a964281d9f)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Ringtoets.DuneErosion.Forms.csproj (.../Ringtoets.DuneErosion.Forms.csproj) (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -122,6 +122,11 @@
Ringtoets.Common.Primitives
False
+
+ {6A074D65-A81C-4C1C-8E24-F36C916E4ED7}
+ Ringtoets.Common.Util
+ False
+
{888D4097-8BC2-4703-9FB1-8744C94D525E}
Ringtoets.HydraRing.Calculation
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Factories/GrassCoverErosionOutwardsMapDataFeaturesFactory.cs
===================================================================
diff -u -r5ad8e6d01f15a280162b76b688ab30487e78e206 -r36828a0ba71303efd79ccb1123c8c427b8028b24
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Factories/GrassCoverErosionOutwardsMapDataFeaturesFactory.cs (.../GrassCoverErosionOutwardsMapDataFeaturesFactory.cs) (revision 5ad8e6d01f15a280162b76b688ab30487e78e206)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Factories/GrassCoverErosionOutwardsMapDataFeaturesFactory.cs (.../GrassCoverErosionOutwardsMapDataFeaturesFactory.cs) (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -27,6 +27,7 @@
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Forms.Factories;
using Ringtoets.Common.Forms.PresentationObjects;
+using Ringtoets.Common.Util;
using Ringtoets.GrassCoverErosionOutwards.Data;
using Ringtoets.GrassCoverErosionOutwards.Forms.Properties;
using Ringtoets.GrassCoverErosionOutwards.Util;
@@ -96,7 +97,7 @@
private static MapFeature CreateHydraulicBoundaryLocationFeature(GrassCoverErosionOutwardsAggregatedHydraulicBoundaryLocation location)
{
- MapFeature feature = RingtoetsMapDataFeaturesFactory.CreateSinglePointMapFeature(location.Location);
+ MapFeature feature = RingtoetsMapDataFeaturesFactoryHelper.CreateSinglePointMapFeature(location.Location);
feature.MetaData[RingtoetsCommonFormsResources.MetaData_ID] = location.Id;
feature.MetaData[RingtoetsCommonFormsResources.MetaData_Name] = location.Name;
feature.MetaData[Resources.MetaData_WaterLevelCalculationForMechanismSpecificFactorizedSignalingNorm] = location.WaterLevelCalculationForMechanismSpecificFactorizedSignalingNorm;
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj
===================================================================
diff -u -ra960f05a5324192bd268fe1891fdcf8712b2905e -r36828a0ba71303efd79ccb1123c8c427b8028b24
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.csproj) (revision a960f05a5324192bd268fe1891fdcf8712b2905e)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.csproj) (revision 36828a0ba71303efd79ccb1123c8c427b8028b24)
@@ -124,6 +124,11 @@
Ringtoets.Common.Service
False
+
+ {6A074D65-A81C-4C1C-8E24-F36C916E4ED7}
+ Ringtoets.Common.Util
+ False
+
{87c2c553-c0bc-40bf-b1ea-b83bff357f27}
Ringtoets.Revetment.Data