Index: Core/Components/src/Core.Components.DotSpatial/Converter/MapPolygonDataConverter.cs =================================================================== diff -u -r96ead5fb68a31e1491693e187045d11b9569e2e6 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/src/Core.Components.DotSpatial/Converter/MapPolygonDataConverter.cs (.../MapPolygonDataConverter.cs) (revision 96ead5fb68a31e1491693e187045d11b9569e2e6) +++ Core/Components/src/Core.Components.DotSpatial/Converter/MapPolygonDataConverter.cs (.../MapPolygonDataConverter.cs) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -49,6 +49,8 @@ { IEnumerable[] pointCollections = mapGeometry.PointCollections.ToArray(); + CreateClosedRingIfNecessary(pointCollections); + Coordinate[] outerRingCoordinates = ConvertPoint2DElementsToCoordinates(pointCollections[0]).ToArray(); ILinearRing outerRing = new LinearRing(outerRingCoordinates); @@ -66,6 +68,24 @@ yield return new Feature(GetGeometry(geometryList)); } + private static void CreateClosedRingIfNecessary(IEnumerable[] pointCollections) + { + if (!FirstPointEqualsLastPoint(pointCollections[0].ToArray())) + { + pointCollections[0] = pointCollections[0].Concat(new[] + { + pointCollections[0].First() + }).ToArray(); + } + } + + private static bool FirstPointEqualsLastPoint(Point2D[] pointCollection) + { + return pointCollection.First().X.Equals(pointCollection.Last().X) || + pointCollection.First().Y.Equals(pointCollection.Last().Y); + + } + protected override IFeatureSymbolizer CreateSymbolizer(MapPolygonData mapData) { PolygonStyle polygonStyle = mapData.Style; Index: Core/Components/src/Core.Components.DotSpatial/Projections/ReprojectExtensions.cs =================================================================== diff -u -r96ead5fb68a31e1491693e187045d11b9569e2e6 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/src/Core.Components.DotSpatial/Projections/ReprojectExtensions.cs (.../ReprojectExtensions.cs) (revision 96ead5fb68a31e1491693e187045d11b9569e2e6) +++ Core/Components/src/Core.Components.DotSpatial/Projections/ReprojectExtensions.cs (.../ReprojectExtensions.cs) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -68,12 +68,6 @@ throw new ArgumentNullException(nameof(target)); } - if (ring.Coordinates.Length < 3) - { - throw new ArgumentException(@"Ring must contain at least 3 coordinates.", - nameof(ring)); - } - Coordinate[] seq = Reproject(ring.Coordinates.Densify(36).ToArray(), source, target); return ring.Factory.CreateLinearRing(seq); } Index: Core/Components/src/Core.Components.DotSpatial/Projections/WorldFile.cs =================================================================== diff -u -r96ead5fb68a31e1491693e187045d11b9569e2e6 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/src/Core.Components.DotSpatial/Projections/WorldFile.cs (.../WorldFile.cs) (revision 96ead5fb68a31e1491693e187045d11b9569e2e6) +++ Core/Components/src/Core.Components.DotSpatial/Projections/WorldFile.cs (.../WorldFile.cs) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -183,16 +183,15 @@ /// The ground bounding-ordinate. public IPolygon BoundingOrdinatesToWorldCoordinates(int width, int height) { - var ringCoordinates = new Coordinate[5]; Coordinate leftTop = ToWorldCoordinates(0, 0); - ringCoordinates.Concat(new[] + Coordinate[] ringCoordinates = new[] { leftTop, ToWorldCoordinates(0, height), ToWorldCoordinates(width, 0), ToWorldCoordinates(width, height), leftTop - }).ToArray(); + }; ILinearRing ring = GeometryFactory.Default.CreateLinearRing(ringCoordinates); return GeometryFactory.Default.CreatePolygon(ring, null); Index: Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs =================================================================== diff -u -r96ead5fb68a31e1491693e187045d11b9569e2e6 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs (.../MapControlTest.cs) (revision 96ead5fb68a31e1491693e187045d11b9569e2e6) +++ Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs (.../MapControlTest.cs) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -487,14 +487,14 @@ private static void AssertReprojectedTo28992TestExtents(IMapView mapView) { - Assert.AreEqual(523413.98162662971, mapView.ViewExtents.MinX, 1e-6, + Assert.AreEqual(523401.48494492332, mapView.ViewExtents.MinX, 1e-1, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=0.2000000&y=3.2000000)."); - Assert.AreEqual(5313601.4625104629, mapView.ViewExtents.MinY, 1e-6, + Assert.AreEqual(5313546.326155385, mapView.ViewExtents.MinY, 1e-1, "Coordinate does not match. (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=0.2000000&y=3.2000000)."); - Assert.AreEqual(523415.89786963863, mapView.ViewExtents.MaxX, 1e-6, + Assert.AreEqual(523403.40096895653, mapView.ViewExtents.MaxX, 1e-1, "Coordinate does not match. (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=2.2000000&y=5.7000000)."); - Assert.AreEqual(5313604.0206882581, mapView.ViewExtents.MaxY, 1e-6, + Assert.AreEqual(5313548.8840212682, mapView.ViewExtents.MaxY, 1e-1, "Coordinate does not match. (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=2.2000000&y=5.7000000)."); } @@ -513,10 +513,10 @@ private static void AssertOriginalExtents(IMapView mapView) { - Assert.AreEqual(0.2, mapView.ViewExtents.MinX, 1e-3); - Assert.AreEqual(2.2, mapView.ViewExtents.MaxX, 1e-3); - Assert.AreEqual(3.2, mapView.ViewExtents.MinY, 1e-3); - Assert.AreEqual(5.7, mapView.ViewExtents.MaxY, 1e-3); + Assert.AreEqual(14.45, mapView.ViewExtents.MinX, 1e-2); + Assert.AreEqual(16.45, mapView.ViewExtents.MaxX, 1e-2); + Assert.AreEqual(57.96, mapView.ViewExtents.MinY, 1e-2); + Assert.AreEqual(60.46, mapView.ViewExtents.MaxY, 1e-2); } private static MapDataCollection CreateTestMapDataCollection() @@ -1021,7 +1021,10 @@ Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); - AssertOriginalExtents(mapView); + Assert.AreEqual(0.2, mapView.ViewExtents.MinX, 1e-2); + Assert.AreEqual(2.2, mapView.ViewExtents.MaxX, 1e-2); + Assert.AreEqual(3.2, mapView.ViewExtents.MinY, 1e-2); + Assert.AreEqual(5.7, mapView.ViewExtents.MaxY, 1e-2); // When startingBackgroundMapData.Configure(newBackgroundMapData.SourceCapabilitiesUrl, @@ -1035,9 +1038,9 @@ Assert.IsInstanceOf(mapView.Layers[0]); Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(523414.9114786592, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, + Assert.AreEqual(523402.42866793618, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); - Assert.AreEqual(5313600.4932731427, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, + Assert.AreEqual(5313545.4037142638, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, "Coordinate does not match (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); AssertReprojectedTo28992TestExtents(mapView); } @@ -1087,9 +1090,9 @@ var pointFeatureLayer = (FeatureLayer) layersBeforeUpdate[1]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(523414.9114786592, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, + Assert.AreEqual(523402.42866793618, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); - Assert.AreEqual(5313600.4932731427, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, + Assert.AreEqual(5313545.4037142638, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, "Coordinate does not match (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); // When @@ -1101,9 +1104,9 @@ Assert.AreEqual(1, mapView.Layers.Count); CollectionAssert.DoesNotContain(mapView.Layers, layersBeforeUpdate[0]); Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, 1e-6, + Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, 1e-4, "Minimal drift is acceptable (if it becomes a problem, we need to keep original coordinates in the layer)."); - Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, 1e-6, + Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, 1e-4, "Minimal drift is acceptable (if it becomes a problem, we need to keep original coordinates in the layer)."); AssertOriginalExtents(mapView); } @@ -1155,9 +1158,9 @@ Assert.IsInstanceOf(mapView.Layers[0]); pointFeatureLayer = (FeatureLayer) mapView.Layers[1]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(523414.9114786592, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, + Assert.AreEqual(523402.42866793618, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); - Assert.AreEqual(5313600.4932731427, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, + Assert.AreEqual(5313545.4037142638, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, "Coordinate does not match (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); AssertReprojectedTo28992TestExtents(mapView); @@ -1211,7 +1214,11 @@ Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); - AssertOriginalExtents(mapView); + + Assert.AreEqual(0.2, mapView.ViewExtents.MinX, 1e-2); + Assert.AreEqual(2.2, mapView.ViewExtents.MaxX, 1e-2); + Assert.AreEqual(3.2, mapView.ViewExtents.MinY, 1e-2); + Assert.AreEqual(5.7, mapView.ViewExtents.MaxY, 1e-2); } } @@ -1253,8 +1260,8 @@ Assert.IsInstanceOf(mapView.Layers[0]); var pointFeatureLayer = (FeatureLayer) mapView.Layers[1]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); - Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); + Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, 1e-1); + Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, 1e-1); // When WmtsMapData differentBackgroundMapData = WmtsMapDataTestHelper.CreateAlternativePdokMapData(); @@ -1267,9 +1274,9 @@ Assert.IsInstanceOf(mapView.Layers[0]); pointFeatureLayer = (FeatureLayer) mapView.Layers[1]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(523414.9114786592, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, + Assert.AreEqual(523402.42866793618, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); - Assert.AreEqual(5313600.4932731427, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, + Assert.AreEqual(5313545.4037142638, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, "Coordinate does not match (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); AssertReprojectedTo28992TestExtents(mapView); @@ -1315,9 +1322,9 @@ Assert.IsInstanceOf(mapView.Layers[0]); var pointFeatureLayer = (FeatureLayer) mapView.Layers[1]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(523414.9114786592, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, + Assert.AreEqual(523402.42866793618, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); - Assert.AreEqual(5313600.4932731427, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, + Assert.AreEqual(5313545.4037142638, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, "Coordinate does not match (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); // When @@ -1364,9 +1371,9 @@ List featureLayers = mapView.Layers.Skip(1).Cast().ToList(); Assert.AreEqual("Points", featureLayers[0].Name); Assert.IsTrue(mapView.Projection.Equals(featureLayers[0].Projection)); - Assert.AreEqual(523414.9114786592, featureLayers[0].FeatureSet.Features[0].Geometry.Coordinates[0].X, + Assert.AreEqual(523402.42866793618, featureLayers[0].FeatureSet.Features[0].Geometry.Coordinates[0].X, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); - Assert.AreEqual(5313600.4932731427, featureLayers[0].FeatureSet.Features[0].Geometry.Coordinates[0].Y, + Assert.AreEqual(5313545.4037142638, featureLayers[0].FeatureSet.Features[0].Geometry.Coordinates[0].Y, "Coordinate does not match (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); Assert.AreEqual("Lines", featureLayers[1].Name); Assert.IsTrue(mapView.Projection.Equals(featureLayers[1].Projection)); @@ -1532,9 +1539,9 @@ IMapLayer[] layersBeforeUpdate = mapView.Layers.ToArray(); var pointFeatureLayer = (FeatureLayer) layersBeforeUpdate[1]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(523414.9114786592, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, + Assert.AreEqual(523402.42866793618, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); - Assert.AreEqual(5313600.4932731427, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, + Assert.AreEqual(5313545.4037142638, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, "Coordinate does not match (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=1.1000000&y=2.2000000)."); Action callAction = () => @@ -1560,9 +1567,9 @@ // Then CollectionAssert.AreEqual(layersBeforeUpdate, mapView.Layers); Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(535419.87415209203, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, + Assert.AreEqual(535405.97207404568, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=12345.6789000&y=9876.5432100)."); - Assert.AreEqual(5323846.0863087801, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, + Assert.AreEqual(5323789.7111355662, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, "Coordinate does not match (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=25831&x=12345.6789000&y=9876.5432100)."); }; Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs =================================================================== diff -u -r96ead5fb68a31e1491693e187045d11b9569e2e6 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs (.../MapPointDataConverterTest.cs) (revision 96ead5fb68a31e1491693e187045d11b9569e2e6) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs (.../MapPointDataConverterTest.cs) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -34,10 +34,10 @@ using DotSpatial.Controls; using DotSpatial.Data; using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Point = DotSpatial.Topology.Point; +using Point = NetTopologySuite.Geometries.Point; using PointShape = DotSpatial.Symbology.PointShape; namespace Core.Components.DotSpatial.Test.Converter Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs =================================================================== diff -u -r96ead5fb68a31e1491693e187045d11b9569e2e6 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs (.../MapPolygonDataConverterTest.cs) (revision 96ead5fb68a31e1491693e187045d11b9569e2e6) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs (.../MapPolygonDataConverterTest.cs) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -34,7 +34,8 @@ using DotSpatial.Controls; using DotSpatial.Data; using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; +using NetTopologySuite.Geometries; using NUnit.Framework; using Rhino.Mocks; @@ -462,14 +463,18 @@ private static MapFeature CreateMapFeatureWithMetaData(string metadataAttributeName) { var random = new Random(21); + var point1 = new Point2D(random.NextDouble(), random.NextDouble()); + var point2 = new Point2D(random.NextDouble(), random.NextDouble()); var mapFeature = new MapFeature(new[] { new MapGeometry(new[] { new[] { - new Point2D(random.NextDouble(), random.NextDouble()), - new Point2D(random.NextDouble(), random.NextDouble()) + point1, + point2, + point2, + point1 } }) }); Index: Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj =================================================================== diff -u -r96ead5fb68a31e1491693e187045d11b9569e2e6 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj (.../Core.Components.DotSpatial.Test.csproj) (revision 96ead5fb68a31e1491693e187045d11b9569e2e6) +++ Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj (.../Core.Components.DotSpatial.Test.csproj) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -63,9 +63,6 @@ - - - Index: Core/Components/test/Core.Components.DotSpatial.Test/Layer/BruTile/BruTileLayerTest.cs =================================================================== diff -u -rdf4b8185584046d57926f8be9b6e8fc86cda1711 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/test/Core.Components.DotSpatial.Test/Layer/BruTile/BruTileLayerTest.cs (.../BruTileLayerTest.cs) (revision df4b8185584046d57926f8be9b6e8fc86cda1711) +++ Core/Components/test/Core.Components.DotSpatial.Test/Layer/BruTile/BruTileLayerTest.cs (.../BruTileLayerTest.cs) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -64,7 +64,7 @@ false, 0f) .SetName("DrawRegions for 2 consecutive tiles at level 4."); - + yield return new TestCaseData(new TileInfosTestConfig(new[] { new TileInfoConfig(new Extent(99949.76, 463000.08, 155000, 518050.32), @@ -109,7 +109,7 @@ true, 0f) .SetName("DrawRegions for 2 loose tiles at level 9 in WGS84 without specifying region."); - + yield return new TestCaseData(new TileInfosTestConfig(new[] { new TileInfoConfig(new Extent(113712.32, 509448.72, 115432.64, 511169.04), @@ -124,7 +124,7 @@ false, 0f) .SetName("DrawRegions at level 9 for region outside viewport."); - + yield return new TestCaseData(new TileInfosTestConfig(new[] { new TileInfoConfig(new Extent(99949.76, 463000.08, 155000, 518050.32), @@ -139,7 +139,7 @@ false, 1f) .SetName("DrawRegions for 2 consecutive tiles at level 4 for fully transparent layer."); - + yield return new TestCaseData(new TileInfosTestConfig(new[] { new TileInfoConfig(new Extent(99949.76, 463000.08, 155000, 518050.32), @@ -154,7 +154,7 @@ false, 0.5f) .SetName("DrawRegions for 2 consecutive tiles at level 4 for 50% transparent layer."); - + yield return new TestCaseData(new TileInfosTestConfig(new[] { new TileInfoConfig(new Extent(99949.76, 463000.08, 155000, 518050.32), @@ -694,6 +694,7 @@ // Call layer.DrawRegions(mapArgs, regions); + //mapCanvas.Save(Path.Combine(Path.GetTempPath(), "BackgroundLayerCanvas_smallerAfterAddingTestTiles.png")); // Assert TestHelper.AssertImagesAreEqual(expectedResult, mapCanvas); Index: Core/Components/test/Core.Components.DotSpatial.Test/Layer/MapPolygonDataLayerTest.cs =================================================================== diff -u -rdf4b8185584046d57926f8be9b6e8fc86cda1711 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/test/Core.Components.DotSpatial.Test/Layer/MapPolygonDataLayerTest.cs (.../MapPolygonDataLayerTest.cs) (revision df4b8185584046d57926f8be9b6e8fc86cda1711) +++ Core/Components/test/Core.Components.DotSpatial.Test/Layer/MapPolygonDataLayerTest.cs (.../MapPolygonDataLayerTest.cs) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -198,7 +198,9 @@ new[] { new Point2D(1, 2), - new Point2D(2, 3) + new Point2D(2, 3), + new Point2D(2, 3), + new Point2D(1, 2) } }) }) Index: Core/Components/test/Core.Components.DotSpatial.Test/Projections/ReprojectExtensionsTest.cs =================================================================== diff -u -r96ead5fb68a31e1491693e187045d11b9569e2e6 -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c --- Core/Components/test/Core.Components.DotSpatial.Test/Projections/ReprojectExtensionsTest.cs (.../ReprojectExtensionsTest.cs) (revision 96ead5fb68a31e1491693e187045d11b9569e2e6) +++ Core/Components/test/Core.Components.DotSpatial.Test/Projections/ReprojectExtensionsTest.cs (.../ReprojectExtensionsTest.cs) (revision bf8a39dac99b87d4e75a2e68548c6e7f6a1f398c) @@ -61,6 +61,7 @@ { p1, p2, + p2, p1 }); @@ -85,6 +86,7 @@ { p1, p2, + p2, p1 }); @@ -99,31 +101,6 @@ } [Test] - [TestCase(0)] - [TestCase(1)] - [TestCase(2)] - public void Reproject_ForLinearRingWithTooFewCoordinates_ThrowArgumentException(int numberOfPoints) - { - // Setup - IEnumerable coordinates = Enumerable.Range(0, numberOfPoints) - .Select(i => new Coordinate(i, i)); - var linearRing = new LinearRing(new Coordinate[1]); - - - linearRing.Coordinates.Concat(coordinates.ToArray()); - - ProjectionInfo projection = KnownCoordinateSystems.Projected.NationalGrids.Rijksdriehoekstelsel; - - // Call - TestDelegate call = () => linearRing.Reproject(projection, projection); - - // Assert - const string message = "Ring must contain at least 3 coordinates."; - string paramName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message).ParamName; - Assert.AreEqual("ring", paramName); - } - - [Test] public void Reproject_ForLinearRingWithTargetAndSourceTheSameCoordinateSystem_DensifiedLinearRing() { // Setup Index: Core/Components/test/Core.Components.DotSpatial.Test/Resources/BackgroundLayerCanvas_smallerAfterAddingTestTiles.png =================================================================== diff -u -r20d628d409984082edb491f5fe246d1ea80f382f -rbf8a39dac99b87d4e75a2e68548c6e7f6a1f398c Binary files differ