Index: Core/Components/src/Core.Components.DotSpatial.Forms/Core.Components.DotSpatial.Forms.csproj =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial.Forms/Core.Components.DotSpatial.Forms.csproj (.../Core.Components.DotSpatial.Forms.csproj) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial.Forms/Core.Components.DotSpatial.Forms.csproj (.../Core.Components.DotSpatial.Forms.csproj) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -39,17 +39,20 @@ - - - - - + + + + + + - - - - - + + + + + + + 2.0.8 Index: Core/Components/src/Core.Components.DotSpatial.Forms/MapControl.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial.Forms/MapControl.cs (.../MapControl.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial.Forms/MapControl.cs (.../MapControl.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -34,7 +34,7 @@ using DotSpatial.Controls; using DotSpatial.Data; using DotSpatial.Projections; -using DotSpatial.Topology; +using GeoAPI.Geometries; using log4net; using ILog = log4net.ILog; using Timer = System.Timers.Timer; @@ -542,7 +542,7 @@ public void ZoomToAllVisibleLayers(MapData layerData) { - IEnvelope envelope = CreateEnvelopeForAllVisibleLayers(layerData); + Envelope envelope = CreateEnvelopeForAllVisibleLayers(layerData); if (!envelope.IsNull) { Extent extent = envelope.ToExtent(); @@ -558,7 +558,7 @@ /// The area definition. /// Thrown when is /// not part of the drawn map features. - private IEnvelope CreateEnvelopeForAllVisibleLayers(MapData mapData) + private Envelope CreateEnvelopeForAllVisibleLayers(MapData mapData) { var collection = mapData as MapDataCollection; if (collection != null) @@ -573,7 +573,7 @@ nameof(mapData)); } - IEnvelope envelope = new Envelope(); + Envelope envelope = new Envelope(); if (LayerHasVisibleExtent(drawnMapData.FeatureBasedMapDataLayer)) { envelope.ExpandToInclude(drawnMapData.FeatureBasedMapDataLayer.Extent.ToEnvelope()); @@ -589,9 +589,9 @@ /// The area definition. /// Thrown when or /// any of its children is not part of the drawn map features. - private IEnvelope CreateEnvelopeForAllVisibleLayers(MapDataCollection mapData) + private Envelope CreateEnvelopeForAllVisibleLayers(MapDataCollection mapData) { - IEnvelope envelope = new Envelope(); + Envelope envelope = new Envelope(); foreach (MapData childMapData in mapData.Collection) { envelope.ExpandToInclude(CreateEnvelopeForAllVisibleLayers(childMapData)); Index: Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs (.../FeatureBasedMapDataConverter.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/Converter/FeatureBasedMapDataConverter.cs (.../FeatureBasedMapDataConverter.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -32,7 +32,7 @@ using DotSpatial.Data; using DotSpatial.Projections; using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; namespace Core.Components.DotSpatial.Converter { Index: Core/Components/src/Core.Components.DotSpatial/Converter/MapLineDataConverter.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/Converter/MapLineDataConverter.cs (.../MapLineDataConverter.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/Converter/MapLineDataConverter.cs (.../MapLineDataConverter.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -29,7 +29,8 @@ using DotSpatial.Controls; using DotSpatial.Data; using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; +using NetTopologySuite.Geometries; using LineStyle = Core.Components.Gis.Style.LineStyle; namespace Core.Components.DotSpatial.Converter @@ -77,7 +78,7 @@ LineCap.Round); } - private static IBasicGeometry GetGeometry(MapFeature mapFeature) + private static IGeometry GetGeometry(MapFeature mapFeature) { var factory = new GeometryFactory(); @@ -97,9 +98,10 @@ return GetLineString(factory, pointsToConvert); } - private static IBasicLineString GetLineString(IGeometryFactory factory, IEnumerable points) + private static ILineString GetLineString(IGeometryFactory factory, IEnumerable points) { - return factory.CreateLineString(ConvertPoint2DElementsToCoordinates(points).ToArray()); + Coordinate[] coordinates = points.Select(point => new Coordinate(point.X, point.Y)).ToArray(); + return factory.CreateLineString(coordinates); } } } \ No newline at end of file Index: Core/Components/src/Core.Components.DotSpatial/Converter/MapPointDataConverter.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/Converter/MapPointDataConverter.cs (.../MapPointDataConverter.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/Converter/MapPointDataConverter.cs (.../MapPointDataConverter.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -28,7 +28,7 @@ using DotSpatial.Controls; using DotSpatial.Data; using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; namespace Core.Components.DotSpatial.Converter { @@ -39,7 +39,7 @@ { protected override IEnumerable CreateFeatures(MapFeature mapFeature) { - return GetAllMapFeatureCoordinates(mapFeature).Select(c => new Feature(new Point(c.X, c.Y))).ToArray(); + return GetAllMapFeatureCoordinates(mapFeature).Select(c => new Feature(new Coordinate(c.X, c.Y))).ToArray(); } protected override IFeatureSymbolizer CreateSymbolizer(MapPointData mapData) Index: Core/Components/src/Core.Components.DotSpatial/Converter/MapPolygonDataConverter.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/Converter/MapPolygonDataConverter.cs (.../MapPolygonDataConverter.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/Converter/MapPolygonDataConverter.cs (.../MapPolygonDataConverter.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -31,7 +31,8 @@ using DotSpatial.Controls; using DotSpatial.Data; using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; +using NetTopologySuite.Geometries; namespace Core.Components.DotSpatial.Converter { @@ -48,13 +49,13 @@ { IEnumerable[] pointCollections = mapGeometry.PointCollections.ToArray(); - IEnumerable outerRingCoordinates = ConvertPoint2DElementsToCoordinates(pointCollections[0]); + Coordinate[] outerRingCoordinates = ConvertPoint2DElementsToCoordinates(pointCollections[0]).ToArray(); ILinearRing outerRing = new LinearRing(outerRingCoordinates); var innerRings = new ILinearRing[pointCollections.Length - 1]; for (var i = 1; i < pointCollections.Length; i++) { - IEnumerable innerRingCoordinates = ConvertPoint2DElementsToCoordinates(pointCollections[i]); + Coordinate[] innerRingCoordinates = ConvertPoint2DElementsToCoordinates(pointCollections[i]).ToArray(); innerRings[i - 1] = new LinearRing(innerRingCoordinates); } @@ -104,9 +105,9 @@ return new PolygonCategory(style.FillColor, GetStrokeColor(style), style.StrokeThickness); } - private static IBasicGeometry GetGeometry(List geometryList) + private static IGeometry GetGeometry(List geometryList) { - IBasicGeometry geometry; + IGeometry geometry; var factory = new GeometryFactory(); if (geometryList.Count > 1) Index: Core/Components/src/Core.Components.DotSpatial/Core.Components.DotSpatial.csproj =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/Core.Components.DotSpatial.csproj (.../Core.Components.DotSpatial.csproj) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/Core.Components.DotSpatial.csproj (.../Core.Components.DotSpatial.csproj) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -50,17 +50,20 @@ 2.1.2 - - - - - + + + + + + - - - - - + + + + + + + \ No newline at end of file Index: Core/Components/src/Core.Components.DotSpatial/Layer/BruTile/BruTileLayer.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/Layer/BruTile/BruTileLayer.cs (.../BruTileLayer.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/Layer/BruTile/BruTileLayer.cs (.../BruTileLayer.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -63,14 +63,15 @@ using Core.Components.DotSpatial.Properties; using Core.Components.Gis.Exceptions; using DotSpatial.Controls; +using DotSpatial.Data; using DotSpatial.Projections; using DotSpatial.Projections.AuthorityCodes; -using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; using BruTileExtent = BruTile.Extent; using DotSpatialExtent = DotSpatial.Data.Extent; using DotSpatialLayer = DotSpatial.Symbology.Layer; using Point = System.Drawing.Point; +using WorldFile = Core.Components.DotSpatial.Projections.WorldFile; namespace Core.Components.DotSpatial.Layer.BruTile { @@ -356,19 +357,19 @@ private static bool TryParseProjectionProj4(string proj4, out ProjectionInfo projectionInfo) { - return TryParseString(proj4, ProjectionInfo.FromProj4String, out projectionInfo); + return TryParseString(() => ProjectionInfo.FromProj4String(proj4), out projectionInfo); } private static bool TryParseProjectionEsri(string esriWkt, out ProjectionInfo projectionInfo) { - return TryParseString(esriWkt, ProjectionInfo.FromEsriString, out projectionInfo); + return TryParseString(() => ProjectionInfo.FromEsriString(esriWkt), out projectionInfo); } - private static bool TryParseString(string text, Func parseText, out ProjectionInfo projectionInfo) + private static bool TryParseString(Func parseText, out ProjectionInfo projectionInfo) { try { - projectionInfo = parseText(text); + projectionInfo = parseText(); } catch { Index: Core/Components/src/Core.Components.DotSpatial/MapFunctions/MapFunctionSelectionZoom.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/MapFunctions/MapFunctionSelectionZoom.cs (.../MapFunctionSelectionZoom.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/MapFunctions/MapFunctionSelectionZoom.cs (.../MapFunctionSelectionZoom.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -26,7 +26,7 @@ using DotSpatial.Controls; using DotSpatial.Data; using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; using Point = System.Drawing.Point; namespace Core.Components.DotSpatial.MapFunctions @@ -138,7 +138,7 @@ } else if (geoStartPoint != null) { - IEnvelope env = new Envelope(geoStartPoint.X, e.GeographicLocation.X, + Envelope env = new Envelope(geoStartPoint.X, e.GeographicLocation.X, geoStartPoint.Y, e.GeographicLocation.Y); if (Math.Abs(e.X - startPoint.X) > 1 && Math.Abs(e.Y - startPoint.Y) > 1) { Index: Core/Components/src/Core.Components.DotSpatial/Projections/ReprojectExtensions.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/Projections/ReprojectExtensions.cs (.../ReprojectExtensions.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/Projections/ReprojectExtensions.cs (.../ReprojectExtensions.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -21,9 +21,10 @@ using System; using System.Collections.Generic; +using System.Linq; using DotSpatial.Data; using DotSpatial.Projections; -using DotSpatial.Topology; +using GeoAPI.Geometries; using DotSpatialReproject = DotSpatial.Projections.Reproject; namespace Core.Components.DotSpatial.Projections @@ -67,13 +68,13 @@ throw new ArgumentNullException(nameof(target)); } - if (ring.Coordinates.Count < 3) + if (ring.Coordinates.Length < 3) { throw new ArgumentException(@"Ring must contain at least 3 coordinates.", nameof(ring)); } - IList seq = Reproject(ring.Coordinates.Densify(36), source, target); + Coordinate[] seq = Reproject(ring.Coordinates.Densify(36).ToArray(), source, target); return ring.Factory.CreateLinearRing(seq); } @@ -112,17 +113,17 @@ return ToExtent(xy); } - private static IList Reproject(this IList coordinates, ProjectionInfo source, ProjectionInfo target) + private static Coordinate[] Reproject(this Coordinate[] coordinates, ProjectionInfo source, ProjectionInfo target) { if (target.Transform == null) { return coordinates; } - var xy = new double[coordinates.Count * 2]; - var z = new double[coordinates.Count]; + var xy = new double[coordinates.Length * 2]; + var z = new double[coordinates.Length]; var j = 0; - for (var i = 0; i < coordinates.Count; i++) + for (var i = 0; i < coordinates.Length; i++) { Coordinate c = coordinates[i]; xy[j] = c.X; @@ -131,16 +132,16 @@ z[i] = double.IsNaN(c.Z) ? 0 : c.Z; } - DotSpatialReproject.ReprojectPoints(xy, z, source, target, 0, coordinates.Count); + DotSpatialReproject.ReprojectPoints(xy, z, source, target, 0, coordinates.Length); - var result = new List(coordinates.Count); + var result = new List(coordinates.Length); j = 0; - for (var i = 0; i < coordinates.Count; i++) + for (var i = 0; i < coordinates.Length; i++) { result.Add(new Coordinate(xy[j++], xy[j++])); } - return result; + return result.ToArray(); } /// Index: Core/Components/src/Core.Components.DotSpatial/Projections/TileReprojector.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/Projections/TileReprojector.cs (.../TileReprojector.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/Projections/TileReprojector.cs (.../TileReprojector.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -27,8 +27,7 @@ using DotSpatial.Controls; using DotSpatial.Data; using DotSpatial.Projections; -using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; using DotSpatialReproject = DotSpatial.Projections.Reproject; using Point = System.Drawing.Point; Index: Core/Components/src/Core.Components.DotSpatial/Projections/WorldFile.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.DotSpatial/Projections/WorldFile.cs (.../WorldFile.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.DotSpatial/Projections/WorldFile.cs (.../WorldFile.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -21,8 +21,10 @@ using System; using System.Collections.Generic; +using System.Linq; using Core.Components.DotSpatial.Properties; -using DotSpatial.Topology; +using GeoAPI.Geometries; +using NetTopologySuite.Geometries; using Point = System.Drawing.Point; namespace Core.Components.DotSpatial.Projections @@ -181,16 +183,16 @@ /// The ground bounding-ordinate. public IPolygon BoundingOrdinatesToWorldCoordinates(int width, int height) { - var ringCoordinates = new List(5); + var ringCoordinates = new Coordinate[5]; Coordinate leftTop = ToWorldCoordinates(0, 0); - ringCoordinates.AddRange(new[] + ringCoordinates.Concat(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/src/Core.Components.Gis.IO/Core.Components.Gis.IO.csproj =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.Gis.IO/Core.Components.Gis.IO.csproj (.../Core.Components.Gis.IO.csproj) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.Gis.IO/Core.Components.Gis.IO.csproj (.../Core.Components.Gis.IO.csproj) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -41,17 +41,20 @@ - - - - - + + + + + + - - - - - + + + + + + + 2.0.8 Index: Core/Components/src/Core.Components.Gis.IO/Importers/FeatureBasedMapDataImporter.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.Gis.IO/Importers/FeatureBasedMapDataImporter.cs (.../FeatureBasedMapDataImporter.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.Gis.IO/Importers/FeatureBasedMapDataImporter.cs (.../FeatureBasedMapDataImporter.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -30,7 +30,6 @@ using Core.Components.Gis.IO.Properties; using Core.Components.Gis.IO.Readers; using DotSpatial.Data; -using DotSpatial.Topology; namespace Core.Components.Gis.IO.Importers { Index: Core/Components/src/Core.Components.Gis.IO/Readers/PointShapeFileReader.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.Gis.IO/Readers/PointShapeFileReader.cs (.../PointShapeFileReader.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.Gis.IO/Readers/PointShapeFileReader.cs (.../PointShapeFileReader.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -30,7 +30,7 @@ using Core.Components.Gis.Features; using Core.Components.Gis.Geometries; using DotSpatial.Data; -using DotSpatial.Topology; +using GeoAPI.Geometries; using CoreCommonUtilResources = Core.Common.Util.Properties.Resources; using GisIOResources = Core.Components.Gis.IO.Properties.Resources; @@ -169,7 +169,7 @@ private static MapFeature CreateMapFeatureForPointFeature(IFeature pointFeature) { - IEnumerable mapGeometries = pointFeature.Coordinates.Select(c => new MapGeometry(GetMapGeometryPointCollections(c))).ToArray(); + IEnumerable mapGeometries = pointFeature.Geometry.Coordinates.Select(c => new MapGeometry(GetMapGeometryPointCollections(c))).ToArray(); return new MapFeature(mapGeometries); } Index: Core/Components/src/Core.Components.Gis.IO/Readers/PolygonShapeFileReader.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.Gis.IO/Readers/PolygonShapeFileReader.cs (.../PolygonShapeFileReader.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.Gis.IO/Readers/PolygonShapeFileReader.cs (.../PolygonShapeFileReader.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -30,7 +30,7 @@ using Core.Components.Gis.Features; using Core.Components.Gis.Geometries; using DotSpatial.Data; -using DotSpatial.Topology; +using GeoAPI.Geometries; using CoreCommonUtilResources = Core.Common.Util.Properties.Resources; using GisIOResources = Core.Components.Gis.IO.Properties.Resources; @@ -166,9 +166,9 @@ { var geometries = new List(); - for (var i = 0; i < polygonFeature.BasicGeometry.NumGeometries; i++) + for (var i = 0; i < polygonFeature.Geometry.NumGeometries; i++) { - var basicPolygon = (IBasicPolygon) polygonFeature.BasicGeometry.GetBasicGeometryN(i); + var basicPolygon = (IPolygon) polygonFeature.Geometry.GetGeometryN(i); var mapGeometry = new MapGeometry(GetMapGeometryPointCollections(basicPolygon).ToArray()); geometries.Add(mapGeometry); @@ -177,10 +177,10 @@ return new MapFeature(geometries); } - private static IEnumerable> GetMapGeometryPointCollections(IBasicPolygon polygon) + private static IEnumerable> GetMapGeometryPointCollections(IPolygon polygon) { yield return polygon.Shell.Coordinates.Select(c => new Point2D(c.X, c.Y)); - foreach (IBasicLineString hole in polygon.Holes) + foreach (ILinearRing hole in polygon.Holes) { yield return hole.Coordinates.Select(c => new Point2D(c.X, c.Y)); } Index: Core/Components/src/Core.Components.Gis.IO/Readers/PolylineShapeFileReader.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.Gis.IO/Readers/PolylineShapeFileReader.cs (.../PolylineShapeFileReader.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.Gis.IO/Readers/PolylineShapeFileReader.cs (.../PolylineShapeFileReader.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -31,8 +31,10 @@ using Core.Components.Gis.Geometries; using DotSpatial.Data; using DotSpatial.Topology; +using Coordinate = GeoAPI.Geometries.Coordinate; using CoreCommonUtilResources = Core.Common.Util.Properties.Resources; using GisIOResources = Core.Components.Gis.IO.Properties.Resources; +using IGeometry = GeoAPI.Geometries.IGeometry; namespace Core.Components.Gis.IO.Readers { @@ -175,9 +177,9 @@ { var geometries = new List(); - for (var i = 0; i < lineFeature.BasicGeometry.NumGeometries; i++) + for (var i = 0; i < lineFeature.Geometry.NumGeometries; i++) { - IBasicGeometry polylineGeometry = lineFeature.BasicGeometry.GetBasicGeometryN(i); + IGeometry polylineGeometry = lineFeature.Geometry.GetGeometryN(i); var mapGeometry = new MapGeometry(GetMapGeometryPointCollections(polylineGeometry.Coordinates)); geometries.Add(mapGeometry); Index: Core/Components/src/Core.Components.Gis.IO/Writers/PointShapeFileWriter.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.Gis.IO/Writers/PointShapeFileWriter.cs (.../PointShapeFileWriter.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.Gis.IO/Writers/PointShapeFileWriter.cs (.../PointShapeFileWriter.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -27,7 +27,9 @@ using Core.Components.Gis.Geometries; using Core.Components.Gis.IO.Properties; using DotSpatial.Data; -using DotSpatial.Topology; +using GeoAPI.Geometries; +using NetTopologySuite.Geometries; +using FeatureType = DotSpatial.Data.FeatureType; namespace Core.Components.Gis.IO.Writers { Index: Core/Components/src/Core.Components.Gis.IO/Writers/PolylineShapeFileWriter.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/src/Core.Components.Gis.IO/Writers/PolylineShapeFileWriter.cs (.../PolylineShapeFileWriter.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/src/Core.Components.Gis.IO/Writers/PolylineShapeFileWriter.cs (.../PolylineShapeFileWriter.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -27,7 +27,9 @@ using Core.Components.Gis.Geometries; using Core.Components.Gis.IO.Properties; using DotSpatial.Data; -using DotSpatial.Topology; +using GeoAPI.Geometries; +using NetTopologySuite.Geometries; +using FeatureType = DotSpatial.Data.FeatureType; namespace Core.Components.Gis.IO.Writers { @@ -65,7 +67,7 @@ IEnumerable mapGeometryPointCollection = geometry.PointCollections.First(); - List coordinates = mapGeometryPointCollection.Select(p => new Coordinate(p.X, p.Y)).ToList(); + Coordinate[] coordinates = mapGeometryPointCollection.Select(p => new Coordinate(p.X, p.Y)).ToArray(); return new LineString(coordinates); } Index: Core/Components/test/Core.Components.DotSpatial.Forms.Test/Core.Components.DotSpatial.Forms.Test.csproj =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Forms.Test/Core.Components.DotSpatial.Forms.Test.csproj (.../Core.Components.DotSpatial.Forms.Test.csproj) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Forms.Test/Core.Components.DotSpatial.Forms.Test.csproj (.../Core.Components.DotSpatial.Forms.Test.csproj) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -31,17 +31,20 @@ 2.1.2 - - - - - + + + + + + - - - - - + + + + + + + 3.8.1 Index: Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs (.../MapControlTest.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Forms.Test/MapControlTest.cs (.../MapControlTest.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -50,7 +50,7 @@ using NUnit.Framework; using Rhino.Mocks; using Extent = DotSpatial.Data.Extent; -using IMapView = DotSpatial.Controls.IMapView; +using IMapView = DotSpatial.Controls.IMap; namespace Core.Components.DotSpatial.Forms.Test { @@ -164,8 +164,8 @@ List featureLayers = mapView.Layers.Cast().ToList(); Assert.AreEqual("Points", featureLayers[0].Name); Assert.IsTrue(mapView.Projection.Equals(featureLayers[0].Projection)); - Assert.AreEqual(1.1, featureLayers[0].FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, featureLayers[0].FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + Assert.AreEqual(1.1, featureLayers[0].FeatureSet.Features[0].Geometry.Coordinates[0].X); + Assert.AreEqual(2.2, featureLayers[0].FeatureSet.Features[0].Geometry.Coordinates[0].Y); Assert.AreEqual("Lines", featureLayers[1].Name); Assert.IsTrue(mapView.Projection.Equals(featureLayers[1].Projection)); Assert.AreEqual("Polygons", featureLayers[2].Name); @@ -1019,8 +1019,8 @@ IMapLayer[] layersBeforeUpdate = mapView.Layers.ToArray(); var pointFeatureLayer = (FeatureLayer) layersBeforeUpdate[0]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + 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); // When @@ -1035,9 +1035,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].BasicGeometry.Coordinates[0].X, + Assert.AreEqual(523414.9114786592, 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].BasicGeometry.Coordinates[0].Y, + Assert.AreEqual(5313600.4932731427, 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 +1087,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].BasicGeometry.Coordinates[0].X, + Assert.AreEqual(523414.9114786592, 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].BasicGeometry.Coordinates[0].Y, + Assert.AreEqual(5313600.4932731427, 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 +1101,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].BasicGeometry.Coordinates[0].X, 1e-6, + Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, 1e-6, "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].BasicGeometry.Coordinates[0].Y, 1e-6, + Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, 1e-6, "Minimal drift is acceptable (if it becomes a problem, we need to keep original coordinates in the layer)."); AssertOriginalExtents(mapView); } @@ -1144,8 +1144,8 @@ // Precondition Assert.AreEqual(1, mapView.Layers.Count); var pointFeatureLayer = (FeatureLayer) mapView.Layers[0]; - Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); + Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); // When map.BackgroundMapData = backgroundMapData; @@ -1155,9 +1155,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].BasicGeometry.Coordinates[0].X, + Assert.AreEqual(523414.9114786592, 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].BasicGeometry.Coordinates[0].Y, + Assert.AreEqual(5313600.4932731427, 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); @@ -1199,8 +1199,8 @@ // Precondition Assert.AreEqual(1, mapView.Layers.Count); var pointFeatureLayer = (FeatureLayer) mapView.Layers[0]; - Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); + Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); // When map.BackgroundMapData = backgroundMapData; @@ -1209,8 +1209,8 @@ Assert.AreEqual(1, mapView.Layers.Count); pointFeatureLayer = (FeatureLayer) mapView.Layers[0]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + 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); } } @@ -1253,8 +1253,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].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); + Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); // When WmtsMapData differentBackgroundMapData = WmtsMapDataTestHelper.CreateAlternativePdokMapData(); @@ -1267,9 +1267,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].BasicGeometry.Coordinates[0].X, + Assert.AreEqual(523414.9114786592, 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].BasicGeometry.Coordinates[0].Y, + Assert.AreEqual(5313600.4932731427, 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 +1315,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].BasicGeometry.Coordinates[0].X, + Assert.AreEqual(523414.9114786592, 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].BasicGeometry.Coordinates[0].Y, + Assert.AreEqual(5313600.4932731427, 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 @@ -1331,8 +1331,8 @@ Assert.AreEqual(1, mapView.Layers.Count); pointFeatureLayer = (FeatureLayer) mapView.Layers[0]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + 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); } @@ -1364,9 +1364,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].BasicGeometry.Coordinates[0].X, + Assert.AreEqual(523414.9114786592, 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].BasicGeometry.Coordinates[0].Y, + Assert.AreEqual(5313600.4932731427, 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 +1532,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].BasicGeometry.Coordinates[0].X, + Assert.AreEqual(523414.9114786592, 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].BasicGeometry.Coordinates[0].Y, + Assert.AreEqual(5313600.4932731427, 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 +1560,9 @@ // Then CollectionAssert.AreEqual(layersBeforeUpdate, mapView.Layers); Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(535419.87415209203, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X, + Assert.AreEqual(535419.87415209203, 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].BasicGeometry.Coordinates[0].Y, + Assert.AreEqual(5323846.0863087801, 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)."); }; @@ -1911,8 +1911,8 @@ // Precondition Assert.AreEqual(1, mapView.Layers.Count); var pointFeatureLayer = (FeatureLayer) mapView.Layers[0]; - Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + Assert.AreEqual(1.1, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); + Assert.AreEqual(2.2, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); // When map.BackgroundMapData = backgroundMapData; @@ -1922,9 +1922,9 @@ Assert.IsInstanceOf(mapView.Layers[0]); pointFeatureLayer = (FeatureLayer) mapView.Layers[1]; Assert.IsTrue(mapView.Projection.Equals(pointFeatureLayer.Projection)); - Assert.AreEqual(368865.09, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X, 1e-1, + Assert.AreEqual(368865.09, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X, 1e-1, "Coordinate does not match. (Ball park expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=3857&x=1.1000000&y=2.2000000)."); - Assert.AreEqual(6102661.13, pointFeatureLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y, 1e-1, + Assert.AreEqual(6102661.13, pointFeatureLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y, 1e-1, "Coordinate does not match (Estimate of expected value can be calculated from https://epsg.io/transform#s_srs=28992&t_srs=3857&x=1.1000000&y=2.2000000)."); AssertReprojectedTo3857TestExtents(mapView); Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs (.../FeatureBasedMapDataConverterTest.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/FeatureBasedMapDataConverterTest.cs (.../FeatureBasedMapDataConverterTest.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -36,9 +36,9 @@ using DotSpatial.Data; using DotSpatial.Projections; using DotSpatial.Symbology; +using GeoAPI.Geometries; using NUnit.Framework; using Rhino.Mocks; -using Point = DotSpatial.Topology.Point; namespace Core.Components.DotSpatial.Test.Converter { @@ -193,8 +193,8 @@ // Assert Assert.AreEqual(1, mapLayer.FeatureSet.Features.Count); - Assert.AreEqual(1.1, mapLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, mapLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + Assert.AreEqual(1.1, mapLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); + Assert.AreEqual(2.2, mapLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); Assert.AreEqual(MapDataConstants.FeatureBasedMapDataCoordinateSystem, mapLayer.Projection); } @@ -220,8 +220,8 @@ // Assert Assert.AreEqual(1, mapLayer.FeatureSet.Features.Count); - Assert.AreEqual(1.1, mapLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, mapLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + Assert.AreEqual(1.1, mapLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); + Assert.AreEqual(2.2, mapLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); Assert.AreEqual(MapDataConstants.FeatureBasedMapDataCoordinateSystem, mapLayer.Projection); } @@ -248,8 +248,8 @@ // Assert Assert.AreEqual(1, mapLayer.FeatureSet.Features.Count); - Assert.AreEqual(3.3135717854013329, mapLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(47.974786294874853, mapLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + Assert.AreEqual(3.3135717854013329, mapLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); + Assert.AreEqual(47.974786294874853, mapLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); Assert.AreEqual(coordinateSystem, mapLayer.Projection); } @@ -278,8 +278,8 @@ // Assert Assert.AreEqual(1, mapLayer.FeatureSet.Features.Count); - Assert.AreEqual(1.1, mapLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].X); - Assert.AreEqual(2.2, mapLayer.FeatureSet.Features[0].BasicGeometry.Coordinates[0].Y); + Assert.AreEqual(1.1, mapLayer.FeatureSet.Features[0].Geometry.Coordinates[0].X); + Assert.AreEqual(2.2, mapLayer.FeatureSet.Features[0].Geometry.Coordinates[0].Y); Assert.AreEqual(MapDataConstants.FeatureBasedMapDataCoordinateSystem, mapLayer.Projection); } @@ -835,7 +835,7 @@ protected override IEnumerable CreateFeatures(MapFeature mapFeature) { - yield return new Feature(new Point(1.1, 2.2)); + yield return new Feature(new Coordinate(1.1, 2.2)); } } } Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapLineDataConverterTest.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapLineDataConverterTest.cs (.../MapLineDataConverterTest.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapLineDataConverterTest.cs (.../MapLineDataConverterTest.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -35,7 +35,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; using LineStyle = Core.Components.Gis.Style.LineStyle; @@ -112,11 +113,11 @@ // Assert IFeature feature = mapLineLayer.DataSet.Features[0]; Assert.AreEqual(mapLineData.Features.Count(), mapLineLayer.DataSet.Features.Count); - Assert.IsInstanceOf(feature.BasicGeometry); + Assert.IsInstanceOf(feature.Geometry); IEnumerable expectedCoordinates = mapFeature.MapGeometries.ElementAt(0).PointCollections.ElementAt(0) .Select(p => new Coordinate(p.X, p.Y)); - CollectionAssert.AreEqual(expectedCoordinates, feature.Coordinates); + CollectionAssert.AreEqual(expectedCoordinates, feature.Geometry.Coordinates); } [Test] @@ -162,10 +163,10 @@ // Assert IFeature feature = mapLineLayer.DataSet.Features[0]; Assert.AreEqual(mapLineData.Features.Count(), mapLineLayer.DataSet.Features.Count); - Assert.IsInstanceOf(feature.BasicGeometry); + Assert.IsInstanceOf(feature.Geometry); IEnumerable expectedCoordinates = mapFeature.MapGeometries.SelectMany(mg => mg.PointCollections.ElementAt(0).Select(p => new Coordinate(p.X, p.Y))); - CollectionAssert.AreEqual(expectedCoordinates, feature.Coordinates); + CollectionAssert.AreEqual(expectedCoordinates, feature.Geometry.Coordinates); } [Test] Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs (.../MapPointDataConverterTest.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPointDataConverterTest.cs (.../MapPointDataConverterTest.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -145,10 +145,10 @@ // Assert IFeature feature = mapPointLayer.DataSet.Features[0]; Assert.AreEqual(mapPointData.Features.Count(), mapPointLayer.DataSet.Features.Count); - Assert.IsInstanceOf(feature.BasicGeometry); + Assert.IsInstanceOf(feature.Geometry); IEnumerable expectedCoordinates = mapFeature.MapGeometries.ElementAt(0).PointCollections.ElementAt(0).Select(p => new Coordinate(p.X, p.Y)); - CollectionAssert.AreEqual(expectedCoordinates, feature.Coordinates); + CollectionAssert.AreEqual(expectedCoordinates, feature.Geometry.Coordinates); } [Test] Index: Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs (.../MapPolygonDataConverterTest.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Test/Converter/MapPolygonDataConverterTest.cs (.../MapPolygonDataConverterTest.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -102,10 +102,10 @@ // Assert IFeature feature = mapPolygonLayer.DataSet.Features[0]; Assert.AreEqual(mapPolygonData.Features.Count(), mapPolygonLayer.DataSet.Features.Count); - Assert.IsInstanceOf(feature.BasicGeometry); + Assert.IsInstanceOf(feature.Geometry); IEnumerable expectedCoordinates = mapPolygonData.Features.First().MapGeometries.First().PointCollections.First().Select(p => new Coordinate(p.X, p.Y)); - CollectionAssert.AreEqual(expectedCoordinates, mapPolygonLayer.DataSet.Features[0].Coordinates); + CollectionAssert.AreEqual(expectedCoordinates, mapPolygonLayer.DataSet.Features[0].Geometry.Coordinates); } [Test] @@ -140,10 +140,10 @@ // Assert IFeature feature = mapPolygonLayer.DataSet.Features[0]; Assert.AreEqual(mapPolygonData.Features.Count(), mapPolygonLayer.DataSet.Features.Count); - Assert.IsInstanceOf(feature.BasicGeometry); + Assert.IsInstanceOf(feature.Geometry); IEnumerable expectedCoordinates = mapFeature.MapGeometries.SelectMany(mg => mg.PointCollections.ElementAt(0).Select(p => new Coordinate(p.X, p.Y))); - CollectionAssert.AreEqual(expectedCoordinates, feature.Coordinates); + CollectionAssert.AreEqual(expectedCoordinates, feature.Geometry.Coordinates); } [Test] @@ -174,9 +174,9 @@ // Assert IFeature feature = mapPolygonLayer.DataSet.Features[0]; Assert.AreEqual(mapPolygonData.Features.Count(), mapPolygonLayer.DataSet.Features.Count); - Assert.IsInstanceOf(feature.BasicGeometry); + Assert.IsInstanceOf(feature.Geometry); - var polygonGeometry = (Polygon) mapPolygonLayer.FeatureSet.Features[0].BasicGeometry; + var polygonGeometry = (Polygon) mapPolygonLayer.FeatureSet.Features[0].Geometry; Assert.AreEqual(1, polygonGeometry.NumGeometries); CollectionAssert.AreEqual(outerRingPoints, polygonGeometry.Shell.Coordinates.Select(c => new Point2D(c.X, c.Y))); CollectionAssert.IsEmpty(polygonGeometry.Holes); @@ -214,9 +214,9 @@ // Assert IFeature feature = mapPolygonLayer.DataSet.Features[0]; Assert.AreEqual(mapPolygonData.Features.Count(), mapPolygonLayer.DataSet.Features.Count); - Assert.IsInstanceOf(feature.BasicGeometry); + Assert.IsInstanceOf(feature.Geometry); - var polygonGeometry = (Polygon) mapPolygonLayer.FeatureSet.Features[0].BasicGeometry; + var polygonGeometry = (Polygon) mapPolygonLayer.FeatureSet.Features[0].Geometry; Assert.AreEqual(1, polygonGeometry.NumGeometries); CollectionAssert.AreEqual(outerRingPoints, polygonGeometry.Shell.Coordinates.Select(c => new Point2D(c.X, c.Y))); Assert.AreEqual(2, polygonGeometry.Holes.Length); Index: Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj (.../Core.Components.DotSpatial.Test.csproj) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Test/Core.Components.DotSpatial.Test.csproj (.../Core.Components.DotSpatial.Test.csproj) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -72,17 +72,20 @@ 2.1.2 - - - - - + + + + + + - - - - - + + + + + + + 3.8.1 Index: Core/Components/test/Core.Components.DotSpatial.Test/MapFunctions/MapFunctionSelectionZoomTest.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Test/MapFunctions/MapFunctionSelectionZoomTest.cs (.../MapFunctionSelectionZoomTest.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Test/MapFunctions/MapFunctionSelectionZoomTest.cs (.../MapFunctionSelectionZoomTest.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -27,7 +27,7 @@ using DotSpatial.Controls; using DotSpatial.Data; using DotSpatial.Symbology; -using DotSpatial.Topology; +using GeoAPI.Geometries; using NUnit.Framework; using Rhino.Mocks; using Point = System.Drawing.Point; Index: Core/Components/test/Core.Components.DotSpatial.Test/Projections/ReprojectExtensionsTest.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Test/Projections/ReprojectExtensionsTest.cs (.../ReprojectExtensionsTest.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Test/Projections/ReprojectExtensionsTest.cs (.../ReprojectExtensionsTest.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -26,7 +26,8 @@ using Core.Components.DotSpatial.Projections; using DotSpatial.Data; using DotSpatial.Projections; -using DotSpatial.Topology; +using GeoAPI.Geometries; +using NetTopologySuite.Geometries; using NUnit.Framework; namespace Core.Components.DotSpatial.Test.Projections @@ -106,12 +107,11 @@ // Setup IEnumerable coordinates = Enumerable.Range(0, numberOfPoints) .Select(i => new Coordinate(i, i)); - var linearRing = new LinearRing(Enumerable.Empty()); - foreach (Coordinate coordinate in coordinates) - { - linearRing.Coordinates.Add(coordinate); - } + var linearRing = new LinearRing(new Coordinate[1]); + + linearRing.Coordinates.Concat(coordinates.ToArray()); + ProjectionInfo projection = KnownCoordinateSystems.Projected.NationalGrids.Rijksdriehoekstelsel; // Call @@ -147,7 +147,7 @@ // Assert const int numberOfEdges = 3; const int expectedNumberOfExtraPoints = 35; - Assert.AreEqual(numberOfEdges * expectedNumberOfExtraPoints + numberOfEdges + 1, reprojectedRing.Coordinates.Count); + Assert.AreEqual(numberOfEdges * expectedNumberOfExtraPoints + numberOfEdges + 1, reprojectedRing.Coordinates.Length); const double allowedError = 1e-6; // Allow small drift in reprojecting to same coordinate system. @@ -196,7 +196,7 @@ // Assert const int numberOfEdges = 3; const int expectedNumberOfExtraPoints = 35; - Assert.AreEqual(numberOfEdges * expectedNumberOfExtraPoints + numberOfEdges + 1, reprojectedRing.Coordinates.Count); + Assert.AreEqual(numberOfEdges * expectedNumberOfExtraPoints + numberOfEdges + 1, reprojectedRing.Coordinates.Length); const double allowedError = 1e-6; @@ -240,7 +240,7 @@ // Assert const int numberOfEdges = 3; const int expectedNumberOfExtraPoints = 35; - Assert.AreEqual(numberOfEdges * expectedNumberOfExtraPoints + numberOfEdges + 1, reprojectedRing.Coordinates.Count); + Assert.AreEqual(numberOfEdges * expectedNumberOfExtraPoints + numberOfEdges + 1, reprojectedRing.Coordinates.Length); const double allowedError = 1e-6; // Allow small drift in reprojecting to same coordinate system. Index: Core/Components/test/Core.Components.DotSpatial.Test/Projections/WorldFileTest.cs =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.DotSpatial.Test/Projections/WorldFileTest.cs (.../WorldFileTest.cs) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.DotSpatial.Test/Projections/WorldFileTest.cs (.../WorldFileTest.cs) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -22,7 +22,7 @@ using System; using Core.Common.TestUtil; using Core.Components.DotSpatial.Projections; -using DotSpatial.Topology; +using GeoAPI.Geometries; using NUnit.Framework; using Point = System.Drawing.Point; Index: Core/Components/test/Core.Components.Gis.IO.Test/Core.Components.Gis.IO.Test.csproj =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Components/test/Core.Components.Gis.IO.Test/Core.Components.Gis.IO.Test.csproj (.../Core.Components.Gis.IO.Test.csproj) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Components/test/Core.Components.Gis.IO.Test/Core.Components.Gis.IO.Test.csproj (.../Core.Components.Gis.IO.Test.csproj) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -24,17 +24,20 @@ - - - - - + + + + + + - - - - - + + + + + + + 3.8.1 Index: Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj =================================================================== diff -u -r15d1755f5bd9a9d8c733529358cf49049b591397 -r8b5cf6bbc64852f0e67393e824be38cc3eb93cd3 --- Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj (.../Core.Plugins.Map.Test.csproj) (revision 15d1755f5bd9a9d8c733529358cf49049b591397) +++ Core/Plugins/test/Core.Plugins.Map.Test/Core.Plugins.Map.Test.csproj (.../Core.Plugins.Map.Test.csproj) (revision 8b5cf6bbc64852f0e67393e824be38cc3eb93cd3) @@ -35,17 +35,20 @@ - - - - - + + + + + + - - - - - + + + + + + + 3.4.0