Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationsReader.cs
===================================================================
diff -u -r0f6942caadb447b170627a385ebd13cc1b6aac20 -r9717724b58f9be090380d74ba4d30c74ba81eb0c
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationsReader.cs (.../DuneLocationsReader.cs) (revision 0f6942caadb447b170627a385ebd13cc1b6aac20)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationsReader.cs (.../DuneLocationsReader.cs) (revision 9717724b58f9be090380d74ba4d30c74ba81eb0c)
@@ -27,12 +27,11 @@
using Core.Common.Utils.IO;
using Core.Components.Gis.Data;
using Core.Components.Gis.IO.Readers;
-using Ringtoets.DuneErosion.Data;
namespace Ringtoets.DuneErosion.IO
{
///
- /// Shapefile reader that reads a based on the line feature in the file.
+ /// Shapefile reader that reads a based on the line feature in the file.
///
public class DuneLocationsReader
{
@@ -43,10 +42,10 @@
private const string d50Key = "Dreken";
///
- /// Reads an of from an embedded shape file containing points.
+ /// Reads an of from an embedded shape file containing points.
///
- /// An of .
- public IEnumerable ReadDuneLocations()
+ /// An of .
+ public IEnumerable ReadDuneLocations()
{
using (var embeddedResourceFileWriter = new EmbeddedResourceFileWriter(typeof(DuneLocationsReader).Assembly,
true,
@@ -67,7 +66,7 @@
}
}
- private IEnumerable CreateDuneLocations(FeatureBasedMapData locationsData)
+ private IEnumerable CreateDuneLocations(FeatureBasedMapData locationsData)
{
foreach (var locationData in locationsData.Features)
{
@@ -82,7 +81,7 @@
double orientation = Convert.ToDouble(locationData.MetaData[orientationKey]);
double d50 = Convert.ToDouble(locationData.MetaData[d50Key]);
- yield return new DuneLocation(name, xCoordinate, yCoordinate, coastalAreaId, offset, orientation, d50);
+ yield return new ReadDuneLocation(name, xCoordinate, yCoordinate, coastalAreaId, offset, orientation, d50);
}
}
}
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/ReadDuneLocation.cs
===================================================================
diff -u
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/ReadDuneLocation.cs (revision 0)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/ReadDuneLocation.cs (revision 9717724b58f9be090380d74ba4d30c74ba81eb0c)
@@ -0,0 +1,89 @@
+// Copyright (C) Stichting Deltares 2016. 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.Data;
+using Core.Common.Base.Geometry;
+
+namespace Ringtoets.DuneErosion.IO
+{
+ ///
+ /// Location of a dune that is read from the shape file.
+ ///
+ public class ReadDuneLocation
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// Name of the .
+ /// X-coordinate of the .
+ /// Y-coordinate of the .
+ /// Coastal area id of the .
+ /// Offset of the .
+ /// Orientation of the .
+ /// D50 of the .
+ /// Thrown when is null.
+ public ReadDuneLocation(string name, double coordinateX, double coordinateY, int coastalAreaId, double offset, double orientation, double d50)
+ {
+ if (name == null)
+ {
+ throw new ArgumentNullException("name");
+ }
+
+ Name = name;
+ Location = new Point2D(coordinateX, coordinateY);
+ CoastalAreaId = coastalAreaId;
+ Offset = new RoundedDouble(2, offset);
+ Orientation = new RoundedDouble(1, orientation);
+ D50 = new RoundedDouble(6, d50);
+ }
+
+ ///
+ /// Gets the name of the dune location.
+ ///
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the location of the dune location.
+ ///
+ public Point2D Location { get; private set; }
+
+ ///
+ /// Gets the coastal area id of the dune location.
+ ///
+ public int CoastalAreaId { get; private set; }
+
+ ///
+ /// Gets the offset of the dune location.
+ ///
+ public RoundedDouble Offset { get; private set; }
+
+ ///
+ /// Gets the orientation of the dune location.
+ ///
+ public RoundedDouble Orientation { get; private set; }
+
+ ///
+ /// Gets the D50 of the dune location.
+ ///
+ public RoundedDouble D50 { get; private set; }
+ }
+}
\ No newline at end of file
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/Ringtoets.DuneErosion.IO.csproj
===================================================================
diff -u -r0f6942caadb447b170627a385ebd13cc1b6aac20 -r9717724b58f9be090380d74ba4d30c74ba81eb0c
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/Ringtoets.DuneErosion.IO.csproj (.../Ringtoets.DuneErosion.IO.csproj) (revision 0f6942caadb447b170627a385ebd13cc1b6aac20)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/Ringtoets.DuneErosion.IO.csproj (.../Ringtoets.DuneErosion.IO.csproj) (revision 9717724b58f9be090380d74ba4d30c74ba81eb0c)
@@ -39,6 +39,7 @@
Properties\GlobalAssembly.cs
+
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionDataSynchronizationService.cs
===================================================================
diff -u -r1842c5be2441b5fe3b19867ff69a30194d9534d0 -r9717724b58f9be090380d74ba4d30c74ba81eb0c
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionDataSynchronizationService.cs (.../DuneErosionDataSynchronizationService.cs) (revision 1842c5be2441b5fe3b19867ff69a30194d9534d0)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionDataSynchronizationService.cs (.../DuneErosionDataSynchronizationService.cs) (revision 9717724b58f9be090380d74ba4d30c74ba81eb0c)
@@ -25,6 +25,7 @@
using Core.Common.Base.Geometry;
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.DuneErosion.Data;
+using Ringtoets.DuneErosion.IO;
namespace Ringtoets.DuneErosion.Service
{
@@ -43,7 +44,7 @@
/// Thrown when is null.
public static void SetDuneLocations(DuneErosionFailureMechanism failureMechanism,
HydraulicBoundaryDatabase hydraulicBoundaryDatabase,
- IEnumerable duneLocations)
+ IEnumerable duneLocations)
{
if (failureMechanism == null)
{
@@ -56,12 +57,18 @@
return;
}
- foreach (DuneLocation duneLocation in duneLocations)
+ foreach (ReadDuneLocation duneLocation in duneLocations)
{
if (hydraulicBoundaryDatabase.Locations.Any(hydraulicBoundaryLocation =>
Math2D.AreEqualPoints(hydraulicBoundaryLocation.Location, duneLocation.Location)))
{
- failureMechanism.DuneLocations.Add(duneLocation);
+ failureMechanism.DuneLocations.Add(new DuneLocation(duneLocation.Name,
+ duneLocation.Location.X,
+ duneLocation.Location.Y,
+ duneLocation.CoastalAreaId,
+ duneLocation.Offset,
+ duneLocation.Orientation,
+ duneLocation.D50));
}
}
}
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Ringtoets.DuneErosion.Service.csproj
===================================================================
diff -u -r1842c5be2441b5fe3b19867ff69a30194d9534d0 -r9717724b58f9be090380d74ba4d30c74ba81eb0c
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Ringtoets.DuneErosion.Service.csproj (.../Ringtoets.DuneErosion.Service.csproj) (revision 1842c5be2441b5fe3b19867ff69a30194d9534d0)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Ringtoets.DuneErosion.Service.csproj (.../Ringtoets.DuneErosion.Service.csproj) (revision 9717724b58f9be090380d74ba4d30c74ba81eb0c)
@@ -63,6 +63,11 @@
Ringtoets.DuneErosion.DataFalse
+
+ {EDDC30E9-D793-478A-AD37-9F257CE23A22}
+ Ringtoets.DuneErosion.IO
+ False
+