diff --git a/.vs/opdracht2/DesignTimeBuild/.dtbcache.v2 b/.vs/opdracht2/DesignTimeBuild/.dtbcache.v2 index d9bb835..a7b6fb3 100644 Binary files a/.vs/opdracht2/DesignTimeBuild/.dtbcache.v2 and b/.vs/opdracht2/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/opdracht2/v16/.suo b/.vs/opdracht2/v16/.suo index 7207dd9..77d43ad 100644 Binary files a/.vs/opdracht2/v16/.suo and b/.vs/opdracht2/v16/.suo differ diff --git a/Datalaag/JsonReader.cs b/Datalaag/JsonReader.cs index 1cecf6b..b5a2e95 100644 --- a/Datalaag/JsonReader.cs +++ b/Datalaag/JsonReader.cs @@ -21,11 +21,11 @@ namespace Datalaag { switch (feature["geometry"]["type"].ToString()) { - case "MultiPolygon": + case "Polygon": _polygons.Add(new PolygonPunten(JsonConvert.DeserializeObject(feature["geometry"] .ToString()), feature["properties"]["name"].ToString())); break; - case "Polygon": + case "MultiPolygon": _multiPolygons.Add(new MultiPolygonPunten(JsonConvert.DeserializeObject (feature["geometry"].ToString()), feature["properties"]["name"].ToString())); break; diff --git a/Datalaag/bin/Debug/Datalaag.dll b/Datalaag/bin/Debug/Datalaag.dll index 114da74..661c35b 100644 Binary files a/Datalaag/bin/Debug/Datalaag.dll and b/Datalaag/bin/Debug/Datalaag.dll differ diff --git a/Datalaag/bin/Debug/Datalaag.pdb b/Datalaag/bin/Debug/Datalaag.pdb index 12df5e6..ff3e469 100644 Binary files a/Datalaag/bin/Debug/Datalaag.pdb and b/Datalaag/bin/Debug/Datalaag.pdb differ diff --git a/Datalaag/bin/Debug/Globals.dll b/Datalaag/bin/Debug/Globals.dll index f23089b..5fe1b25 100644 Binary files a/Datalaag/bin/Debug/Globals.dll and b/Datalaag/bin/Debug/Globals.dll differ diff --git a/Datalaag/bin/Debug/Globals.pdb b/Datalaag/bin/Debug/Globals.pdb index 2d79c7f..7965f15 100644 Binary files a/Datalaag/bin/Debug/Globals.pdb and b/Datalaag/bin/Debug/Globals.pdb differ diff --git a/Datalaag/obj/Debug/Datalaag.csprojAssemblyReference.cache b/Datalaag/obj/Debug/Datalaag.csprojAssemblyReference.cache index 38e8623..bf892e1 100644 Binary files a/Datalaag/obj/Debug/Datalaag.csprojAssemblyReference.cache and b/Datalaag/obj/Debug/Datalaag.csprojAssemblyReference.cache differ diff --git a/Datalaag/obj/Debug/Datalaag.dll b/Datalaag/obj/Debug/Datalaag.dll index 114da74..661c35b 100644 Binary files a/Datalaag/obj/Debug/Datalaag.dll and b/Datalaag/obj/Debug/Datalaag.dll differ diff --git a/Datalaag/obj/Debug/Datalaag.pdb b/Datalaag/obj/Debug/Datalaag.pdb index 12df5e6..ff3e469 100644 Binary files a/Datalaag/obj/Debug/Datalaag.pdb and b/Datalaag/obj/Debug/Datalaag.pdb differ diff --git a/Globals/MultiPolygonPunten.cs b/Globals/MultiPolygonPunten.cs index 794d178..1981d3b 100644 --- a/Globals/MultiPolygonPunten.cs +++ b/Globals/MultiPolygonPunten.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using GeoJSON.Net.Geometry; @@ -35,5 +36,12 @@ namespace Globals MinimumX = polygonPunten.Max(p => p.MinimumX); MinimumY = polygonPunten.Max(p => p.MinimumY); } + + + public override string ToString() + { + if (string.Equals(Naam, "", StringComparison.Ordinal)) return "UNKNOWN"; + else return Naam; + } } } \ No newline at end of file diff --git a/Globals/PolygonPunten.cs b/Globals/PolygonPunten.cs index 6e8f95e..20ab643 100644 --- a/Globals/PolygonPunten.cs +++ b/Globals/PolygonPunten.cs @@ -44,6 +44,11 @@ namespace Globals } } + public override string ToString() + { + if (string.Equals(Naam, "", StringComparison.Ordinal)) return "UNKNOWN"; + else return Naam; + } } } diff --git a/Globals/bin/Debug/Globals.dll b/Globals/bin/Debug/Globals.dll index f23089b..5fe1b25 100644 Binary files a/Globals/bin/Debug/Globals.dll and b/Globals/bin/Debug/Globals.dll differ diff --git a/Globals/bin/Debug/Globals.pdb b/Globals/bin/Debug/Globals.pdb index 2d79c7f..7965f15 100644 Binary files a/Globals/bin/Debug/Globals.pdb and b/Globals/bin/Debug/Globals.pdb differ diff --git a/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache index a7bdf91..a8085e8 100644 Binary files a/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Globals/obj/Debug/Globals.csprojAssemblyReference.cache b/Globals/obj/Debug/Globals.csprojAssemblyReference.cache index 10cf3cd..51ce47b 100644 Binary files a/Globals/obj/Debug/Globals.csprojAssemblyReference.cache and b/Globals/obj/Debug/Globals.csprojAssemblyReference.cache differ diff --git a/Globals/obj/Debug/Globals.dll b/Globals/obj/Debug/Globals.dll index f23089b..5fe1b25 100644 Binary files a/Globals/obj/Debug/Globals.dll and b/Globals/obj/Debug/Globals.dll differ diff --git a/Globals/obj/Debug/Globals.pdb b/Globals/obj/Debug/Globals.pdb index 2d79c7f..7965f15 100644 Binary files a/Globals/obj/Debug/Globals.pdb and b/Globals/obj/Debug/Globals.pdb differ diff --git a/Logica/Logica.csproj b/Logica/Logica.csproj index 47d5b4a..cbe8e70 100644 --- a/Logica/Logica.csproj +++ b/Logica/Logica.csproj @@ -31,6 +31,9 @@ 4 + + ..\packages\GeoJSON.Net.1.2.20-rc\lib\net45\GeoJSON.Net.dll + diff --git a/Logica/PolygonManipulatie.cs b/Logica/PolygonManipulatie.cs index 5b29148..7f70a98 100644 --- a/Logica/PolygonManipulatie.cs +++ b/Logica/PolygonManipulatie.cs @@ -42,7 +42,7 @@ namespace Logica return TriangulatePolygon(polygon); } - private PolygonPunten ScalePolygon(PolygonPunten polygon, double scaleX, double scaleY) + public PolygonPunten ScalePolygon(PolygonPunten polygon, double scaleX, double scaleY) { double maxX = polygon.MaximumX; double maxY = polygon.MaximumY; @@ -65,6 +65,35 @@ namespace Logica return new PolygonPunten(returnWaarde, polygon.Naam); } + public MultiPolygonPunten ScaleMultiPolygon(MultiPolygonPunten multiPolygon, double scaleX, double scaleY) + { + double maxX = multiPolygon.MaximumX; + double maxY = multiPolygon.MaximumY; + double minX = multiPolygon.MinimumX; + double minY = multiPolygon.MinimumY; + maxX -= minX; + maxY -= minY; + List pp = new List(); + foreach (PolygonPunten polygon in multiPolygon.PolygonPunten) + { + List returnWaarde = new List(); + foreach (Punt punt in polygon.Punten) + { + double x = punt.X - minX; + x /= maxX; + x *= scaleX; + double y = punt.Y - minY; + y /= maxY; + y *= scaleY; + returnWaarde.Add(new Punt(x, y, punt.Naam)); + + } + pp.Add(new PolygonPunten(returnWaarde, polygon.Naam)); + } + + return new MultiPolygonPunten(pp, multiPolygon.Naam); + } + public List GetAllPolygons() { List lijst = new List(); diff --git a/Logica/bin/Debug/Datalaag.dll b/Logica/bin/Debug/Datalaag.dll index 114da74..661c35b 100644 Binary files a/Logica/bin/Debug/Datalaag.dll and b/Logica/bin/Debug/Datalaag.dll differ diff --git a/Logica/bin/Debug/Datalaag.pdb b/Logica/bin/Debug/Datalaag.pdb index 12df5e6..ff3e469 100644 Binary files a/Logica/bin/Debug/Datalaag.pdb and b/Logica/bin/Debug/Datalaag.pdb differ diff --git a/Logica/bin/Debug/Globals.dll b/Logica/bin/Debug/Globals.dll index f23089b..5fe1b25 100644 Binary files a/Logica/bin/Debug/Globals.dll and b/Logica/bin/Debug/Globals.dll differ diff --git a/Logica/bin/Debug/Globals.pdb b/Logica/bin/Debug/Globals.pdb index 2d79c7f..7965f15 100644 Binary files a/Logica/bin/Debug/Globals.pdb and b/Logica/bin/Debug/Globals.pdb differ diff --git a/Logica/bin/Debug/Logica.dll b/Logica/bin/Debug/Logica.dll index 5cfd484..904f54f 100644 Binary files a/Logica/bin/Debug/Logica.dll and b/Logica/bin/Debug/Logica.dll differ diff --git a/Logica/bin/Debug/Logica.pdb b/Logica/bin/Debug/Logica.pdb index 9379db0..1a8c06d 100644 Binary files a/Logica/bin/Debug/Logica.pdb and b/Logica/bin/Debug/Logica.pdb differ diff --git a/Logica/obj/Debug/Logica.csproj.CoreCompileInputs.cache b/Logica/obj/Debug/Logica.csproj.CoreCompileInputs.cache index 6c1b9ce..ec4191e 100644 --- a/Logica/obj/Debug/Logica.csproj.CoreCompileInputs.cache +++ b/Logica/obj/Debug/Logica.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -cccc5c33f424954ac02c95e1ddf7440a0c61da70 +19911095ba0015434cd13d58c152e22fd47e8005 diff --git a/Logica/obj/Debug/Logica.csproj.FileListAbsolute.txt b/Logica/obj/Debug/Logica.csproj.FileListAbsolute.txt index 1ae692c..01e0492 100644 --- a/Logica/obj/Debug/Logica.csproj.FileListAbsolute.txt +++ b/Logica/obj/Debug/Logica.csproj.FileListAbsolute.txt @@ -1,2 +1,14 @@ C:\Users\Beppe\source\repos\opdracht2\Logica\obj\Debug\Logica.csprojAssemblyReference.cache C:\Users\Beppe\source\repos\opdracht2\Logica\obj\Debug\Logica.csproj.CoreCompileInputs.cache +C:\Users\Beppe\source\repos\opdracht2\Logica\bin\Debug\Logica.dll +C:\Users\Beppe\source\repos\opdracht2\Logica\bin\Debug\Logica.pdb +C:\Users\Beppe\source\repos\opdracht2\Logica\bin\Debug\Datalaag.dll +C:\Users\Beppe\source\repos\opdracht2\Logica\bin\Debug\GeoJSON.Net.dll +C:\Users\Beppe\source\repos\opdracht2\Logica\bin\Debug\Globals.dll +C:\Users\Beppe\source\repos\opdracht2\Logica\bin\Debug\Newtonsoft.Json.dll +C:\Users\Beppe\source\repos\opdracht2\Logica\bin\Debug\Datalaag.pdb +C:\Users\Beppe\source\repos\opdracht2\Logica\bin\Debug\Globals.pdb +C:\Users\Beppe\source\repos\opdracht2\Logica\bin\Debug\Newtonsoft.Json.xml +C:\Users\Beppe\source\repos\opdracht2\Logica\obj\Debug\Logica.csproj.CopyComplete +C:\Users\Beppe\source\repos\opdracht2\Logica\obj\Debug\Logica.dll +C:\Users\Beppe\source\repos\opdracht2\Logica\obj\Debug\Logica.pdb diff --git a/Logica/obj/Debug/Logica.csprojAssemblyReference.cache b/Logica/obj/Debug/Logica.csprojAssemblyReference.cache index 8b2ee19..cea5f66 100644 Binary files a/Logica/obj/Debug/Logica.csprojAssemblyReference.cache and b/Logica/obj/Debug/Logica.csprojAssemblyReference.cache differ diff --git a/Logica/obj/Debug/Logica.dll b/Logica/obj/Debug/Logica.dll index 5cfd484..904f54f 100644 Binary files a/Logica/obj/Debug/Logica.dll and b/Logica/obj/Debug/Logica.dll differ diff --git a/Logica/obj/Debug/Logica.pdb b/Logica/obj/Debug/Logica.pdb index 9379db0..1a8c06d 100644 Binary files a/Logica/obj/Debug/Logica.pdb and b/Logica/obj/Debug/Logica.pdb differ diff --git a/opdracht2/MainWindow.xaml b/opdracht2/MainWindow.xaml index e238ee0..56ce69b 100644 --- a/opdracht2/MainWindow.xaml +++ b/opdracht2/MainWindow.xaml @@ -10,15 +10,15 @@ - + - -