diff --git a/Examples/DemoWinForm/ConvertProjectionAndCoordinatesForm.cs b/Examples/DemoWinForm/ConvertProjectionAndCoordinatesForm.cs
index eff34d2e..ab60a6e4 100644
--- a/Examples/DemoWinForm/ConvertProjectionAndCoordinatesForm.cs
+++ b/Examples/DemoWinForm/ConvertProjectionAndCoordinatesForm.cs
@@ -1,25 +1,20 @@
using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
using System.Windows.Forms;
namespace DemoWinForm
{
- public partial class ConvertProjectionAndCoordinatesForm : Form
- {
- public ConvertProjectionAndCoordinatesForm()
- {
- InitializeComponent();
- }
+ public partial class ConvertProjectionAndCoordinatesForm : Form
+ {
+ public ConvertProjectionAndCoordinatesForm()
+ {
+ InitializeComponent();
+ }
- protected override void OnResize(EventArgs e)
- {
- base.OnResize(e);
+ protected override void OnResize(EventArgs e)
+ {
+ base.OnResize(e);
- MainSplitContainer.SplitterDistance = (Width - MainSplitContainer.SplitterWidth) / 2;
- }
- }
+ MainSplitContainer.SplitterDistance = (Width - MainSplitContainer.SplitterWidth) / 2;
+ }
+ }
}
\ No newline at end of file
diff --git a/Examples/DemoWinForm/DemoWinForm.csproj b/Examples/DemoWinForm/DemoWinForm.csproj
index 01500ab5..60310ecc 100644
--- a/Examples/DemoWinForm/DemoWinForm.csproj
+++ b/Examples/DemoWinForm/DemoWinForm.csproj
@@ -22,10 +22,6 @@
-
-
-
-
@@ -37,4 +33,8 @@
+
+
+
+
diff --git a/Examples/DemoWinForm/MainForm.cs b/Examples/DemoWinForm/MainForm.cs
index cc058361..39a4cc91 100644
--- a/Examples/DemoWinForm/MainForm.cs
+++ b/Examples/DemoWinForm/MainForm.cs
@@ -15,20 +15,19 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Drawing;
-using System.IO;
-using System.Windows.Forms;
using DemoWinForm.Properties;
using NetTopologySuite.Geometries;
using SharpMap.Data;
using SharpMap.Data.Providers;
using SharpMap.Forms;
-using GeoAPI.Geometries;
using SharpMap.Layers;
-using GeoPoint = GeoAPI.Geometries.Coordinate;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Drawing;
+using System.IO;
+using System.Windows.Forms;
+using GeoPoint = NetTopologySuite.Geometries.Coordinate;
namespace DemoWinForm
{
@@ -67,16 +66,16 @@ private void registerSymbols()
private static void registerKnownColors(Dictionary colorTable)
{
- foreach (string colorName in Enum.GetNames(typeof (KnownColor)))
+ foreach (string colorName in Enum.GetNames(typeof(KnownColor)))
{
- KnownColor color = (KnownColor) Enum.Parse(typeof (KnownColor), colorName);
+ KnownColor color = (KnownColor)Enum.Parse(typeof(KnownColor), colorName);
colorTable[colorName] = Color.FromKnownColor(color);
}
}
private void registerLayerFactories()
{
-// ConfigurationManager.GetSection("LayerFactories");
+ // ConfigurationManager.GetSection("LayerFactories");
_layerFactoryCatalog[".shp"] = new ShapeFileLayerFactory();
}
@@ -90,7 +89,7 @@ private void addLayer(ILayer layer)
private void addNewRandomGeometryLayer()
{
Random rndGen = new Random();
- Collection geometry = new Collection();
+ Collection geometry = new Collection();
VectorLayer layer = new VectorLayer(String.Empty);
var gf = new GeometryFactory();
@@ -157,14 +156,14 @@ private Color GetRandomColor(Random rndGen)
return Color.FromArgb(rndGen.Next(255), rndGen.Next(255), rndGen.Next(255));
}
- private static void GeneratePolygons(IGeometryFactory factory, ICollection geometry, Random rndGen)
+ private static void GeneratePolygons(GeometryFactory factory, ICollection geometry, Random rndGen)
{
int numPolygons = rndGen.Next(10, 100);
for (var polyIndex = 0; polyIndex < numPolygons; polyIndex++)
{
var vertices = new GeoPoint[5];
- var upperLeft = new GeoPoint(rndGen.NextDouble()*1000, rndGen.NextDouble()*1000);
- var sideLength = rndGen.NextDouble()*50;
+ var upperLeft = new GeoPoint(rndGen.NextDouble() * 1000, rndGen.NextDouble() * 1000);
+ var sideLength = rndGen.NextDouble() * 50;
// Make a square
vertices[0] = new GeoPoint(upperLeft.X, upperLeft.Y);
@@ -172,12 +171,12 @@ private static void GeneratePolygons(IGeometryFactory factory, ICollection geometry, Random rndGen)
+ private static void GenerateLines(GeometryFactory factory, ICollection geometry, Random rndGen)
{
var numLines = rndGen.Next(10, 100);
for (var lineIndex = 0; lineIndex < numLines; lineIndex++)
@@ -185,7 +184,7 @@ private static void GenerateLines(IGeometryFactory factory, ICollection geometry, Random rndGen)
+ private static void GeneratePoints(GeometryFactory factory, ICollection geometry, Random rndGen)
{
var numPoints = rndGen.Next(10, 100);
for (var pointIndex = 0; pointIndex < numPoints; pointIndex++)
{
- var point = new GeoPoint(rndGen.NextDouble()*1000, rndGen.NextDouble()*1000);
+ var point = new GeoPoint(rndGen.NextDouble() * 1000, rndGen.NextDouble() * 1000);
geometry.Add(factory.CreatePoint(point));
}
}
@@ -273,7 +272,7 @@ private void changeMode(MapBox.Tools tool)
private object getLayerTypeIcon(Type type)
{
- if (type == typeof (VectorLayer))
+ if (type == typeof(VectorLayer))
{
return Resources.polygon;
}
@@ -335,32 +334,32 @@ private void MainMapImage_MapQueried(FeatureDataTable data)
private void AddLayerToolStripButton_Click(object sender, EventArgs e)
{
- BeginInvoke((MethodInvoker) delegate { LoadLayer(); });
+ BeginInvoke((MethodInvoker)delegate { LoadLayer(); });
}
private void RemoveLayerToolStripButton_Click(object sender, EventArgs e)
{
- BeginInvoke((MethodInvoker) delegate { RemoveLayer(); });
+ BeginInvoke((MethodInvoker)delegate { RemoveLayer(); });
}
private void AddLayerToolStripMenuItem_Click(object sender, EventArgs e)
{
- BeginInvoke((MethodInvoker) delegate { LoadLayer(); });
+ BeginInvoke((MethodInvoker)delegate { LoadLayer(); });
}
private void RemoveLayerToolStripMenuItem_Click(object sender, EventArgs e)
{
- BeginInvoke((MethodInvoker) delegate { RemoveLayer(); });
+ BeginInvoke((MethodInvoker)delegate { RemoveLayer(); });
}
private void ZoomToExtentsToolStripButton_Click(object sender, EventArgs e)
{
- BeginInvoke((MethodInvoker) delegate { zoomToExtents(); });
+ BeginInvoke((MethodInvoker)delegate { zoomToExtents(); });
}
private void PanToolStripButton_Click(object sender, EventArgs e)
{
- BeginInvoke((MethodInvoker) delegate { changeMode(MapBox.Tools.Pan); });
+ BeginInvoke((MethodInvoker)delegate { changeMode(MapBox.Tools.Pan); });
}
private void QueryModeToolStripButton_Click(object sender, EventArgs e)
@@ -418,7 +417,7 @@ private void MoveDownToolStripMenuItem_Click(object sender, EventArgs e)
private void LayersDataGridView_SelectionChanged(object sender, EventArgs e)
{
- BeginInvoke((MethodInvoker) delegate
+ BeginInvoke((MethodInvoker)delegate
{
changeUIOnLayerSelectionChange();
@@ -437,7 +436,7 @@ private void MainMapImage_MouseMove(GeoPoint WorldPos, MouseEventArgs ImagePos)
private void AddNewRandomGeometryLayer_Click(object sender, EventArgs e)
{
- BeginInvoke((MethodInvoker) delegate { addNewRandomGeometryLayer(); });
+ BeginInvoke((MethodInvoker)delegate { addNewRandomGeometryLayer(); });
}
}
}
\ No newline at end of file
diff --git a/Examples/DemoWinForm/Program.cs b/Examples/DemoWinForm/Program.cs
index a6c2a4bc..74fbee82 100644
--- a/Examples/DemoWinForm/Program.cs
+++ b/Examples/DemoWinForm/Program.cs
@@ -15,12 +15,12 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-using System;
-using System.Text;
-using System.Windows.Forms;
using NetTopologySuite;
using ProjNet.CoordinateSystems;
using ProjNet.CoordinateSystems.Transformations;
+using SharpMap.CoordinateSystems;
+using System;
+using System.Windows.Forms;
namespace DemoWinForm
{
@@ -32,13 +32,11 @@ internal static class Program
[STAThread]
private static void Main()
{
- var gss = new NtsGeometryServices();
- var css = new SharpMap.CoordinateSystems.CoordinateSystemServices(
+ var gss = NtsGeometryServices.Instance;
+ var css = new CoordinateSystemServices(
new CoordinateSystemFactory(),
new CoordinateTransformationFactory(),
SharpMap.Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());
-
- GeoAPI.GeometryServiceProvider.Instance = gss;
SharpMap.Session.Instance
.SetGeometryServices(gss)
.SetCoordinateSystemServices(css)
@@ -49,4 +47,4 @@ private static void Main()
Application.Run(new MainForm());
}
}
-}
\ No newline at end of file
+}
diff --git a/Examples/ExampleCodeSnippets/ClipLabelPosition.cs b/Examples/ExampleCodeSnippets/ClipLabelPosition.cs
index d7b00d46..ff910180 100644
--- a/Examples/ExampleCodeSnippets/ClipLabelPosition.cs
+++ b/Examples/ExampleCodeSnippets/ClipLabelPosition.cs
@@ -5,8 +5,8 @@
///
public class ClipLabelPosition
{
- private GeoAPI.Geometries.IGeometry _clip;
- private GeoAPI.Geometries.Prepared.IPreparedGeometry _prepClip;
+ private NetTopologySuite.Geometries.Geometry _clip;
+ private NetTopologySuite.Geometries.Prepared.IPreparedGeometry _prepClip;
///
/// Creates an instance of this class
@@ -27,7 +27,7 @@ public ClipLabelPosition(SharpMap.Map map)
///
/// A feature
/// A label position
- public GeoAPI.Geometries.Coordinate GetClippedPosition(SharpMap.Data.FeatureDataRow row)
+ public NetTopologySuite.Geometries.Coordinate GetClippedPosition(SharpMap.Data.FeatureDataRow row)
{
var g = _prepClip.Contains(row.Geometry)
? row.Geometry
diff --git a/Examples/ExampleCodeSnippets/CreatingData.cs b/Examples/ExampleCodeSnippets/CreatingData.cs
index 8c4e250f..8fba29b5 100644
--- a/Examples/ExampleCodeSnippets/CreatingData.cs
+++ b/Examples/ExampleCodeSnippets/CreatingData.cs
@@ -32,7 +32,7 @@ public static System.Double[] GetRandomOrdinates(System.Int32 size, System.Doubl
return arr;
}
-
+
///
/// Creates a FeatureDataTable from arrays of x, y and z components
///
@@ -40,7 +40,7 @@ public static System.Double[] GetRandomOrdinates(System.Int32 size, System.Doubl
/// an array of doubles representing the y ordinate values
/// an array of doubles representing the z ordinate values
///
- public static SharpMap.Data.FeatureDataTable CreatePointFeatureDataTableFromArrays(double[] xcomponents,
+ public static SharpMap.Data.FeatureDataTable CreatePointFeatureDataTableFromArrays(double[] xcomponents,
double[] ycomponents,
double[] zcomponents, double[] data = null)
{
@@ -60,18 +60,18 @@ public static SharpMap.Data.FeatureDataTable CreatePointFeatureDataTableFromArra
}
var fdt = new SharpMap.Data.FeatureDataTable();
- fdt.Columns.Add("TimeStamp", typeof (System.DateTime)); // add example timestamp attribute
+ fdt.Columns.Add("TimeStamp", typeof(System.DateTime)); // add example timestamp attribute
if (data != null)
fdt.Columns.Add("Data", typeof(System.Double)); // add example timestamp attribute
-
+
for (var i = 0; i < xcomponents.Length; i++)
{
SharpMap.Data.FeatureDataRow fdr = fdt.NewRow();
fdr.Geometry = factory.CreatePoint(threedee
- ? new GeoAPI.Geometries.Coordinate(xcomponents[i], ycomponents[i], zcomponents[i])
- : new GeoAPI.Geometries.Coordinate(xcomponents[i], ycomponents[i]));
+ ? new NetTopologySuite.Geometries.CoordinateZ(xcomponents[i], ycomponents[i], zcomponents[i])
+ : new NetTopologySuite.Geometries.Coordinate(xcomponents[i], ycomponents[i]));
fdr["TimeStamp"] = System.DateTime.Now; //set the timestamp property
if (data != null)
@@ -86,48 +86,48 @@ public static SharpMap.Data.FeatureDataTable CreatePointFeatureDataTableFromArra
public static class ShapeFactory
{
- public static GeoAPI.Geometries.ILinearRing CreateRectangle(GeoAPI.Geometries.IGeometryFactory factory,
- GeoAPI.Geometries.Coordinate leftTop, GeoAPI.Geometries.Coordinate rightBottom)
+ public static NetTopologySuite.Geometries.LinearRing CreateRectangle(NetTopologySuite.Geometries.GeometryFactory factory,
+ NetTopologySuite.Geometries.Coordinate leftTop, NetTopologySuite.Geometries.Coordinate rightBottom)
{
var pts = new[]
{
- leftTop,
- new GeoAPI.Geometries.Coordinate(rightBottom.X, leftTop.Y),
+ leftTop,
+ new NetTopologySuite.Geometries.Coordinate(rightBottom.X, leftTop.Y),
rightBottom,
- new GeoAPI.Geometries.Coordinate(leftTop.X, rightBottom.Y),
+ new NetTopologySuite.Geometries.Coordinate(leftTop.X, rightBottom.Y),
leftTop
};
return factory.CreateLinearRing(pts);
}
- public static GeoAPI.Geometries.ILinearRing CreateRectangle(GeoAPI.Geometries.IGeometryFactory factory,
- GeoAPI.Geometries.Coordinate center, System.Drawing.SizeF size)
+ public static NetTopologySuite.Geometries.LinearRing CreateRectangle(NetTopologySuite.Geometries.GeometryFactory factory,
+ NetTopologySuite.Geometries.Coordinate center, System.Drawing.SizeF size)
{
var wh = new System.Drawing.SizeF(size.Width * 0.5f, size.Height * 0.5f);
- var lt = new GeoAPI.Geometries.Coordinate(center.X - wh.Width, center.Y + wh.Height);
- var rb = new GeoAPI.Geometries.Coordinate(center.X + wh.Width, center.Y - wh.Height);
+ var lt = new NetTopologySuite.Geometries.Coordinate(center.X - wh.Width, center.Y + wh.Height);
+ var rb = new NetTopologySuite.Geometries.Coordinate(center.X + wh.Width, center.Y - wh.Height);
return CreateRectangle(factory, lt, rb);
}
- public static GeoAPI.Geometries.ILinearRing CreateEllipse(GeoAPI.Geometries.IGeometryFactory factory,
- GeoAPI.Geometries.Coordinate center, System.Drawing.SizeF size)
+ public static NetTopologySuite.Geometries.LinearRing CreateEllipse(NetTopologySuite.Geometries.GeometryFactory factory,
+ NetTopologySuite.Geometries.Coordinate center, System.Drawing.SizeF size)
{
return CreateEllipse(factory, center, size, 12);
}
- public static GeoAPI.Geometries.ILinearRing CreateEllipse(GeoAPI.Geometries.IGeometryFactory factory,
- GeoAPI.Geometries.Coordinate center, System.Drawing.SizeF size, int segmentsPerQuadrant)
+ public static NetTopologySuite.Geometries.LinearRing CreateEllipse(NetTopologySuite.Geometries.GeometryFactory factory,
+ NetTopologySuite.Geometries.Coordinate center, System.Drawing.SizeF size, int segmentsPerQuadrant)
{
const double piHalf = System.Math.PI * 0.5d;
var step = piHalf / segmentsPerQuadrant;
- var pts = new GeoAPI.Geometries.Coordinate[4 * segmentsPerQuadrant + 1];
+ var pts = new NetTopologySuite.Geometries.Coordinate[4 * segmentsPerQuadrant + 1];
var angle = 0d;
for (var i = 0; i < 4 * segmentsPerQuadrant; i++)
{
- pts[i] = new GeoAPI.Geometries.Coordinate(center.X + System.Math.Cos(angle) * size.Width,
+ pts[i] = new NetTopologySuite.Geometries.Coordinate(center.X + System.Math.Cos(angle) * size.Width,
center.Y + System.Math.Sin(angle) * size.Height);
angle += step;
}
@@ -138,17 +138,17 @@ public static GeoAPI.Geometries.ILinearRing CreateEllipse(GeoAPI.Geometries.IGeo
public class TestShapeFactory
{
- public static readonly GeoAPI.Geometries.IGeometryFactory Factory =
+ public static readonly NetTopologySuite.Geometries.GeometryFactory Factory =
new NetTopologySuite.Geometries.GeometryFactory(new NetTopologySuite.Geometries.PrecisionModel(1000));
-
+
[NUnit.Framework.Test]
public void TestRectangle()
{
- var rect = ShapeFactory.CreateRectangle(Factory, new GeoAPI.Geometries.Coordinate(1, 2), new GeoAPI.Geometries.Coordinate(2, 1));
+ var rect = ShapeFactory.CreateRectangle(Factory, new NetTopologySuite.Geometries.Coordinate(1, 2), new NetTopologySuite.Geometries.Coordinate(2, 1));
NUnit.Framework.Assert.AreEqual(rect.StartPoint, rect.EndPoint);
NUnit.Framework.Assert.AreEqual(4, rect.Length);
- var rect2 = ShapeFactory.CreateRectangle(Factory, new GeoAPI.Geometries.Coordinate(1.5, 1.5), new System.Drawing.SizeF(1f, 1f));
+ var rect2 = ShapeFactory.CreateRectangle(Factory, new NetTopologySuite.Geometries.Coordinate(1.5, 1.5), new System.Drawing.SizeF(1f, 1f));
NUnit.Framework.Assert.AreEqual(rect, rect2);
NUnit.Framework.Assert.AreEqual("LINEARRING (1 2, 2 2, 2 1, 1 1, 1 2)", rect.ToString());
@@ -157,13 +157,13 @@ public void TestRectangle()
[NUnit.Framework.Test]
public void TestEllipse()
{
- var ell = ShapeFactory.CreateEllipse(Factory, new GeoAPI.Geometries.Coordinate(1, 1), new System.Drawing.SizeF(1, 1), 1);
+ var ell = ShapeFactory.CreateEllipse(Factory, new NetTopologySuite.Geometries.Coordinate(1, 1), new System.Drawing.SizeF(1, 1), 1);
NUnit.Framework.Assert.AreEqual(ell.StartPoint, ell.EndPoint);
NUnit.Framework.Assert.LessOrEqual(System.Math.Abs(4 * System.Math.Sqrt(2) - ell.Length), 0.00001d);
NUnit.Framework.Assert.AreEqual("LINEARRING (2 1, 1 2, 0 1, 1 0, 2 1)", ell.ToString());
- var ell2 = ShapeFactory.CreateEllipse(Factory, new GeoAPI.Geometries.Coordinate(1, 1), new System.Drawing.SizeF(1, 1));
+ var ell2 = ShapeFactory.CreateEllipse(Factory, new NetTopologySuite.Geometries.Coordinate(1, 1), new System.Drawing.SizeF(1, 1));
System.Console.WriteLine(ell2.ToString());
}
@@ -175,17 +175,17 @@ public void TestLayer()
new[]
{
Factory.CreatePolygon(
- ShapeFactory.CreateEllipse(Factory, new GeoAPI.Geometries.Coordinate(0, 0),
+ ShapeFactory.CreateEllipse(Factory, new NetTopologySuite.Geometries.Coordinate(0, 0),
new System.Drawing.SizeF(40, 30)),
new[]
{
- ShapeFactory.CreateEllipse(Factory, new GeoAPI.Geometries.Coordinate(90, 55),
+ ShapeFactory.CreateEllipse(Factory, new NetTopologySuite.Geometries.Coordinate(90, 55),
new System.Drawing.SizeF(40, 30)),
- ShapeFactory.CreateEllipse(Factory, new GeoAPI.Geometries.Coordinate(77, 24),
+ ShapeFactory.CreateEllipse(Factory, new NetTopologySuite.Geometries.Coordinate(77, 24),
new System.Drawing.SizeF(40, 30)),
- ShapeFactory.CreateEllipse(Factory, new GeoAPI.Geometries.Coordinate(-80, 41),
+ ShapeFactory.CreateEllipse(Factory, new NetTopologySuite.Geometries.Coordinate(-80, 41),
new System.Drawing.SizeF(40, 30)),
- ShapeFactory.CreateEllipse(Factory, new GeoAPI.Geometries.Coordinate(-45, -36),
+ ShapeFactory.CreateEllipse(Factory, new NetTopologySuite.Geometries.Coordinate(-45, -36),
new System.Drawing.SizeF(40, 30)),
})
});
@@ -196,4 +196,4 @@ public void TestLayer()
mapimage.Save("ellipse.png", System.Drawing.Imaging.ImageFormat.Png);
}
}
-}
\ No newline at end of file
+}
diff --git a/Examples/ExampleCodeSnippets/EnsureVisibleSample.cs b/Examples/ExampleCodeSnippets/EnsureVisibleSample.cs
index 0c71c0cd..9f6a4af9 100644
--- a/Examples/ExampleCodeSnippets/EnsureVisibleSample.cs
+++ b/Examples/ExampleCodeSnippets/EnsureVisibleSample.cs
@@ -1,69 +1,89 @@
+using NetTopologySuite;
+using NetTopologySuite.Geometries;
+using NUnit.Framework;
+using ProjNet.CoordinateSystems;
+using ProjNet.CoordinateSystems.Transformations;
+using SharpMap;
+using SharpMap.CoordinateSystems;
using System;
using System.Drawing;
-using GeoAPI.Geometries;
-using NUnit.Framework;
+using System.IO;
namespace ExampleCodeSnippets
{
using cd = CreatingData;
- [NUnit.Framework.TestFixture]
+ [NUnit.Framework.TestFixture]
public class EnsureVisibleSample
{
-public static void EnsureVisible(SharpMap.Map map, GeoAPI.Geometries.Coordinate pt)
-{
- const double ensureVisibleRatio = 0.1d;
-
- //Get current map envelope
- var bb = map.Envelope;
- System.Console.WriteLine(string.Format("Map envelope: {0}", bb));
-
- //Set valid envelope
- var evbb = bb.Grow(- ensureVisibleRatio * bb.Width, -ensureVisibleRatio * bb.Height );
- System.Console.WriteLine(string.Format("Valid envelope: {0}", evbb));
-
- //Test if Point is in valid envelope
- if (evbb.Contains(pt)) return;
-
- //It is not
- System.Console.WriteLine(string.Format("Valid envelope does not contain {0}", pt));
-
- //LineString from Map.Center -> to Point
- var ls = map.Factory.CreateLineString(new[] {evbb.Centre, pt});
- System.Console.WriteLine(string.Format("LineString Map.Center -> Point: {0}", ls));
-
- //Setup Linestring from BoundingBox
- var evbbpts = new [] {evbb.TopLeft(), evbb.TopRight(), evbb.BottomRight(), evbb.BottomLeft(), evbb.TopLeft() };
- var evbblinearring = map.Factory.CreateLineString(evbbpts);
- System.Console.WriteLine(string.Format("Linestring of valid envelope: {0}", evbblinearring));
-
- //// convert geometries to NTS
- //var ntsevbb = (NetTopologySuite.Geometries.LineString)
- // SharpMap.Converters.NTS.GeometryConverter.ToNTSGeometry(evbblinearring, gf);
- //var ntsls = (NetTopologySuite.Geometries.LineString)
- // SharpMap.Converters.NTS.GeometryConverter.ToNTSGeometry(ls, gf);
-
- // Get intersection point
- var intGeo = evbblinearring.Intersection(ls);
- var intPt = (NetTopologySuite.Geometries.Point)intGeo;
- System.Console.WriteLine(string.Format("Intersection point is: {0}", intPt));
-
- //Compute offset
- var dx = pt.X - intPt.X;
- var dy = pt.Y - intPt.Y;
- System.Console.WriteLine(string.Format("Map.Center needs to be shifted by: [{0}, {1}]", dx, dy));
-
- //Set new center Center
- map.Center = new GeoAPI.Geometries.Coordinate(map.Center.X + dx, map.Center.Y + dy);
+ [OneTimeSetUp]
+ public void OneTimeSetUp()
+ {
+ var gss = NtsGeometryServices.Instance;
+ var css = new CoordinateSystemServices(
+ new CoordinateSystemFactory(),
+ new CoordinateTransformationFactory(),
+ SharpMap.Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());
+ Session.Instance
+ .SetGeometryServices(gss)
+ .SetCoordinateSystemServices(css)
+ .SetCoordinateSystemRepository(css);
+ }
-}
+ public static void EnsureVisible(SharpMap.Map map, NetTopologySuite.Geometries.Coordinate pt)
+ {
+ const double ensureVisibleRatio = 0.1d;
+
+ //Get current map envelope
+ var bb = map.Envelope;
+ System.Console.WriteLine(string.Format("Map envelope: {0}", bb));
+
+ //Set valid envelope
+ var evbb = bb.Grow(-ensureVisibleRatio * bb.Width, -ensureVisibleRatio * bb.Height);
+ System.Console.WriteLine(string.Format("Valid envelope: {0}", evbb));
+
+ //Test if Point is in valid envelope
+ if (evbb.Contains(pt)) return;
+
+ //It is not
+ System.Console.WriteLine(string.Format("Valid envelope does not contain {0}", pt));
+
+ //LineString from Map.Center -> to Point
+ var ls = map.Factory.CreateLineString(new[] { evbb.Centre, pt });
+ System.Console.WriteLine(string.Format("LineString Map.Center -> Point: {0}", ls));
+
+ //Setup Linestring from BoundingBox
+ var evbbpts = new[] { evbb.TopLeft(), evbb.TopRight(), evbb.BottomRight(), evbb.BottomLeft(), evbb.TopLeft() };
+ var evbblinearring = map.Factory.CreateLineString(evbbpts);
+ System.Console.WriteLine(string.Format("Linestring of valid envelope: {0}", evbblinearring));
+
+ //// convert geometries to NTS
+ //var ntsevbb = (NetTopologySuite.Geometries.LineString)
+ // SharpMap.Converters.NTS.GeometryConverter.ToNTSGeometry(evbblinearring, gf);
+ //var ntsls = (NetTopologySuite.Geometries.LineString)
+ // SharpMap.Converters.NTS.GeometryConverter.ToNTSGeometry(ls, gf);
+
+ // Get intersection point
+ var intGeo = evbblinearring.Intersection(ls);
+ var intPt = (NetTopologySuite.Geometries.Point)intGeo;
+ System.Console.WriteLine(string.Format("Intersection point is: {0}", intPt));
+
+ //Compute offset
+ var dx = pt.X - intPt.X;
+ var dy = pt.Y - intPt.Y;
+ System.Console.WriteLine(string.Format("Map.Center needs to be shifted by: [{0}, {1}]", dx, dy));
+
+ //Set new center Center
+ map.Center = new NetTopologySuite.Geometries.Coordinate(map.Center.X + dx, map.Center.Y + dy);
+
+ }
[NUnit.Framework.Test]
public void TestEnsureVisible()
{
//Create a map
- SharpMap.Map map = new SharpMap.Map(new System.Drawing.Size(720,360));
-
+ SharpMap.Map map = new SharpMap.Map(new System.Drawing.Size(720, 360));
+
//Create some random sample data
SharpMap.Data.FeatureDataTable fdt =
cd.CreatePointFeatureDataTableFromArrays(cd.GetRandomOrdinates(80, -180, 180),
@@ -71,10 +91,14 @@ public void TestEnsureVisible()
//Create layer and datasource
SharpMap.Layers.VectorLayer vl = new SharpMap.Layers.VectorLayer("Points", new SharpMap.Data.Providers.GeometryFeatureProvider(fdt));
-
+
//Create default style
SharpMap.Styles.VectorStyle defaultStyle = new SharpMap.Styles.VectorStyle();
- defaultStyle.Symbol = new System.Drawing.Bitmap(@"..\..\..\DemoWinForm\Resources\flag.png");
+ var stylePath = Path.GetFullPath(
+ Path.Combine(
+ Path.GetDirectoryName(GetType().Assembly.Location),
+ "..\\..\\..\\..\\DemoWinForm\\Resources\\flag.png"));
+ defaultStyle.Symbol = new System.Drawing.Bitmap(stylePath);
defaultStyle.SymbolScale = 0.5f;
//Create theming class and apply to layer
@@ -85,16 +109,16 @@ public void TestEnsureVisible()
map.Layers.Add(vl);
map.ZoomToExtents();
map.Zoom = 60; //2*30
- map.Center = new GeoAPI.Geometries.Coordinate(0,0);
+ map.Center = new NetTopologySuite.Geometries.Coordinate(0, 0);
System.Console.WriteLine(map.Center);
- EnsureVisible(map, new GeoAPI.Geometries.Coordinate(-30, 0));
+ EnsureVisible(map, new NetTopologySuite.Geometries.Coordinate(-30, 0));
System.Console.WriteLine(map.Center);
System.Console.WriteLine();
- EnsureVisible(map, new GeoAPI.Geometries.Coordinate(15, 20));
+ EnsureVisible(map, new NetTopologySuite.Geometries.Coordinate(15, 20));
System.Console.WriteLine(map.Center);
System.Console.WriteLine();
- EnsureVisible(map, new GeoAPI.Geometries.Coordinate(15, -20));
+ EnsureVisible(map, new NetTopologySuite.Geometries.Coordinate(15, -20));
System.Console.WriteLine(map.Center);
}
diff --git a/Examples/ExampleCodeSnippets/ExampleCodeSession.cs b/Examples/ExampleCodeSnippets/ExampleCodeSession.cs
index a83045d6..713d1188 100644
--- a/Examples/ExampleCodeSnippets/ExampleCodeSession.cs
+++ b/Examples/ExampleCodeSnippets/ExampleCodeSession.cs
@@ -1,22 +1,21 @@
-namespace ExampleCodeSnippets
+using SharpMap.CoordinateSystems;
+
+namespace ExampleCodeSnippets
{
- [NUnit.Framework.SetUpFixture]
public class ExampleCodeSession
{
- [NUnit.Framework.SetUp]
+ [NUnit.Framework.OneTimeSetUp]
public void SetUp()
{
- var gss = new NetTopologySuite.NtsGeometryServices();
- var css = new SharpMap.CoordinateSystems.CoordinateSystemServices(
+ var gss = NetTopologySuite.NtsGeometryServices.Instance;
+ var css = new CoordinateSystemServices(
new ProjNet.CoordinateSystems.CoordinateSystemFactory(),
new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory(),
SharpMap.Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());
-
- GeoAPI.GeometryServiceProvider.Instance = gss;
SharpMap.Session.Instance
.SetGeometryServices(gss)
.SetCoordinateSystemServices(css)
.SetCoordinateSystemRepository(css);
}
}
-}
\ No newline at end of file
+}
diff --git a/Examples/ExampleCodeSnippets/ExampleCodeSnippets.csproj b/Examples/ExampleCodeSnippets/ExampleCodeSnippets.csproj
index b8005dc1..5e4ddf9f 100644
--- a/Examples/ExampleCodeSnippets/ExampleCodeSnippets.csproj
+++ b/Examples/ExampleCodeSnippets/ExampleCodeSnippets.csproj
@@ -16,10 +16,8 @@
-
-
-
-
+
+
@@ -29,4 +27,8 @@
+
+
+
+
diff --git a/Examples/ExampleCodeSnippets/GeoJsonExample.cs b/Examples/ExampleCodeSnippets/GeoJsonExample.cs
index 9bb156b8..fa4ab2ae 100644
--- a/Examples/ExampleCodeSnippets/GeoJsonExample.cs
+++ b/Examples/ExampleCodeSnippets/GeoJsonExample.cs
@@ -30,7 +30,7 @@ public void TestGeoJson(System.Collections.Generic.IEnumerable jsons)
{
var gjr = new NetTopologySuite.IO.GeoJsonReader();
- var geom = jsons.Select(json => gjr.Read(json)).ToList();
+ var geom = jsons.Select(json => gjr.Read(json)).ToList();
var fp = new SharpMap.Data.Providers.GeometryFeatureProvider(geom);
var l = new SharpMap.Layers.VectorLayer("geojson", fp);
diff --git a/Examples/ExampleCodeSnippets/HeatLayerExample.cs b/Examples/ExampleCodeSnippets/HeatLayerExample.cs
index 8096e30b..da0845da 100644
--- a/Examples/ExampleCodeSnippets/HeatLayerExample.cs
+++ b/Examples/ExampleCodeSnippets/HeatLayerExample.cs
@@ -1,22 +1,18 @@
-using System.Collections.Generic;
-using System.Data;
-using System.Drawing;
-using System.Drawing.Imaging;
-using GeoAPI.Geometries;
+using NetTopologySuite;
+using NetTopologySuite.Geometries;
using NUnit.Framework;
-using NetTopologySuite;
using SharpMap.Data;
using SharpMap.Layers;
+using System.Collections.Generic;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Imaging;
namespace ExampleCodeSnippets
{
[TestFixture]
public class HeatLayerExample
{
- static HeatLayerExample ()
- {
- GeoAPI.GeometryServiceProvider.Instance = new NtsGeometryServices();
- }
[Test]
public void HeatLayerTest()
{
@@ -82,8 +78,8 @@ public void TestRealData()
private static FeatureDataTable GetRealFeatureDataTable()
{
var res = new FeatureDataTable();
- res.Columns.Add("Oid", typeof (uint));
- res.Columns.Add("Data", typeof (int));
+ res.Columns.Add("Oid", typeof(uint));
+ res.Columns.Add("Data", typeof(int));
return res;
}
@@ -91,12 +87,12 @@ private static FeatureDataTable GetRealFeatureDataTable()
private static void FillRealDataTable(FeatureDataTable table)
{
table.BeginLoadData();
- var factory = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory(4326);
+ var factory = NtsGeometryServices.Instance.CreateGeometryFactory(4326);
uint id = 0;
foreach (var datas in PointData())
{
- var row = (FeatureDataRow) table.LoadDataRow(new object[] {id++, datas[0]}, LoadOption.OverwriteChanges);
+ var row = (FeatureDataRow)table.LoadDataRow(new object[] { id++, datas[0] }, LoadOption.OverwriteChanges);
row.Geometry = factory.CreatePoint(new Coordinate(datas[2], datas[1]));
}
table.EndLoadData();
diff --git a/Examples/ExampleCodeSnippets/LengthIndexedLineSample.cs b/Examples/ExampleCodeSnippets/LengthIndexedLineSample.cs
index 79fff1d5..b98589c8 100644
--- a/Examples/ExampleCodeSnippets/LengthIndexedLineSample.cs
+++ b/Examples/ExampleCodeSnippets/LengthIndexedLineSample.cs
@@ -5,41 +5,41 @@ namespace ExampleCodeSnippets
[NUnit.Framework.TestFixture]
public class LengthIndexedLineSample
{
-public GeoAPI.Geometries.IMultiLineString SplitLineString(
- GeoAPI.Geometries.ILineString lineString,
- System.Double length)
-{
- if (lineString == null || lineString.IsEmpty)
- throw new System.ArgumentException("Linestring is null or Empty", "lineString");
+ public NetTopologySuite.Geometries.MultiLineString SplitLineString(
+ NetTopologySuite.Geometries.LineString lineString,
+ System.Double length)
+ {
+ if (lineString == null || lineString.IsEmpty)
+ throw new System.ArgumentException("Linestring is null or Empty", "lineString");
- //var gf = new NetTopologySuite.Geometries.GeometryFactory();
- //var ntsLine = (NetTopologySuite.Geometries.LineString)
- // SharpMap.Converters.NTS.GeometryConverter.ToNTSGeometry(lineString, gf);
+ //var gf = new NetTopologySuite.Geometries.GeometryFactory();
+ //var ntsLine = (NetTopologySuite.Geometries.LineString)
+ // SharpMap.Converters.NTS.GeometryConverter.ToNTSGeometry(lineString, gf);
- var ret = new System.Collections.Generic.List();
- var lil = new NetTopologySuite.LinearReferencing.LengthIndexedLine(lineString);
+ var ret = new System.Collections.Generic.List();
+ var lil = new NetTopologySuite.LinearReferencing.LengthIndexedLine(lineString);
- double currentLength = 0d;
- while (currentLength < lineString.Length)
- {
- var tmpLine = (GeoAPI.Geometries.ILineString)
- lil.ExtractLine(currentLength, currentLength + length);
- ret.Add(tmpLine);
- currentLength += length;
- }
- return lineString.Factory.CreateMultiLineString(ret.ToArray());
-}
+ double currentLength = 0d;
+ while (currentLength < lineString.Length)
+ {
+ var tmpLine = (NetTopologySuite.Geometries.LineString)
+ lil.ExtractLine(currentLength, currentLength + length);
+ ret.Add(tmpLine);
+ currentLength += length;
+ }
+ return lineString.Factory.CreateMultiLineString(ret.ToArray());
+ }
[NUnit.Framework.Test]
public void TestLengthIndexedLine()
{
var gf = new NetTopologySuite.Geometries.GeometryFactory();
var l = gf.CreateLineString(
- new []
- { new GeoAPI.Geometries.Coordinate(0, 0),
- new GeoAPI.Geometries.Coordinate(300, 100),});
+ new[]
+ { new NetTopologySuite.Geometries.Coordinate(0, 0),
+ new NetTopologySuite.Geometries.Coordinate(300, 100),});
System.Console.WriteLine(SplitLineString(l, 20d));
}
}
-}
\ No newline at end of file
+}
diff --git a/Examples/ExampleCodeSnippets/LineSymbolizerTest.cs b/Examples/ExampleCodeSnippets/LineSymbolizerTest.cs
index df68789d..c7fe3ad9 100644
--- a/Examples/ExampleCodeSnippets/LineSymbolizerTest.cs
+++ b/Examples/ExampleCodeSnippets/LineSymbolizerTest.cs
@@ -1,134 +1,129 @@
namespace ExampleCodeSnippets
{
-///
-/// A (simple) street direction symbolizer
-///
-public class StreetDirectionSymbolizer : SharpMap.Rendering.Symbolizer.BaseSymbolizer,
- SharpMap.Rendering.Symbolizer.ILineSymbolizer
-{
///
- /// Creates an instance of this class
+ /// A (simple) street direction symbolizer
///
- public StreetDirectionSymbolizer()
+ public class StreetDirectionSymbolizer : SharpMap.Rendering.Symbolizer.BaseSymbolizer,
+ SharpMap.Rendering.Symbolizer.ILineSymbolizer
{
- RepeatInterval = 500;
- ArrowLength = 100;
- ArrowPen = new System.Drawing.Pen(System.Drawing.Color.Black, 2)
+ ///
+ /// Creates an instance of this class
+ ///
+ public StreetDirectionSymbolizer()
{
- EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor
- };
- }
-
- ///
- /// Method to place the street direction symbols
- ///
- ///
- ///
- ///
- private void OnRenderInternal(SharpMap.MapViewport map, GeoAPI.Geometries.ILineString lineString,
- System.Drawing.Graphics graphics)
- {
+ RepeatInterval = 500;
+ ArrowLength = 100;
+ ArrowPen = new System.Drawing.Pen(System.Drawing.Color.Black, 2)
+ {
+ EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor
+ };
+ }
- var length = lineString.Length;
- var lil = new NetTopologySuite.LinearReferencing.LengthIndexedLine(lineString);
- if (length < RepeatInterval + ArrowLength)
+ ///
+ /// Method to place the street direction symbols
+ ///
+ ///
+ ///
+ ///
+ private void OnRenderInternal(SharpMap.MapViewport map, NetTopologySuite.Geometries.LineString lineString,
+ System.Drawing.Graphics graphics)
{
- var start = System.Math.Max(0, (length - ArrowLength)/2);
- var end = System.Math.Min(length, (length + ArrowLength)/2);
- var arrow = (GeoAPI.Geometries.ILineString) lil.ExtractLine(start, end);
- RenderArrow(map, graphics, arrow);
+ var length = lineString.Length;
+ var lil = new NetTopologySuite.LinearReferencing.LengthIndexedLine(lineString);
+ if (length < RepeatInterval + ArrowLength)
+ {
+ var start = System.Math.Max(0, (length - ArrowLength) / 2);
+ var end = System.Math.Min(length, (length + ArrowLength) / 2);
+ var arrow = (NetTopologySuite.Geometries.LineString)lil.ExtractLine(start, end);
- return;
- }
+ RenderArrow(map, graphics, arrow);
- var numArrows = (int) ((lineString.Length - ArrowLength)/RepeatInterval);
- var offset = (lineString.Length - numArrows*RepeatInterval - ArrowLength)*0.5;
+ return;
+ }
- while (offset + ArrowLength < lineString.Length)
- {
- var arrow = (GeoAPI.Geometries.ILineString) lil.ExtractLine(offset, offset + ArrowLength);
- RenderArrow(map, graphics, arrow);
- offset += RepeatInterval;
- }
+ var numArrows = (int)((lineString.Length - ArrowLength) / RepeatInterval);
+ var offset = (lineString.Length - numArrows * RepeatInterval - ArrowLength) * 0.5;
- }
+ while (offset + ArrowLength < lineString.Length)
+ {
+ var arrow = (NetTopologySuite.Geometries.LineString)lil.ExtractLine(offset, offset + ArrowLength);
+ RenderArrow(map, graphics, arrow);
+ offset += RepeatInterval;
+ }
- ///
- /// Method to render the arrow
- ///
- /// The map
- /// The graphics object
- /// The arrow
- private void RenderArrow(SharpMap.MapViewport map, System.Drawing.Graphics graphics, GeoAPI.Geometries.ILineString arrow)
- {
- var pts = new System.Drawing.PointF[arrow.Coordinates.Length];
- for (var i = 0; i < pts.Length; i++)
- pts[i] = map.WorldToImage(arrow.GetCoordinateN(i));
- graphics.DrawLines(ArrowPen, pts);
- }
+ }
- ///
- /// Gets or sets a value indicating at which distances a street direction marker should be drawn.
- ///
- public double RepeatInterval { get; set; }
+ ///
+ /// Method to render the arrow
+ ///
+ /// The map
+ /// The graphics object
+ /// The arrow
+ private void RenderArrow(SharpMap.MapViewport map, System.Drawing.Graphics graphics, NetTopologySuite.Geometries.LineString arrow)
+ {
+ var pts = new System.Drawing.PointF[arrow.Coordinates.Length];
+ for (var i = 0; i < pts.Length; i++)
+ pts[i] = map.WorldToImage(arrow.GetCoordinateN(i));
+ graphics.DrawLines(ArrowPen, pts);
+ }
- ///
- /// Gets or sets a value indicating the length of the street direction arrow.
- ///
- public double ArrowLength { get; set; }
+ ///
+ /// Gets or sets a value indicating at which distances a street direction marker should be drawn.
+ ///
+ public double RepeatInterval { get; set; }
- ///
- /// Gets or sets a value indicating the pen to use when drawing the marker
- ///
- public System.Drawing.Pen ArrowPen { get; set; }
+ ///
+ /// Gets or sets a value indicating the length of the street direction arrow.
+ ///
+ public double ArrowLength { get; set; }
- public override void Begin(System.Drawing.Graphics g, SharpMap.MapViewport map, int aproximateNumberOfGeometries)
- {
- base.Begin(g, map, aproximateNumberOfGeometries);
+ ///
+ /// Gets or sets a value indicating the pen to use when drawing the marker
+ ///
+ public System.Drawing.Pen ArrowPen { get; set; }
- //Adjust Arrow cap
- var size = (float) (ArrowLength/5/map.PixelWidth);
- ArrowPen.CustomEndCap = new System.Drawing.Drawing2D.AdjustableArrowCap(size, size);
- }
+ public override void Begin(System.Drawing.Graphics g, SharpMap.MapViewport map, int aproximateNumberOfGeometries)
+ {
+ base.Begin(g, map, aproximateNumberOfGeometries);
- public void Render(SharpMap.MapViewport map, GeoAPI.Geometries.ILineal geometry, System.Drawing.Graphics graphics)
- {
- if (geometry is GeoAPI.Geometries.IMultiLineString)
+ //Adjust Arrow cap
+ var size = (float)(ArrowLength / 5 / map.PixelWidth);
+ ArrowPen.CustomEndCap = new System.Drawing.Drawing2D.AdjustableArrowCap(size, size);
+ }
+
+ public void Render(SharpMap.MapViewport map, NetTopologySuite.Geometries.ILineal geometry, System.Drawing.Graphics graphics)
{
- var mls = (GeoAPI.Geometries.IMultiLineString) geometry;
- for (var i = 0; i < mls.Count; i++)
+ if (geometry is NetTopologySuite.Geometries.MultiLineString)
{
- OnRenderInternal(map, (GeoAPI.Geometries.ILineString) mls.GetGeometryN(i), graphics);
+ var mls = (NetTopologySuite.Geometries.MultiLineString)geometry;
+ for (var i = 0; i < mls.Count; i++)
+ {
+ OnRenderInternal(map, (NetTopologySuite.Geometries.LineString)mls.GetGeometryN(i), graphics);
+ }
+ return;
}
- return;
+ OnRenderInternal(map, (NetTopologySuite.Geometries.LineString)geometry, graphics);
}
- OnRenderInternal(map, (GeoAPI.Geometries.ILineString) geometry, graphics);
- }
- protected override void ReleaseManagedResources()
- {
- base.ReleaseManagedResources();
- ArrowPen.Dispose();
- }
+ protected override void ReleaseManagedResources()
+ {
+ base.ReleaseManagedResources();
+ ArrowPen.Dispose();
+ }
- public override object Clone()
- {
- var res = (StreetDirectionSymbolizer) MemberwiseClone();
- res.ArrowPen = new System.Drawing.Pen(((System.Drawing.SolidBrush) ArrowPen.Brush).Color, ArrowPen.Width);
- return res;
+ public override object Clone()
+ {
+ var res = (StreetDirectionSymbolizer)MemberwiseClone();
+ res.ArrowPen = new System.Drawing.Pen(((System.Drawing.SolidBrush)ArrowPen.Brush).Color, ArrowPen.Width);
+ return res;
+ }
}
-}
public class LineSymbolizerTest
{
- [NUnit.Framework.OneTimeSetUp]
- public void OneTimeSetUp()
- {
- GeoAPI.GeometryServiceProvider.Instance = NetTopologySuite.NtsGeometryServices.Instance;
- }
- [NUnit.Framework.Test]
+ [NUnit.Framework.Test]
public void TestBasicLineSymbolizer()
{
if (!System.IO.File.Exists("d:\\daten\\GeoFabrik\\roads.shp"))
@@ -139,7 +134,7 @@ public void TestBasicLineSymbolizer()
//l.Style.Outline = new System.Drawing.Pen(System.Drawing.Color.Firebrick, 5);
l.Style.Line = new System.Drawing.Pen(System.Drawing.Color.Gold, 1);
l.Style.EnableOutline = false;
- var m = new SharpMap.Map(new System.Drawing.Size(1440,1080)) {BackColor = System.Drawing.Color.Cornsilk};
+ var m = new SharpMap.Map(new System.Drawing.Size(1440, 1080)) { BackColor = System.Drawing.Color.Cornsilk };
m.Layers.Add(l);
m.ZoomToExtents();
@@ -184,7 +179,8 @@ public void TestStreetDirectionSymbolizer()
l.Style.EnableOutline = true;
var sd = new SharpMap.Layers.Symbolizer.LinealVectorLayer("streetd", p, new StreetDirectionSymbolizer()
{
- ArrowLength = 100, RepeatInterval = 500
+ ArrowLength = 100,
+ RepeatInterval = 500
});
var m = new SharpMap.Map(new System.Drawing.Size(1440, 1080)) { BackColor = System.Drawing.Color.Cornsilk };
m.Layers.Add(l);
@@ -210,23 +206,24 @@ public void TestWarpedLineSymbolizer()
var p = new SharpMap.Data.Providers.ShapeFile(@"d:\\daten\\GeoFabrik\\Aurich\\roads.shp", false);
var l = new SharpMap.Layers.VectorLayer("roads", p);
-
+
var cls = new SharpMap.Rendering.Symbolizer.CachedLineSymbolizer();
cls.LineSymbolizeHandlers.Add(new SharpMap.Rendering.Symbolizer.PlainLineSymbolizeHandler
- {Line = new System.Drawing.Pen(System.Drawing.Color.Gold, 2)});
+ { Line = new System.Drawing.Pen(System.Drawing.Color.Gold, 2) });
var wls = new SharpMap.Rendering.Symbolizer.WarpedLineSymbolizeHander
- {
- Pattern =
+ {
+ Pattern =
SharpMap.Rendering.Symbolizer.WarpedLineSymbolizer.
GetGreaterSeries(3, 3),
- Line = new System.Drawing.Pen(System.Drawing.Color.Firebrick, 1)
- , Interval = 20
- };
+ Line = new System.Drawing.Pen(System.Drawing.Color.Firebrick, 1)
+ ,
+ Interval = 20
+ };
cls.LineSymbolizeHandlers.Add(wls);
l.Style.LineSymbolizer = cls;
- var m = new SharpMap.Map(new System.Drawing.Size(720, 540)) {BackColor = System.Drawing.Color.Cornsilk};
+ var m = new SharpMap.Map(new System.Drawing.Size(720, 540)) { BackColor = System.Drawing.Color.Cornsilk };
m.Layers.Add(l);
m.ZoomToExtents();
@@ -240,14 +237,15 @@ public void TestWarpedLineSymbolizer()
bmp.Save("AurichRoads1.bmp");
cls.LineSymbolizeHandlers[1] = new SharpMap.Rendering.Symbolizer.WarpedLineSymbolizeHander
- {
- Pattern =
+ {
+ Pattern =
SharpMap.Rendering.Symbolizer.WarpedLineSymbolizer.
GetTriangle(4, 0),
- Line = new System.Drawing.Pen(System.Drawing.Color.Firebrick, 1),
- Fill = new System.Drawing.SolidBrush(System.Drawing.Color.Firebrick)
- ,Interval = 10
- };
+ Line = new System.Drawing.Pen(System.Drawing.Color.Firebrick, 1),
+ Fill = new System.Drawing.SolidBrush(System.Drawing.Color.Firebrick)
+ ,
+ Interval = 10
+ };
sw.Reset(); sw.Start();
bmp = m.GetMap();
sw.Stop();
@@ -304,12 +302,12 @@ public void TestWarpedLineSymbolizer()
//cls.LineSymbolizeHandlers[0] = cls.LineSymbolizeHandlers[1];
cls.LineSymbolizeHandlers[1] = new SharpMap.Rendering.Symbolizer.WarpedLineSymbolizeHander
- {
- Pattern =
+ {
+ Pattern =
SharpMap.Rendering.Symbolizer.WarpedLineSymbolizer.GetZigZag(4, 4),
- Line = new System.Drawing.Pen(System.Drawing.Color.Firebrick, 1),
- //Fill = new System.Drawing.SolidBrush(System.Drawing.Color.Firebrick)
- };
+ Line = new System.Drawing.Pen(System.Drawing.Color.Firebrick, 1),
+ //Fill = new System.Drawing.SolidBrush(System.Drawing.Color.Firebrick)
+ };
sw.Reset(); sw.Start();
bmp = m.GetMap();
sw.Stop();
@@ -373,7 +371,7 @@ public SharpMap.Styles.IStyle GetStyle(SharpMap.Data.FeatureDataRow attribute)
Line = new System.Drawing.Pen(System.Drawing.Color.Firebrick, 1)
,
Interval = 20
-
+
};
cls.LineSymbolizeHandlers.Add(wls);
cls.ImmediateMode = true;
@@ -392,18 +390,18 @@ public void TestTransformation()
var m = new SharpMap.Map(new System.Drawing.Size(640, 320));
var l = new SharpMap.Layers.Symbolizer.PuntalVectorLayer("l",
- new SharpMap.Data.Providers.GeometryProvider(m.Factory.CreatePoint(new GeoAPI.Geometries.Coordinate(0, 51.478885))),
+ new SharpMap.Data.Providers.GeometryProvider(m.Factory.CreatePoint(new NetTopologySuite.Geometries.Coordinate(0, 51.478885))),
SharpMap.Rendering.Symbolizer.PathPointSymbolizer.CreateCircle(System.Drawing.Pens.Aquamarine, System.Drawing.Brushes.BurlyWood, 24));
var ctFact = new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory();
l.CoordinateTransformation = ctFact.CreateFromCoordinateSystems(ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84, ProjNet.CoordinateSystems.ProjectedCoordinateSystem.WebMercator);
l.ReverseCoordinateTransformation = ctFact.CreateFromCoordinateSystems(ProjNet.CoordinateSystems.ProjectedCoordinateSystem.WebMercator, ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84);
- m.Layers.Add(new SharpMap.Layers.TileLayer(BruTile.Predefined.KnownTileSources.Create(),"b"));
+ m.Layers.Add(new SharpMap.Layers.TileLayer(BruTile.Predefined.KnownTileSources.Create(), "b"));
m.Layers.Add(l);
- var e = new GeoAPI.Geometries.Envelope(-0.02, 0.02, 51.478885 - 0.01, 51.478885 + 0.01);
- e = GeoAPI.CoordinateSystems.Transformations.GeometryTransform.TransformBox(e,
+ var e = new NetTopologySuite.Geometries.Envelope(-0.02, 0.02, 51.478885 - 0.01, 51.478885 + 0.01);
+ e = NetTopologySuite.CoordinateSystems.Transformations.GeometryTransform.TransformBox(e,
l.CoordinateTransformation.MathTransform);
m.ZoomToBox(e);
m.GetMap().Save("Greenwich.png", System.Drawing.Imaging.ImageFormat.Png);
diff --git a/Examples/ExampleCodeSnippets/NtsTests.cs b/Examples/ExampleCodeSnippets/NtsTests.cs
index 1d0521fc..ac8bd382 100644
--- a/Examples/ExampleCodeSnippets/NtsTests.cs
+++ b/Examples/ExampleCodeSnippets/NtsTests.cs
@@ -1,18 +1,11 @@
-using System.Data.OleDb;
-using SharpMap.Data.Providers;
+using SharpMap.Data.Providers;
+using System.Data.OleDb;
namespace ExampleCodeSnippets
{
[NUnit.Framework.TestFixture]
public class NtsTests
{
- [NUnit.Framework.OneTimeSetUp]
- public void OneTimeSetUp()
- {
- GeoAPI.GeometryServiceProvider.Instance =
- NetTopologySuite.NtsGeometryServices.Instance;
- }
-
[NUnit.Framework.Test]
public void TestDiscussionNtsAndBaffeled()
{
@@ -22,15 +15,15 @@ public void TestDiscussionNtsAndBaffeled()
429023.1119599645 360406.75878171506, 429004.52340613387 360451.71714446822,
429004.52340613387 360451.71714446822, 428999.76819468878 360451.93329044303))");
- var points = new System.Collections.Generic.List(new []
+ var points = new System.Collections.Generic.List(new[]
{
- reader.Factory.CreatePoint(new GeoAPI.Geometries.Coordinate(429012.5, 360443.18)),
- reader.Factory.CreatePoint(new GeoAPI.Geometries.Coordinate(429001.59, 360446.98)),
- reader.Factory.CreatePoint(new GeoAPI.Geometries.Coordinate(429003.31, 360425.45)),
- reader.Factory.CreatePoint(new GeoAPI.Geometries.Coordinate(429016.9, 360413.04))
+ reader.Factory.CreatePoint(new NetTopologySuite.Geometries.Coordinate(429012.5, 360443.18)),
+ reader.Factory.CreatePoint(new NetTopologySuite.Geometries.Coordinate(429001.59, 360446.98)),
+ reader.Factory.CreatePoint(new NetTopologySuite.Geometries.Coordinate(429003.31, 360425.45)),
+ reader.Factory.CreatePoint(new NetTopologySuite.Geometries.Coordinate(429016.9, 360413.04))
});
- var inside = new System.Collections.Generic.List(new[] {false, true, true, true});
+ var inside = new System.Collections.Generic.List(new[] { false, true, true, true });
for (var i = 0; i < points.Count; i++)
{
@@ -55,7 +48,7 @@ public void TestDiscussionNtsAndBaffeledOleDb()
var table = WriteCsv();
- var p = new DbPoint(OleDbFactory.Instance,
+ var p = new DbPoint(OleDbFactory.Instance,
"Provider=" + Properties.Settings.Default.OleDbProvider + ";Data Source=\"" + System.IO.Path.GetTempPath() + "\";" +
"Extended Properties=\"text;HDR=Yes;FMT=Delimited\"", table, "ID", "X", "Y");
@@ -83,7 +76,7 @@ public void TestDiscussionNtsAndBaffeledOleDb()
var ext = p.GetExtents();
var oids = p.GetObjectIDsInView(ext);
NUnit.Framework.Assert.AreEqual(4, oids.Count);
-
+
System.IO.File.Delete(System.IO.Path.Combine(System.IO.Path.GetTempPath(), table));
}
@@ -103,10 +96,10 @@ private static string WriteCsv()
using (var sr = new System.IO.StreamWriter(System.IO.File.OpenWrite(filename)))
{
sr.WriteLine("ID;Name;X;Y");
- sr.WriteLine("1;One;{0};{1}", 429012.5,360443.18);
- sr.WriteLine("2;Two;{0};{1}",429001.59,360446.98);
- sr.WriteLine("3;Three;{0};{1}",429003.31,360425.45);
- sr.WriteLine("4;Four;{0};{1}",429016.9,360413.04);
+ sr.WriteLine("1;One;{0};{1}", 429012.5, 360443.18);
+ sr.WriteLine("2;Two;{0};{1}", 429001.59, 360446.98);
+ sr.WriteLine("3;Three;{0};{1}", 429003.31, 360425.45);
+ sr.WriteLine("4;Four;{0};{1}", 429016.9, 360413.04);
}
return System.IO.Path.GetFileName(filename);
diff --git a/Examples/ExampleCodeSnippets/PointSymbolizerTest.cs b/Examples/ExampleCodeSnippets/PointSymbolizerTest.cs
index 9a6d5eef..05035306 100644
--- a/Examples/ExampleCodeSnippets/PointSymbolizerTest.cs
+++ b/Examples/ExampleCodeSnippets/PointSymbolizerTest.cs
@@ -1,3 +1,5 @@
+using System.IO;
+
namespace ExampleCodeSnippets
{
///
@@ -12,16 +14,16 @@ public void TestCharacterPointSymbolizer()
CreatingData.GetRandomOrdinates(50, -180, 180), CreatingData.GetRandomOrdinates(50, -90, 90), null);
var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt);
var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider);
- var cps = new SharpMap.Rendering.Symbolizer.CharacterPointSymbolizer
- {
- Halo = 1,
- HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Wheat),
- //Font = new System.Drawing.Font("Arial", 12),
- CharacterIndex = 0xcc,
- };
+ var cps = new SharpMap.Rendering.Symbolizer.CharacterPointSymbolizer
+ {
+ Halo = 1,
+ HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Wheat),
+ //Font = new System.Drawing.Font("Arial", 12),
+ CharacterIndex = 0xcc,
+ };
layer.Style.PointSymbolizer = cps;
var map = new SharpMap.Map(new System.Drawing.Size(720, 360));
-
+
map.Layers.Add(layer);
map.ZoomToExtents();
map.GetMap().Save("CharacterPointSymbolizer1.bmp");
@@ -63,7 +65,7 @@ public void TestPathPointSymbolizer()
map.GetMap().Save("PathPointSymbolizer3.bmp");
var gpTriangle1 = new System.Drawing.Drawing2D.GraphicsPath();
- gpTriangle1.AddPolygon(new [] { new System.Drawing.Point(0, 0), new System.Drawing.Point(5, 10), new System.Drawing.Point(10, 0), new System.Drawing.Point(0, 0), });
+ gpTriangle1.AddPolygon(new[] { new System.Drawing.Point(0, 0), new System.Drawing.Point(5, 10), new System.Drawing.Point(10, 0), new System.Drawing.Point(0, 0), });
var gpTriangle2 = new System.Drawing.Drawing2D.GraphicsPath();
gpTriangle2.AddPolygon(new[] { new System.Drawing.Point(0, 0), new System.Drawing.Point(-5, -10), new System.Drawing.Point(-10, 0), new System.Drawing.Point(0, 0), });
pps = new
@@ -90,7 +92,8 @@ public void TestPathPointSymbolizer()
System.Drawing.Color.Red)
}
- }){ Rotation = 45 };
+ })
+ { Rotation = 45 };
layer.Style.PointSymbolizer = pps;
map.GetMap().Save("PathPointSymbolizer4.bmp");
@@ -106,8 +109,12 @@ public void TestRasterPointSymbolizer()
CreatingData.GetRandomOrdinates(50, -180, 180), CreatingData.GetRandomOrdinates(50, -90, 90), null);
var geometryFeatureProvider = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt);
var layer = new SharpMap.Layers.VectorLayer("randompoints", geometryFeatureProvider);
+ var stylePath = Path.GetFullPath(
+ Path.Combine(
+ Path.GetDirectoryName(GetType().Assembly.Location),
+ "..\\..\\..\\..\\DemoWinForm\\Resources\\women.png"));
var rps =
- new SharpMap.Rendering.Symbolizer.RasterPointSymbolizer {Symbol = new System.Drawing.Bitmap("women.png")};
+ new SharpMap.Rendering.Symbolizer.RasterPointSymbolizer { Symbol = new System.Drawing.Bitmap(stylePath) };
layer.Style.PointSymbolizer = rps;
var map = new SharpMap.Map(new System.Drawing.Size(720, 360));
@@ -120,14 +127,14 @@ public void TestRasterPointSymbolizer()
rps.Rotation = 0;
var cps = new SharpMap.Rendering.Symbolizer.CharacterPointSymbolizer
- {
- Halo = 1,
- HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke),
- Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black),
- Font = new System.Drawing.Font("Arial", 12),
- Text = "Anne",
- Offset = new System.Drawing.PointF(0, rps.Size.Height*0.5f)
-
+ {
+ Halo = 1,
+ HaloBrush = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke),
+ Foreground = new System.Drawing.SolidBrush(System.Drawing.Color.Black),
+ Font = new System.Drawing.Font("Arial", 12),
+ Text = "Anne",
+ Offset = new System.Drawing.PointF(0, rps.Size.Height * 0.5f)
+
};
var lps = new SharpMap.Rendering.Symbolizer.ListPointSymbolizer { rps, cps };
@@ -171,4 +178,4 @@ public void TestListPointSymbolizer()
}
//D:\Development\Codeplex\_SharpMap\Repository\Trunk\DemoWinForm\Resources
//D:\Development\Codeplex\_SharpMap\Repository\Trunk\DemoWinForm\Resources\Women.png
-//
\ No newline at end of file
+//
diff --git a/Examples/ExampleCodeSnippets/PolygonSymbolizerTest.cs b/Examples/ExampleCodeSnippets/PolygonSymbolizerTest.cs
index a186d33a..4d457d60 100644
--- a/Examples/ExampleCodeSnippets/PolygonSymbolizerTest.cs
+++ b/Examples/ExampleCodeSnippets/PolygonSymbolizerTest.cs
@@ -1,3 +1,6 @@
+using SharpMap.CoordinateSystems;
+using System.IO;
+
namespace ExampleCodeSnippets
{
[NUnit.Framework.TestFixture]
@@ -12,10 +15,10 @@ public override void Begin(System.Drawing.Graphics g, SharpMap.MapViewport map,
base.Begin(g, map, aproximateNumberOfGeometries);
_oldRenderOrigin = g.RenderingOrigin;
}
- protected override void OnRenderInternal(SharpMap.MapViewport map, GeoAPI.Geometries.IPolygon polygon, System.Drawing.Graphics g)
+ protected override void OnRenderInternal(SharpMap.MapViewport map, NetTopologySuite.Geometries.Polygon polygon, System.Drawing.Graphics g)
{
var pt = polygon.Centroid;
- g.RenderingOrigin =
+ g.RenderingOrigin =
System.Drawing.Point.Truncate(map.WorldToImage(pt.Coordinate));
base.OnRenderInternal(map, polygon, g);
}
@@ -28,23 +31,36 @@ public override void End(System.Drawing.Graphics g, SharpMap.MapViewport map)
[NUnit.Framework.OneTimeSetUp]
public void OneTimeSetUp()
- { }
+ {
+ var gss = NetTopologySuite.NtsGeometryServices.Instance;
+ var css = new CoordinateSystemServices(
+ new ProjNet.CoordinateSystems.CoordinateSystemFactory(),
+ new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory(),
+ SharpMap.Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());
+ SharpMap.Session.Instance
+ .SetGeometryServices(gss)
+ .SetCoordinateSystemServices(css)
+ .SetCoordinateSystemRepository(css);
+ }
[NUnit.Framework.Test]
public void TestPlainPolygonSymbolizer()
{
- var provider = new SharpMap.Data.Providers.ShapeFile(
- "..\\..\\..\\WinFormSamples\\GeoData\\World\\countries.shp", true);
+ var shapePath = Path.GetFullPath(
+ Path.Combine(
+ Path.GetDirectoryName(GetType().Assembly.Location),
+ "..\\..\\..\\..\\WinFormSamples\\GeoData\\World\\countries.shp"));
+ var provider = new SharpMap.Data.Providers.ShapeFile(shapePath, true);
var l = new SharpMap.Layers.Symbolizer.PolygonalVectorLayer("Countries", provider);
l.Symbolizer = new ModifiedBasicPolygonSymbolizer
- {
- Fill = new System.Drawing.Drawing2D.HatchBrush(
- System.Drawing.Drawing2D.HatchStyle.WideDownwardDiagonal,
+ {
+ Fill = new System.Drawing.Drawing2D.HatchBrush(
+ System.Drawing.Drawing2D.HatchStyle.WideDownwardDiagonal,
System.Drawing.Color.Red /*,
System.Drawing.Color.LightPink*/),
- UseClipping = false,
- //Outline = System.Drawing.Pens.AliceBlue
- };
+ UseClipping = false,
+ //Outline = System.Drawing.Pens.AliceBlue
+ };
var m = new SharpMap.Map(new System.Drawing.Size(1440, 1080)) { BackColor = System.Drawing.Color.Cornsilk };
m.Layers.Add(l);
@@ -53,7 +69,7 @@ public void TestPlainPolygonSymbolizer()
var sw = new System.Diagnostics.Stopwatch();
var img = m.GetMap();
-
+
sw.Start();
img = m.GetMap();
img.Save("PolygonSymbolizer-1.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
@@ -75,7 +91,7 @@ public void TestPlainPolygonSymbolizer()
img.Save("PolygonSymbolizer-2.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
sw.Stop();
System.Console.WriteLine(string.Format("Rendering new method:{0}ms", sw.ElapsedMilliseconds));
-
+
}
}
diff --git a/Examples/ExampleCodeSnippets/ProjectionExamples.cs b/Examples/ExampleCodeSnippets/ProjectionExamples.cs
index 1ceacf0c..71e137ee 100644
--- a/Examples/ExampleCodeSnippets/ProjectionExamples.cs
+++ b/Examples/ExampleCodeSnippets/ProjectionExamples.cs
@@ -1,8 +1,11 @@
//#define alglib
+using NetTopologySuite;
+using ProjNet.CoordinateSystems;
+
namespace ExampleCodeSnippets
{
-
+
[NUnit.Framework.TestFixture]
public class ProjectionExamples
{
@@ -33,7 +36,7 @@ public void TestConversionProjNet()
/// X' = _a*X + _b*Y + _c
/// Y' = _d*X + _e*Y + _f
///
- public class AffineCoordinateTransformation2D : ProjNet.CoordinateSystems.Transformations.MathTransform, GeoAPI.CoordinateSystems.Transformations.ICoordinateTransformation
+ public class AffineCoordinateTransformation2D : ProjNet.CoordinateSystems.Transformations.MathTransform, NetTopologySuite.CoordinateSystems.Transformations.ICoordinateTransformation
{
private readonly double _a, _b, _c, _d, _e, _f;
private readonly double _ainv, _binv, _cinv, _dinv, _einv, _finv;
@@ -110,7 +113,7 @@ public AffineCoordinateTransformation2D(double[,] matrix)
#region Overrides of MathTransform
- public override GeoAPI.CoordinateSystems.Transformations.IMathTransform Inverse()
+ public override NetTopologySuite.CoordinateSystems.Transformations.MathTransform Inverse()
{
//#warning(System.Drawing.Drawing2D.Matrix uses single precision floating point numbers. This involves reduction of precision, not at all accurate!)
@@ -201,7 +204,7 @@ public long AuthorityCode
get { throw new System.NotImplementedException(); }
}
- public GeoAPI.CoordinateSystems.Transformations.IMathTransform MathTransform
+ public NetTopologySuite.CoordinateSystems.Transformations.MathTransform MathTransform
{
get { return this; }
}
@@ -216,19 +219,19 @@ public string Remarks
get { return ""; }
}
- public GeoAPI.CoordinateSystems.ICoordinateSystem SourceCS
+ public NetTopologySuite.CoordinateSystems.ICoordinateSystem SourceCS
{
get { return null; }
}
- public GeoAPI.CoordinateSystems.ICoordinateSystem TargetCS
+ public NetTopologySuite.CoordinateSystems.ICoordinateSystem TargetCS
{
get { return null; }
}
- public GeoAPI.CoordinateSystems.Transformations.TransformType TransformType
+ public NetTopologySuite.CoordinateSystems.Transformations.TransformType TransformType
{
- get { return GeoAPI.CoordinateSystems.Transformations.TransformType.Transformation; }
+ get { return NetTopologySuite.CoordinateSystems.Transformations.TransformType.Transformation; }
}
#endregion
@@ -262,7 +265,7 @@ private static SharpMap.Data.FeatureDataTable TransformedFeatureDataTable(
for (System.Int32 i = 0; i < fdtClone.Columns.Count; i++)
newRow[i] = row[i];
- GeoAPI.Geometries.IPoint smpt = (GeoAPI.Geometries.IPoint)row.Geometry;
+ NetTopologySuite.Geometries.Point smpt = (NetTopologySuite.Geometries.Point)row.Geometry;
System.Drawing.PointF[] pts = new System.Drawing.PointF[]
{ new System.Drawing.PointF((float)smpt.X, (float)smpt.Y) };
matrix.TransformPoints(pts);
@@ -369,8 +372,8 @@ public void TestAffineTransform2D()
//Get affine transformation calculates mean points to improve accuaracy
//Unfortunately the result is not very good, so, since I know better I manually set these
//mean points.
- lst.SetMeanPoints(new GeoAPI.Geometries.IPoint(0, 0),
- new GeoAPI.Geometries.IPoint(matrix.OffsetX, matrix.OffsetY));
+ lst.SetMeanPoints(new NetTopologySuite.Geometries.Point(0, 0),
+ new NetTopologySuite.Geometries.Point(matrix.OffsetX, matrix.OffsetY));
*/
//Create Affine
@@ -383,13 +386,13 @@ public void TestAffineTransform2D()
map.Layers.Add(new SharpMap.Layers.VectorLayer("L1",
new SharpMap.Data.Providers.GeometryFeatureProvider(fdt1)));
((SharpMap.Layers.VectorLayer) map.Layers[0]).Style.Symbol =
- new System.Drawing.Bitmap(@"..\..\..\DemoWinForm\Resources\flag.png");
+ new System.Drawing.Bitmap("Examples\\DemoWinForm\\Resources\\flag.png");
//Add transformed layer
map.Layers.Add(new SharpMap.Layers.VectorLayer("L2",
new SharpMap.Data.Providers.GeometryFeatureProvider(fdt2)));
((SharpMap.Layers.VectorLayer) map.Layers[1]).Style.Symbol =
- new System.Drawing.Bitmap(@"..\..\..\DemoWinForm\Resources\women.png");
+ new System.Drawing.Bitmap("Examples\DemoWinForm\\Resources\\women.png");
//Render map
map.ZoomToExtents();
@@ -412,7 +415,7 @@ public void TestAffineTransform2D()
}
}
- #endif
+#endif
[NUnit.Framework.Test]
public void TestGdalRasterLayer()
@@ -428,7 +431,7 @@ public void TestGdalRasterLayer()
var p1 = ecw1.GetProjection();
ecw2.ReprojectToCoordinateSystem(p1);
- var m = new SharpMap.Map(new System.Drawing.Size( 1024, 768));
+ var m = new SharpMap.Map(new System.Drawing.Size(1024, 768));
m.Layers.Add(ecw1);
m.Layers.Add(ecw2);
@@ -439,34 +442,34 @@ public void TestGdalRasterLayer()
}
}
-public static void ReprojectFeatureDataSet(SharpMap.Data.FeatureDataSet fds,
- GeoAPI.CoordinateSystems.ICoordinateSystem target)
-{
- for (var i = 0; i < fds.Tables.Count; i ++)
- {
- var fdt = fds.Tables[i];
- ReprojectFeatureDataTable(fdt, target);
- }
+ public static void ReprojectFeatureDataSet(SharpMap.Data.FeatureDataSet fds,
+ CoordinateSystem target)
+ {
+ for (var i = 0; i < fds.Tables.Count; i++)
+ {
+ var fdt = fds.Tables[i];
+ ReprojectFeatureDataTable(fdt, target);
+ }
-}
+ }
-public static void ReprojectFeatureDataTable(SharpMap.Data.FeatureDataTable fdt,
- GeoAPI.CoordinateSystems.ICoordinateSystem target)
-{
- var source = SharpMap.CoordinateSystems.CoordinateSystemExtensions.GetCoordinateSystem(fdt[0].Geometry);
+ public static void ReprojectFeatureDataTable(SharpMap.Data.FeatureDataTable fdt,
+ CoordinateSystem target)
+ {
+ var source = SharpMap.CoordinateSystems.CoordinateSystemExtensions.GetCoordinateSystem(fdt[0].Geometry);
- var ctFactory = new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory();
- var ct = ctFactory.CreateFromCoordinateSystems(source, target);
-
- var geomFactory = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory((int)target.AuthorityCode);
+ var ctFactory = new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory();
+ var ct = ctFactory.CreateFromCoordinateSystems(source, target);
- for (var i = 0; i < fdt.Rows.Count; i++)
- {
- var fdr = fdt[i];
- fdr.Geometry =
- GeoAPI.CoordinateSystems.Transformations.GeometryTransform.TransformGeometry(fdr.Geometry,
- ct.MathTransform, geomFactory);
- }
-}
+ var geomFactory = NtsGeometryServices.Instance.CreateGeometryFactory((int)target.AuthorityCode);
+
+ for (var i = 0; i < fdt.Rows.Count; i++)
+ {
+ var fdr = fdt[i];
+ fdr.Geometry =
+ NetTopologySuite.CoordinateSystems.Transformations.GeometryTransform.TransformGeometry(fdr.Geometry,
+ ct.MathTransform, geomFactory);
+ }
+ }
}
}
diff --git a/Examples/ExampleCodeSnippets/ReadXmlExample.cs b/Examples/ExampleCodeSnippets/ReadXmlExample.cs
index 9357326e..34397b18 100644
--- a/Examples/ExampleCodeSnippets/ReadXmlExample.cs
+++ b/Examples/ExampleCodeSnippets/ReadXmlExample.cs
@@ -3,13 +3,13 @@
public class ReadXmlExample
{
///
- /// Creates an enumeration of s from an xml string
+ /// Creates an enumeration of s from an xml string
///
///
/// the xml string
/// Coordinates
- public static System.Collections.Generic.IEnumerable PointsFromXml(
- GeoAPI.Geometries.IGeometryFactory factory,
+ public static System.Collections.Generic.IEnumerable PointsFromXml(
+ NetTopologySuite.Geometries.GeometryFactory factory,
System.IO.Stream xml)
{
foreach (var coordinate in CoordinatesFromXml(xml))
@@ -17,11 +17,11 @@ public class ReadXmlExample
}
///
- /// Creates an enumeration of s from an xml string
+ /// Creates an enumeration of s from an xml string
///
/// the xml string
/// Coordinates
- public static System.Collections.Generic.IEnumerable CoordinatesFromXml(System.IO.Stream xml)
+ public static System.Collections.Generic.IEnumerable CoordinatesFromXml(System.IO.Stream xml)
{
var reader = System.Xml.XmlReader.Create(xml);
var doc = System.Xml.Linq.XDocument.Load(reader);
@@ -47,11 +47,11 @@ public class ReadXmlExample
var y = double.Parse(element.Value,
System.Globalization.NumberFormatInfo.InvariantInfo);
- yield return new GeoAPI.Geometries.Coordinate(x, y);
+ yield return new NetTopologySuite.Geometries.Coordinate(x, y);
}
}
}
-
+
[NUnit.Framework.Test]
public void TestXml1()
{
@@ -65,7 +65,7 @@ public void TestXml1()
";
var xmlFileName = System.IO.Path.ChangeExtension(System.IO.Path.GetTempFileName(), "xml");
-
+
using (var sw = new System.IO.StreamWriter(System.IO.File.OpenWrite(xmlFileName)))
sw.Write(xml);
diff --git a/Examples/ExampleCodeSnippets/Theming.cs b/Examples/ExampleCodeSnippets/Theming.cs
index ce23d3fa..9f9ccc3f 100644
--- a/Examples/ExampleCodeSnippets/Theming.cs
+++ b/Examples/ExampleCodeSnippets/Theming.cs
@@ -1,5 +1,6 @@
namespace ExampleCodeSnippets
{
+ using System.IO;
using cd = CreatingData;
public class SymbolRotationTheming
@@ -19,7 +20,7 @@ public class SymbolRotationTheming
///
/// Name of the column, which contains the rotation angle in degrees [0°, 360°]
public SymbolRotationTheming(System.String styleRotationColumn)
- :this(styleRotationColumn, new SharpMap.Styles.VectorStyle())
+ : this(styleRotationColumn, new SharpMap.Styles.VectorStyle())
{
}
@@ -38,19 +39,19 @@ private static SharpMap.Styles.VectorStyle CloneStyle(SharpMap.Styles.VectorStyl
{
SharpMap.Styles.VectorStyle style =
new SharpMap.Styles.VectorStyle
- {
- Enabled = styleToClone.Enabled,
- MinVisible = styleToClone.MinVisible,
- MaxVisible = styleToClone.MaxVisible,
- Line = styleToClone.Line.Clone() as System.Drawing.Pen,
- Fill = styleToClone.Fill.Clone() as System.Drawing.Brush,
- Outline = styleToClone.Outline.Clone() as System.Drawing.Pen,
- EnableOutline = styleToClone.EnableOutline,
- Symbol = styleToClone.Symbol.Clone() as System.Drawing.Bitmap,
- SymbolOffset = styleToClone.SymbolOffset,
- SymbolRotation = styleToClone.SymbolRotation,
- SymbolScale = styleToClone.SymbolScale
- };
+ {
+ Enabled = styleToClone.Enabled,
+ MinVisible = styleToClone.MinVisible,
+ MaxVisible = styleToClone.MaxVisible,
+ Line = styleToClone.Line.Clone() as System.Drawing.Pen,
+ Fill = styleToClone.Fill.Clone() as System.Drawing.Brush,
+ Outline = styleToClone.Outline.Clone() as System.Drawing.Pen,
+ EnableOutline = styleToClone.EnableOutline,
+ Symbol = styleToClone.Symbol.Clone() as System.Drawing.Bitmap,
+ SymbolOffset = styleToClone.SymbolOffset,
+ SymbolRotation = styleToClone.SymbolRotation,
+ SymbolScale = styleToClone.SymbolScale
+ };
return style;
}
@@ -132,7 +133,7 @@ public SharpMap.Styles.VectorStyle GetRotatedSymol(SharpMap.Data.FeatureDataRow
if (!row.IsNull(SymbolColumn))
{
dataStyle.Symbol = new System.Drawing.Bitmap(
- new System.IO.MemoryStream((byte[]) row[SymbolColumn]));
+ new System.IO.MemoryStream((byte[])row[SymbolColumn]));
}
return dataStyle;
}
@@ -150,37 +151,41 @@ static System.Double[] GetRandomOrdinates(System.Int32 size, System.Double min,
{
System.Double[] arr = new System.Double[size];
System.Double width = max - min;
- for(System.Int32 i = 0; i < size; i++)
+ for (System.Int32 i = 0; i < size; i++)
{
System.Double randomValue = _randomNumberGenerator.NextDouble();
- arr[i] = min + randomValue*width;
+ arr[i] = min + randomValue * width;
}
return arr;
}
-
+
[NUnit.Framework.Test]
public void TestSymbolRotationTheming()
{
//Create a map
- SharpMap.Map map = new SharpMap.Map(new System.Drawing.Size(720,360));
-
+ SharpMap.Map map = new SharpMap.Map(new System.Drawing.Size(720, 360));
+
//Create some random sample data
SharpMap.Data.FeatureDataTable fdt =
cd.CreatePointFeatureDataTableFromArrays(cd.GetRandomOrdinates(80, -180, 180),
cd.GetRandomOrdinates(80, -90, 90), null);
//Add rotation column and fill with random rotation values
- fdt.Columns.Add("Rotation", typeof (System.Double));
+ fdt.Columns.Add("Rotation", typeof(System.Double));
foreach (SharpMap.Data.FeatureDataRow row in fdt.Rows)
- row["Rotation"] = _randomNumberGenerator.NextDouble()*360d;
+ row["Rotation"] = _randomNumberGenerator.NextDouble() * 360d;
//Create layer and datasource
SharpMap.Layers.VectorLayer vl = new SharpMap.Layers.VectorLayer("Points", new SharpMap.Data.Providers.GeometryFeatureProvider(fdt));
-
+
//Create default style
SharpMap.Styles.VectorStyle defaultStyle = new SharpMap.Styles.VectorStyle();
- defaultStyle.Symbol = new System.Drawing.Bitmap(@"..\..\..\DemoWinForm\Resources\flag.png");
+ var stylePath = Path.GetFullPath(
+ Path.Combine(
+ Path.GetDirectoryName(GetType().Assembly.Location),
+ "..\\..\\..\\..\\DemoWinForm\\Resources\\flag.png"));
+ defaultStyle.Symbol = new System.Drawing.Bitmap(stylePath);
defaultStyle.SymbolScale = 0.5f;
//Create theming class and apply to layer
@@ -232,7 +237,11 @@ public void TestSymbolSelectionTheming()
//Create default style
SharpMap.Styles.VectorStyle defaultStyle = new SharpMap.Styles.VectorStyle();
- defaultStyle.Symbol = new System.Drawing.Bitmap(@"..\..\..\DemoWinForm\Resources\flag.png");
+ var resPath = Path.GetFullPath(
+ Path.Combine(
+ Path.GetDirectoryName(GetType().Assembly.Location),
+ "..\\..\\..\\..\\DemoWinForm\\Resources\\flag.png"));
+ defaultStyle.Symbol = new System.Drawing.Bitmap(resPath);
defaultStyle.SymbolScale = 0.5f;
//Create theming class and apply to layer
@@ -247,8 +256,8 @@ public void TestSymbolSelectionTheming()
private byte[] RandomSymbol(int number)
{
- number = number%360;
- string text ="";
+ number = number % 360;
+ string text = "";
System.Drawing.Brush brush = null;
if (number < 60)
return null;
@@ -257,7 +266,7 @@ private byte[] RandomSymbol(int number)
text = "<120";
brush = System.Drawing.Brushes.DarkGreen;
}
- else if(number < 240)
+ else if (number < 240)
{
text = number.ToString();
brush = System.Drawing.Brushes.Orange;
@@ -273,7 +282,7 @@ private byte[] RandomSymbol(int number)
System.Drawing.RectangleF size = new System.Drawing.RectangleF(0f, 0f, 120f, 60f);
g.FillRectangle(System.Drawing.Brushes.White, size);
var sf = new System.Drawing.StringFormat(System.Drawing.StringFormatFlags.NoWrap)
- {Alignment = System.Drawing.StringAlignment.Center};
+ { Alignment = System.Drawing.StringAlignment.Center };
g.DrawString(text, new System.Drawing.Font("Arial", 24), brush, size, sf);
g.Flush();
@@ -296,11 +305,11 @@ public void DoTest()
new SharpMap.Data.Providers.GeometryFeatureProvider(fds.Tables[0]);
System.Data.DataTable dt = new System.Data.DataTable("external");
- dt.Columns.Add("city", typeof (string));
- dt.Columns.Add("males", typeof (int));
- dt.Columns.Add("females", typeof (int));
+ dt.Columns.Add("city", typeof(string));
+ dt.Columns.Add("males", typeof(int));
+ dt.Columns.Add("females", typeof(int));
}
}
-}
\ No newline at end of file
+}
diff --git a/Examples/ExampleCodeSnippets/app.config b/Examples/ExampleCodeSnippets/app.config
index 4913f2e5..6fa6f181 100644
--- a/Examples/ExampleCodeSnippets/app.config
+++ b/Examples/ExampleCodeSnippets/app.config
@@ -1,15 +1,23 @@

-
-
-
-
-
-
-
-
- Microsoft.ACE.OLEDB.15.0
-
-
-
+
+
+
+
+
+
+
+
+ Microsoft.ACE.OLEDB.12.0
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Examples/ExampleCodeSnipplets.VB/CustomThemeExample.vb b/Examples/ExampleCodeSnipplets.VB/CustomThemeExample.vb
index a209e1c2..bc2b00af 100644
--- a/Examples/ExampleCodeSnipplets.VB/CustomThemeExample.vb
+++ b/Examples/ExampleCodeSnipplets.VB/CustomThemeExample.vb
@@ -11,7 +11,7 @@
Protected Overrides Sub Finalize()
- For Each kvp as KeyValuePair(Of String, SharpMap.Styles.IStyle) in _styles
+ For Each kvp as KeyValuePair(Of String, SharpMap.Styles.IStyle) in _styles
kvp.Value.Dispose()
Next
@@ -52,23 +52,23 @@ End Class
public Class UniqueValuesThemeTest
- Private delObjektLabelBez As SharpMap.Layers.LabelLayer.GetLabelMethod
- Private delObjektLabelPos As SharpMap.Layers.LabelLayer.GetLocationMethod
- Private delObjektLabelStyle As SharpMap.Rendering.Thematics.CustomTheme.GetStyleMethod
- Private delObjektStyle As SharpMap.Rendering.Thematics.CustomTheme.GetStyleMethod
- '
+ Private delObjektLabelBez As SharpMap.Layers.LabelLayer.GetLabelMethod
+ Private delObjektLabelPos As SharpMap.Layers.LabelLayer.GetLocationMethod
+ Private delObjektLabelStyle As SharpMap.Rendering.Thematics.CustomTheme.GetStyleMethod
+ Private delObjektStyle As SharpMap.Rendering.Thematics.CustomTheme.GetStyleMethod
+ '
Private _map As SharpMap.Map
-
+
public class OtherClassItem
- public Property Name () As String
+ public Property Name() As String
Public Property Datasource() As string
Public Property Table() As string
Public Property Field() As string
End Class
- public class OtherClass
+ public class OtherClass
Inherits System.Collections.Generic.List(Of OtherClassItem)
- public Property Name () As String
+ public Property Name() As String
End Class
Private _polygonTheme As SharpMap.Rendering.Thematics.UniqueValuesTheme(Of Int32) = CreatePolygonTheme()
@@ -84,14 +84,14 @@ public Class UniqueValuesThemeTest
s.EnableOutline = True
styleMap.Add(1, s)
'2
- s = New SharpMap.Styles. VectorStyle()
- s.Outline=new Drawing.Pen(Drawing.Color.Black, 1)
+ s = New SharpMap.Styles.VectorStyle()
+ s.Outline = new Drawing.Pen(Drawing.Color.Black, 1)
s.Fill = New Drawing.SolidBrush(Drawing.Color.Blue)
s.EnableOutline = True
styleMap.Add(2, s)
'3
s = New SharpMap.Styles.VectorStyle()
- s.Outline =new Drawing.Pen(Drawing.Color.Black, 1)
+ s.Outline = new Drawing.Pen(Drawing.Color.Black, 1)
s.Fill = New Drawing.SolidBrush(Drawing.Color.Red)
s.EnableOutline = True
styleMap.Add(2, s)
@@ -100,103 +100,103 @@ public Class UniqueValuesThemeTest
Return new SharpMap.Rendering.Thematics.UniqueValuesTheme(Of Integer)("FilterColumn", styleMap, SharpMap.Styles.VectorStyle.CreateRandomPolygonalStyle())
End Function
- Public Sub CreateLayers(ByVal config as OtherClass)
- '
- delObjektLabelBez = New SharpMap.Layers.LabelLayer.GetLabelMethod(AddressOf LabelObjektBezeichnung)
- delObjektLabelPos = New SharpMap.Layers.LabelLayer.GetLocationMethod(AddressOf LabelBezeichnungPos)
- delObjektStyle = New SharpMap.Rendering.Thematics.CustomTheme.GetStyleMethod(AddressOf GetObjektStyle)
- delObjektLabelStyle = New SharpMap.Rendering.Thematics.CustomTheme.GetStyleMethod(AddressOf GetObjektLabelStyle)
- '
- For each itm as OtherClassItem in config
- Select Case itm.Name
- Case "Name1"
- Dim smp as New SharpMap.Data.Providers.PostGIS(itm.Datasource, itm.Table, itm.Field)
- Dim vLay as New SharpMap.Layers.VectorLayer(itm.Name, smp)
- 'Dim layTheme = New SharpMap.Rendering.Thematics.CustomTheme(delObjektStyle)
- vLay.Theme = Me._polygonTheme 'layTheme
- '
- Dim labLay As New SharpMap.Layers.LabelLayer("Lable: " & itm.Name)
- Dim labTheme as New SharpMap.Rendering.Thematics.CustomTheme(delObjektLabelStyle)
- labLay.DataSource = vLay.DataSource
- labLay.Theme = labTheme
- labLay.LabelStringDelegate = delObjektLabelBez
- labLay.LabelPositionDelegate = delObjektLabelPos
- '
- _map.Layers.Add(vLay)
- _Map.Layers.Add(labLay)
- '
- Case "Name2"
- Dim smp as New SharpMap.Data.Providers.PostGIS(itm.Datasource, itm.Table, itm.Field)
- Dim vLay as New SharpMap.Layers.VectorLayer(itm.Name, smp)
- '
- 'other code
- '
- Dim labLay As New SharpMap.Layers.LabelLayer("Lable: " & itm.Name)
- Dim labTheme as New SharpMap.Rendering.Thematics.CustomTheme(delObjektLabelStyle)
- labLay.DataSource = vLay.DataSource
- labLay.Theme = labTheme
- labLay.LabelStringDelegate = delObjektLabelBez
- labLay.LabelPositionDelegate = delObjektLabelPos
- '
- _map.Layers.Add(vLay)
- _map.Layers.Add(labLay)
+ Public Sub CreateLayers(ByVal config as OtherClass)
+ '
+ delObjektLabelBez = New SharpMap.Layers.LabelLayer.GetLabelMethod(AddressOf LabelObjektBezeichnung)
+ delObjektLabelPos = New SharpMap.Layers.LabelLayer.GetLocationMethod(AddressOf LabelBezeichnungPos)
+ delObjektStyle = New SharpMap.Rendering.Thematics.CustomTheme.GetStyleMethod(AddressOf GetObjektStyle)
+ delObjektLabelStyle = New SharpMap.Rendering.Thematics.CustomTheme.GetStyleMethod(AddressOf GetObjektLabelStyle)
+ '
+ For each itm as OtherClassItem in config
+ Select Case itm.Name
+ Case "Name1"
+ Dim smp as New SharpMap.Data.Providers.PostGIS(itm.Datasource, itm.Table, itm.Field)
+ Dim vLay as New SharpMap.Layers.VectorLayer(itm.Name, smp)
+ 'Dim layTheme = New SharpMap.Rendering.Thematics.CustomTheme(delObjektStyle)
+ vLay.Theme = Me._polygonTheme 'layTheme
+ '
+ Dim labLay As New SharpMap.Layers.LabelLayer("Lable: " & itm.Name)
+ Dim labTheme as New SharpMap.Rendering.Thematics.CustomTheme(delObjektLabelStyle)
+ labLay.DataSource = vLay.DataSource
+ labLay.Theme = labTheme
+ labLay.LabelStringDelegate = delObjektLabelBez
+ labLay.LabelPositionDelegate = delObjektLabelPos
+ '
+ _map.Layers.Add(vLay)
+ _Map.Layers.Add(labLay)
'
- End Select
+ Case "Name2"
+ Dim smp as New SharpMap.Data.Providers.PostGIS(itm.Datasource, itm.Table, itm.Field)
+ Dim vLay as New SharpMap.Layers.VectorLayer(itm.Name, smp)
+ '
+ 'other code
+ '
+ Dim labLay As New SharpMap.Layers.LabelLayer("Lable: " & itm.Name)
+ Dim labTheme as New SharpMap.Rendering.Thematics.CustomTheme(delObjektLabelStyle)
+ labLay.DataSource = vLay.DataSource
+ labLay.Theme = labTheme
+ labLay.LabelStringDelegate = delObjektLabelBez
+ labLay.LabelPositionDelegate = delObjektLabelPos
+ '
+ _map.Layers.Add(vLay)
+ _map.Layers.Add(labLay)
+ '
+ End Select
+ '
+ Next
+ '
+ 'Other Code .....
'
- Next
- '
- 'Other Code .....
- '
- End Sub
-
+ End Sub
+
Private Shared function LabelObjektBezeichnung(fdr As SharpMap.Data.FeatureDataRow) As String
return "The quick brown fox ..."
- End function
+ End Function
- Private Shared Function LabelBezeichnungPos(fdr As SharpMap.Data.FeatureDataRow) As GeoAPI.Geometries.Coordinate
- return new GeoAPI.Geometries.Coordinate(0, 0)
+ Private Shared Function LabelBezeichnungPos(fdr As SharpMap.Data.FeatureDataRow) As NetTopologySuite.Geometries.Coordinate
+ Return New NetTopologySuite.Geometries.Coordinate(0, 0)
End Function
-
+
Private shared function GetObjektLabelStyle(fdr As SharpMap.Data.FeatureDataRow) As SharpMap.Styles.LabelStyle
End function
- Private shared Function GetObjektStyle(fdr As SharpMap.Data.FeatureDataRow) As SharpMap.Styles.VectorStyle
- '
- Dim style As New SharpMap.Styles.VectorStyle
- Dim c as Drawing.Color
- Dim p as Drawing.Pen
- Dim b as Drawing.Brush
- '
- Select Case fdr.Table.TableName
- Case "Name1" '-- Polygon
- Select Case fdr("FilterColumn")
- Case 1
- c = Drawing.Color.Green
- p = New Drawing.Pen(Drawing.Color.Black, 1)
- b = New Drawing.SolidBrush(c)
- Case 2
- c = Drawing.Color.Blue
- p = New Drawing.Pen(Drawing.Color.Black, 1)
- b = New Drawing.SolidBrush(c)
- Case Else
- c = Drawing.Color.Red
- p = New Drawing.Pen(Drawing.Color.Black, 1)
- b = New Drawing.SolidBrush(c)
- End Select
- '
- style.Fill = b
- style.Outline = p
+ Private shared Function GetObjektStyle(fdr As SharpMap.Data.FeatureDataRow) As SharpMap.Styles.VectorStyle
+ '
+ Dim style As New SharpMap.Styles.VectorStyle
+ Dim c as Drawing.Color
+ Dim p as Drawing.Pen
+ Dim b as Drawing.Brush
+ '
+ Select Case fdr.Table.TableName
+ Case "Name1" '-- Polygon
+ Select Case fdr("FilterColumn")
+ Case 1
+ c = Drawing.Color.Green
+ p = New Drawing.Pen(Drawing.Color.Black, 1)
+ b = New Drawing.SolidBrush(c)
+ Case 2
+ c = Drawing.Color.Blue
+ p = New Drawing.Pen(Drawing.Color.Black, 1)
+ b = New Drawing.SolidBrush(c)
+ Case Else
+ c = Drawing.Color.Red
+ p = New Drawing.Pen(Drawing.Color.Black, 1)
+ b = New Drawing.SolidBrush(c)
+ End Select
+ '
+ style.Fill = b
+ style.Outline = p
'
- Case "Name2"' -- Lines
- '
- ' this Code will not Run
- '
- Case Else
- End Select
- '
- Return style
+ Case "Name2" ' -- Lines
+ '
+ ' this Code will not Run
+ '
+ Case Else
+ End Select
+ '
+ Return style
+ '
+ End Function
'
- End Function
- '
End Class
diff --git a/Examples/ExampleCodeSnipplets.VB/ExampleCodeSnipplets.VB.vbproj b/Examples/ExampleCodeSnipplets.VB/ExampleCodeSnipplets.VB.vbproj
index eaccd23e..ecc65b16 100644
--- a/Examples/ExampleCodeSnipplets.VB/ExampleCodeSnipplets.VB.vbproj
+++ b/Examples/ExampleCodeSnipplets.VB/ExampleCodeSnipplets.VB.vbproj
@@ -21,8 +21,7 @@
-
-
+
@@ -36,5 +35,9 @@
+
+
+
+
diff --git a/Examples/SharpMap.Demo.Wms/Controllers/BuildingsController.cs b/Examples/SharpMap.Demo.Wms/Controllers/BuildingsController.cs
index 0934fbc6..36635da6 100644
--- a/Examples/SharpMap.Demo.Wms/Controllers/BuildingsController.cs
+++ b/Examples/SharpMap.Demo.Wms/Controllers/BuildingsController.cs
@@ -1,19 +1,13 @@
namespace SharpMap.Demo.Wms.Controllers
{
+ using NetTopologySuite.Geometries;
+ using SharpMap.Data;
+ using SharpMap.Data.Providers;
using System;
using System.Collections.Generic;
using System.IO;
- using System.Linq;
using System.Web.Mvc;
-
- using GeoAPI;
- using GeoAPI.Geometries;
-
- using NetTopologySuite;
- using NetTopologySuite.Geometries;
-
- using SharpMap.Data;
- using SharpMap.Data.Providers;
+ using Point = System.Drawing.Point;
public class BuildingsController : Controller
{
@@ -21,10 +15,7 @@ public class BuildingsController : Controller
private const int TileSize = 256;
private const int MaxZoom = 18;
- public BuildingsController()
- {
- GeometryServiceProvider.SetInstanceIfNotAlreadySetDirectly(new NtsGeometryServices());
- }
+ public BuildingsController() { }
private Point GeoToPixel(double lat, double lon, int zoom)
{
@@ -70,10 +61,10 @@ public JsonResult GetData(float w, float n, float e, float s, int z)
if (c == 0)
c = 5; // default value for "null" (zero) heights
int h = c * ScaleZ >> zz;
- if (h <= 1)
+ if (h <= 1)
h = 1;
- IGeometry geometry = row.Geometry;
+ Geometry geometry = row.Geometry;
Coordinate[] coords = geometry.Coordinates;
int total = coords.Length;
double[] values = new double[total * 2];
diff --git a/Examples/SharpMap.Demo.Wms/Controllers/HomeController.cs b/Examples/SharpMap.Demo.Wms/Controllers/HomeController.cs
index c3e899f9..981c82f5 100644
--- a/Examples/SharpMap.Demo.Wms/Controllers/HomeController.cs
+++ b/Examples/SharpMap.Demo.Wms/Controllers/HomeController.cs
@@ -1,26 +1,25 @@
namespace SharpMap.Demo.Wms.Controllers
{
+ using SharpMap.Demo.Wms.Models;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Web.Mvc;
- using SharpMap.Demo.Wms.Models;
-
public class HomeController : Controller
{
private List GetDemoItems()
{
List items = new List();
- Type type = this.GetType();
+ Type type = GetType();
// how to retrieve all public instance methods?
// BindingFlags.Public | BindingFlags.DeclaredOnly returns an empty array...
MethodInfo[] methods = type.GetMethods();
foreach (MethodInfo method in methods)
- {
+ {
bool valid = method.ReturnType == typeof(ActionResult);
- if (!valid)
+ if (!valid)
continue;
object[] attributes = method.GetCustomAttributes(typeof(ObsoleteAttribute), false);
@@ -30,70 +29,73 @@ private List GetDemoItems()
int i = type.Name.IndexOf("Controller", StringComparison.Ordinal);
string url = String.Format("{0}/{1}", type.Name.Substring(0, i), method.Name);
items.Add(new DemoItem(method.Name, url));
- }
+ }
return items;
}
-
+
[Obsolete]
public ActionResult Index()
{
- this.ViewData["DemoItems"] = this.GetDemoItems();
- return this.View();
+ ViewData["DemoItems"] = GetDemoItems();
+ return View();
}
public ActionResult Default()
{
- return this.View();
+ return View();
}
public ActionResult Openlayers()
{
- return this.View();
+ return View();
}
+ [Obsolete]
public ActionResult Polymaps()
{
- return this.View();
+ return View();
}
public ActionResult Leaflet()
{
- return this.View();
+ return View();
}
public ActionResult Geojson()
{
- return this.View();
+ return View();
}
public ActionResult Editor()
{
- return this.View();
+ return View();
}
+ [Obsolete]
public ActionResult Offline()
{
- return this.View();
+ return View();
}
public ActionResult TileCanvas()
{
- return this.View();
+ return View();
}
public ActionResult Buildings()
{
- return this.View();
+ return View();
}
+ [Obsolete]
public ActionResult UtfGrid()
{
- return this.View();
+ return View();
}
public ActionResult D3()
{
- return this.View();
- }
+ return View();
+ }
}
}
diff --git a/Examples/SharpMap.Demo.Wms/Controllers/ProcessController.cs b/Examples/SharpMap.Demo.Wms/Controllers/ProcessController.cs
index f9fbd36c..aaa2dfb5 100644
--- a/Examples/SharpMap.Demo.Wms/Controllers/ProcessController.cs
+++ b/Examples/SharpMap.Demo.Wms/Controllers/ProcessController.cs
@@ -1,73 +1,66 @@
namespace SharpMap.Demo.Wms.Controllers
{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.IO;
- using System.Linq;
- using System.Web.Mvc;
-
- using GeoAPI.Geometries;
-
using NetTopologySuite.Geometries;
using NetTopologySuite.Geometries.Utilities;
using NetTopologySuite.IO;
- using NetTopologySuite.Operation.Linemerge;
using NetTopologySuite.Operation.Polygonize;
using NetTopologySuite.Operation.Union;
using NetTopologySuite.Simplify;
-
using SharpMap.Converters.GeoJSON;
+ using System;
+ using System.Collections.Generic;
+ using System.IO;
+ using System.Linq;
+ using System.Web.Mvc;
public class ProcessController : Controller
{
- private readonly IGeometryFactory factory = GeometryFactory.Default;
+ private readonly GeometryFactory factory = GeometryFactory.Default;
- private IGeometryCollection ValidateGeo(string geo)
+ private GeometryCollection ValidateGeo(string geo)
{
if (String.IsNullOrEmpty(geo))
throw new ArgumentException("invalid argument 'geo': empty string");
- WKTReader reader = new WKTReader(this.factory);
- IGeometry data = reader.Read(geo);
+ WKTReader reader = new WKTReader(NetTopologySuite.NtsGeometryServices.Instance);
+ Geometry data = reader.Read(geo);
// we should expect a GeometryCollection object
- if (data is IGeometryCollection)
- return data as IGeometryCollection;
- throw new ArgumentException("invalid argument 'geo': IGeometryCollection expected");
+ if (data is GeometryCollection)
+ return data as GeometryCollection;
+ throw new ArgumentException("invalid argument 'geo': GeometryCollection expected");
}
- private ILineString ValidateCut(string cut)
+ private LineString ValidateCut(string cut)
{
if (String.IsNullOrEmpty(cut))
throw new ArgumentException("invalid argument 'cut': empty string");
WKTReader reader = new WKTReader(this.factory);
- IGeometry data = reader.Read(cut);
+ Geometry data = reader.Read(cut);
// we should expect a GeometryCollection object
- if (data is ILineString)
- return data as ILineString;
- throw new ArgumentException("invalid argument 'cut': ILineString expected");
+ if (data is LineString)
+ return data as LineString;
+ throw new ArgumentException("invalid argument 'cut': LineString expected");
}
- private ActionResult MakeResponse(IEnumerable geometries)
+ private ActionResult MakeResponse(IEnumerable geometries)
{
if (geometries == null)
throw new ArgumentNullException("geometries");
// we should return a GeometryCollection object
- IGeometry[] array = geometries.ToArray();
- IGeometryCollection result = this.factory.CreateGeometryCollection(array);
+ Geometry[] array = geometries.ToArray();
+ GeometryCollection result = this.factory.CreateGeometryCollection(array);
StringWriter writer = new StringWriter();
GeoJSONWriter.Write(result, writer);
return this.Json(new { geo = writer.ToString() });
}
- private static IEnumerable GetItems(IGeometry coll)
+ private static IEnumerable GetItems(Geometry coll)
{
- if (coll == null)
+ if (coll == null)
throw new ArgumentNullException("coll");
for (int i = 0; i < coll.NumGeometries; i++)
@@ -77,52 +70,52 @@ private static IEnumerable GetItems(IGeometry coll)
[HttpPost]
public ActionResult Clean(string geo)
{
- IGeometryCollection coll = this.ValidateGeo(geo);
- IEnumerable data = DoClean(coll);
+ GeometryCollection coll = this.ValidateGeo(geo);
+ IEnumerable data = DoClean(coll);
return this.MakeResponse(data);
}
- private static IEnumerable DoClean(IGeometryCollection coll)
+ private static IEnumerable DoClean(GeometryCollection coll)
{
if (coll == null)
throw new ArgumentNullException("coll");
- IEnumerable items = GetItems(coll);
- foreach (IGeometry geom in items)
+ IEnumerable items = GetItems(coll);
+ foreach (Geometry geom in items)
{
DouglasPeuckerSimplifier simplifier = new DouglasPeuckerSimplifier(geom);
- IGeometry clean = simplifier.GetResultGeometry();
+ Geometry clean = simplifier.GetResultGeometry();
yield return clean;
}
- }
+ }
[HttpPost]
public ActionResult Merge(string geo)
{
- IGeometryCollection coll = this.ValidateGeo(geo);
- IEnumerable data = DoMerge(coll);
+ GeometryCollection coll = this.ValidateGeo(geo);
+ IEnumerable data = DoMerge(coll);
return this.MakeResponse(data);
}
- private static IEnumerable DoMerge(IGeometryCollection coll)
+ private static IEnumerable DoMerge(GeometryCollection coll)
{
if (coll == null)
throw new ArgumentNullException("coll");
- IEnumerable items = GetItems(coll);
+ IEnumerable items = GetItems(coll);
yield return UnaryUnionOp.Union(items.ToArray());
}
[HttpPost]
public ActionResult Split(string geo, string cut)
{
- IGeometryCollection coll = this.ValidateGeo(geo);
- ILineString split = this.ValidateCut(cut);
- IEnumerable data = DoSplit(coll, split);
+ GeometryCollection coll = this.ValidateGeo(geo);
+ LineString split = this.ValidateCut(cut);
+ IEnumerable data = DoSplit(coll, split);
return this.MakeResponse(data);
}
- public static IGeometry Polygonize(IGeometry geometry)
+ public static Geometry Polygonize(Geometry geometry)
{
if (geometry == null)
throw new ArgumentNullException("geometry");
@@ -130,13 +123,13 @@ public static IGeometry Polygonize(IGeometry geometry)
var lines = LineStringExtracter.GetLines(geometry);
var geoms = lines.ToList();
- var polygonizer = new Polygonizer();
+ var polygonizer = new Polygonizer();
polygonizer.Add(geoms);
var polys = polygonizer.GetPolygons();
return geometry.Factory.BuildGeometry(polys);
}
- private static IEnumerable DoSplit(IGeometryCollection coll, ILineString cut)
+ private static IEnumerable DoSplit(GeometryCollection coll, LineString cut)
{
if (coll == null)
throw new ArgumentNullException("coll");
@@ -146,36 +139,36 @@ private static IEnumerable DoSplit(IGeometryCollection coll, ILineStr
// adapted from 'SplitPolygon WPS' GeoServer extension:
// https://github.com/mdavisog/wps-splitpoly/tree/master/src
- IList output = new List();
- IEnumerable items = GetItems(coll);
- IEnumerable valid = items.Where(i => i is IPolygon);
- foreach (IGeometry item in valid)
+ IList output = new List();
+ IEnumerable items = GetItems(coll);
+ IEnumerable valid = items.Where(i => i is Polygon);
+ foreach (Geometry item in valid)
{
- IGeometry nodedLinework = item.Boundary.Union(cut);
- IGeometry polygons = Polygonize(nodedLinework);
+ Geometry nodedLinework = item.Boundary.Union(cut);
+ Geometry polygons = Polygonize(nodedLinework);
// only keep polygons which are inside the input
for (int i = 0; i < polygons.NumGeometries; i++)
{
- IPolygon candpoly = (IPolygon)polygons.GetGeometryN(i);
+ Polygon candpoly = (Polygon)polygons.GetGeometryN(i);
if (item.Contains(candpoly.InteriorPoint))
output.Add(candpoly);
- }
+ }
}
return output;
/*
- IEnumerable items = GetItems(coll);
+ IEnumerable items = GetItems(coll);
LineMerger merger = new LineMerger();
merger.Add(items);
merger.Add(cut);
- IList list = merger.GetMergedLineStrings();
+ IList list = merger.GetMergedLineStrings();
- IGeometry union = UnaryUnionOp.Union(list);
+ Geometry union = UnaryUnionOp.Union(list);
Polygonizer polygonizer = new Polygonizer();
polygonizer.Add(union);
- ICollection split = polygonizer.GetPolygons();
+ ICollection split = polygonizer.GetPolygons();
return split;
* */
}
diff --git a/Examples/SharpMap.Demo.Wms/Controllers/UtfGridController.cs b/Examples/SharpMap.Demo.Wms/Controllers/UtfGridController.cs
index 3c0a402d..fc41a3ca 100644
--- a/Examples/SharpMap.Demo.Wms/Controllers/UtfGridController.cs
+++ b/Examples/SharpMap.Demo.Wms/Controllers/UtfGridController.cs
@@ -1,22 +1,19 @@
// code adapted from: https://github.com/awcoats/mapstache
namespace SharpMap.Demo.Wms.Controllers
{
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Web.Mvc;
-
- using GeoAPI.Geometries;
-
using Mapstache;
-
- using GeoAPI.CoordinateSystems.Transformations;
-
+ using NetTopologySuite.Geometries;
+ using ProjNet.CoordinateSystems.Transformations;
using SharpMap.Converters.GeoJSON;
using SharpMap.Data;
using SharpMap.Demo.Wms.Helpers;
using SharpMap.Layers;
+ using System;
+ using System.Collections.Generic;
+ using System.Drawing;
+ using System.Linq;
+ using System.Web.Mvc;
+ using Point = System.Drawing.Point;
public class UtfGridController : Controller
{
@@ -74,7 +71,7 @@ public JsonResult GetData(string layer, int z, int x, int y)
int i = 1;
foreach (GeoJSON val in data)
{
- IGeometry geom = val.Geometry;
+ Geometry geom = val.Geometry;
IDictionary dict = val.Values;
grid.FillPolygon(geom, i, dict);
i = i + 1;
@@ -85,4 +82,4 @@ public JsonResult GetData(string layer, int z, int x, int y)
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Examples/SharpMap.Demo.Wms/Global.asax.cs b/Examples/SharpMap.Demo.Wms/Global.asax.cs
index c88bfce2..e5b6c298 100644
--- a/Examples/SharpMap.Demo.Wms/Global.asax.cs
+++ b/Examples/SharpMap.Demo.Wms/Global.asax.cs
@@ -1,5 +1,6 @@
namespace SharpMap.Demo.Wms
{
+ using SharpMap.CoordinateSystems;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
@@ -15,11 +16,15 @@ public static void RegisterRoutes(RouteCollection routes)
protected void Application_Start()
{
+ var gss = NetTopologySuite.NtsGeometryServices.Instance;
+ var css = new CoordinateSystemServices(
+ new ProjNet.CoordinateSystems.CoordinateSystemFactory(),
+ new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory(),
+ Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());
SharpMap.Session.Instance
- .SetGeometryServices(NetTopologySuite.NtsGeometryServices.Instance)
- .SetCoordinateSystemServices(CoordinateSystems.CoordinateSystemServices
- .FromSpatialRefSys(new ProjNet.CoordinateSystems.CoordinateSystemFactory(),
- new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory()));
+ .SetGeometryServices(gss)
+ .SetCoordinateSystemServices(css)
+ .SetCoordinateSystemRepository(css);
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
diff --git a/Examples/SharpMap.Demo.Wms/Handlers/AbstractStdMapHandler.cs b/Examples/SharpMap.Demo.Wms/Handlers/AbstractStdMapHandler.cs
index db07b875..b9311089 100644
--- a/Examples/SharpMap.Demo.Wms/Handlers/AbstractStdMapHandler.cs
+++ b/Examples/SharpMap.Demo.Wms/Handlers/AbstractStdMapHandler.cs
@@ -1,23 +1,13 @@
namespace SharpMap.Demo.Wms.Handlers
{
+ using SharpMap.Demo.Wms.Helpers;
using System;
using System.Web;
- using GeoAPI;
-
- using NetTopologySuite;
-
- using SharpMap.Demo.Wms.Helpers;
-
public abstract class AbstractStdMapHandler : IHttpHandler
{
private static readonly object SyncLock = new object();
- static AbstractStdMapHandler()
- {
- GeometryServiceProvider.SetInstanceIfNotAlreadySetDirectly(NtsGeometryServices.Instance);
- }
-
public abstract void ProcessRequest(HttpContext context);
protected string GetFixedUrl(HttpRequest request)
@@ -27,7 +17,7 @@ protected string GetFixedUrl(HttpRequest request)
return uri.Query.Length <= 0 ? absoluteUri : absoluteUri.Replace(uri.Query, String.Empty);
}
- protected Web.Wms.Capabilities.WmsServiceDescription GetDescription(string url)
+ protected Web.Wms.Capabilities.WmsServiceDescription GetDescription(string url)
{
var description = new Web.Wms.Capabilities.WmsServiceDescription("Acme Corp. Map Server", url);
description.MaxWidth = 500;
@@ -44,7 +34,7 @@ protected Web.Wms.Capabilities.WmsServiceDescription GetDescription(string url)
protected Map GetMap(HttpRequest request)
{
- string type = request.Params["MAP_TYPE"];
+ string type = request.Params["MAP_TYPE"];
if (String.Equals(type, "DEF", StringComparison.InvariantCultureIgnoreCase))
return ShapefileHelper.Default();
if (String.Equals(type, "SPH", StringComparison.InvariantCultureIgnoreCase))
@@ -53,7 +43,7 @@ protected Map GetMap(HttpRequest request)
return DatabaseHelper.SqlServer();
string format = String.Format("unsupported map type: '{0}'", type);
throw new NotSupportedException(format);
- }
+ }
public bool IsReusable
{
diff --git a/Examples/SharpMap.Demo.Wms/Handlers/StdJsonMapHandler.cs b/Examples/SharpMap.Demo.Wms/Handlers/StdJsonMapHandler.cs
index 5caac04b..5c02548f 100644
--- a/Examples/SharpMap.Demo.Wms/Handlers/StdJsonMapHandler.cs
+++ b/Examples/SharpMap.Demo.Wms/Handlers/StdJsonMapHandler.cs
@@ -1,23 +1,19 @@
namespace SharpMap.Demo.Wms.Handlers
{
+ using NetTopologySuite.CoordinateSystems.Transformations;
+ using ProjNet.CoordinateSystems.Transformations;
+ using SharpMap.Converters.GeoJSON;
+ using SharpMap.Data;
+ using SharpMap.Layers;
+ using SharpMap.Web.Wms;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Web;
-
- using NetTopologySuite.Geometries;
-
- using GeoAPI.CoordinateSystems.Transformations;
-
- using SharpMap.Converters.GeoJSON;
- using SharpMap.Data;
- using SharpMap.Layers;
- using SharpMap.Web.Wms;
-
- using Geometry = GeoAPI.Geometries.IGeometry;
- using BoundingBox = GeoAPI.Geometries.Envelope;
+ using BoundingBox = NetTopologySuite.Geometries.Envelope;
+ using Geometry = NetTopologySuite.Geometries.Geometry;
public class StdJsonMapHandler : AbstractStdMapHandler
{
@@ -47,10 +43,10 @@ public override void ProcessRequest(HttpContext context)
string[] layers = ls.Split(',');
foreach (ILayer layer in map.Layers)
if (!layers.Contains(layer.LayerName))
- layer.Enabled = false;
+ layer.Enabled = false;
}
- IEnumerable items = GetData(map, bbox);
+ IEnumerable items = GetData(map, bbox);
StringWriter writer = new StringWriter();
GeoJSONWriter.Write(items, writer);
string buffer = writer.ToString();
@@ -75,11 +71,11 @@ private static IEnumerable GetData(Map map, BoundingBox bbox)
{
if (map == null)
throw new ArgumentNullException("map");
-
+
// Only queryable data!
IQueryable coll = map.Layers
.AsQueryable()
- .Where(l => l.Enabled)
+ .Where(l => l.Enabled)
.OfType()
.Where(l => l.IsQueryEnabled);
@@ -103,7 +99,7 @@ private static IEnumerable QueryData(BoundingBox bbox, ICanQueryLayer l
IEnumerable data = GeoJSONHelper.GetData(ds);
// Reproject geometries if needed
- IMathTransform transform = null;
+ MathTransform transform = null;
if (layer is VectorLayer)
{
ICoordinateTransformation transformation = (layer as VectorLayer).CoordinateTransformation;
@@ -111,10 +107,9 @@ private static IEnumerable QueryData(BoundingBox bbox, ICanQueryLayer l
}
if (transform != null)
{
- GeometryFactory gf = new GeometryFactory();
data = data.Select(d =>
{
- Geometry converted = GeometryTransform.TransformGeometry(d.Geometry, transform, gf);
+ Geometry converted = GeometryTransform.TransformGeometry(d.Geometry, transform, d.Geometry.Factory);
d.SetGeometry(converted);
return d;
});
diff --git a/Examples/SharpMap.Demo.Wms/Handlers/StdWmsMapHandler.cs b/Examples/SharpMap.Demo.Wms/Handlers/StdWmsMapHandler.cs
index 987adde5..0de19062 100644
--- a/Examples/SharpMap.Demo.Wms/Handlers/StdWmsMapHandler.cs
+++ b/Examples/SharpMap.Demo.Wms/Handlers/StdWmsMapHandler.cs
@@ -1,11 +1,10 @@
namespace SharpMap.Demo.Wms.Handlers
{
+ using SharpMap.Web.Wms;
using System;
using System.Diagnostics;
using System.Web;
- using SharpMap.Web.Wms;
-
public class StdWmsMapHandler : AbstractStdMapHandler
{
public override void ProcessRequest(HttpContext context)
diff --git a/Examples/SharpMap.Demo.Wms/Helpers/DatabaseHelper.cs b/Examples/SharpMap.Demo.Wms/Helpers/DatabaseHelper.cs
index ef33acc0..46f050b8 100644
--- a/Examples/SharpMap.Demo.Wms/Helpers/DatabaseHelper.cs
+++ b/Examples/SharpMap.Demo.Wms/Helpers/DatabaseHelper.cs
@@ -1,26 +1,23 @@
namespace SharpMap.Demo.Wms.Helpers
{
- using System;
- using System.Drawing;
- using System.Drawing.Drawing2D;
-
- using GeoAPI.CoordinateSystems.Transformations;
-
using SharpMap.Data.Providers;
using SharpMap.Layers;
using SharpMap.Styles;
+ using System;
+ using System.Drawing;
+ using System.Drawing.Drawing2D;
public static class DatabaseHelper
{
public static Map SqlServer()
{
const string connstr = "Data Source=.\\SQL2008R2;Initial Catalog=SampleData;Integrated Security=SSPI;";
- Map map = new Map(new Size(1, 1));
+ Map map = new Map(new Size(1, 1));
VectorStyle style0 = new VectorStyle { Line = new Pen(Color.DarkGray, 2) };
VectorLayer layer0 = CreateLayer(connstr, "osm_boundaries", style0);
map.Layers.Add(layer0);
-
+
VectorStyle style1 = new VectorStyle { Line = new Pen(Color.DarkRed, 2.5f) };
VectorLayer layer1 = CreateLayer(connstr, "osm_roads_major", style1);
map.Layers.Add(layer1);
@@ -28,7 +25,7 @@ public static Map SqlServer()
VectorStyle style2 = new VectorStyle { Line = new Pen(Color.DarkBlue, 1.5f) };
VectorLayer layer2 = CreateLayer(connstr, "osm_roads_minor", style2);
map.Layers.Add(layer2);
-
+
return map;
}
@@ -39,9 +36,10 @@ private static VectorLayer CreateLayer(string connstr, string name, VectorStyle
if (name == null)
throw new ArgumentNullException("name");
-
- var source = new SqlServer2008(connstr, name, "geom", "ID",
- SqlServerSpatialObjectType.Geometry, 0, SqlServer2008ExtentsMode.QueryIndividualFeatures) { ValidateGeometries = true };
+
+ var source = new SqlServer2008(connstr, name, "geom", "ID",
+ SqlServerSpatialObjectType.Geometry, 0, SqlServer2008ExtentsMode.QueryIndividualFeatures)
+ { ValidateGeometries = true };
var transformation = ProjHelper.LatLonToGoogle();
var item = new VectorLayer(name, source)
{
diff --git a/Examples/SharpMap.Demo.Wms/Helpers/ExtensionMethods.cs b/Examples/SharpMap.Demo.Wms/Helpers/ExtensionMethods.cs
index bc866cb2..84201f15 100644
--- a/Examples/SharpMap.Demo.Wms/Helpers/ExtensionMethods.cs
+++ b/Examples/SharpMap.Demo.Wms/Helpers/ExtensionMethods.cs
@@ -13,11 +13,11 @@ public static string Join(this IEnumerable strings)
public static string Join(this IEnumerable strings, char separator)
{
- if (strings == null)
+ if (strings == null)
return String.Empty;
var sb = new StringBuilder();
- foreach (var s in strings)
+ foreach (var s in strings)
sb.Append(s).Append(separator);
return sb.ToString().TrimEnd(separator);
}
@@ -33,7 +33,7 @@ public static string Fix(this string bbox)
return arr.Join(',');
}
- private static void Flip(IList arr, int first, int second)
+ private static void Flip(IList arr, int first, int second)
{
var temp = arr[first];
arr[first] = arr[second];
diff --git a/Examples/SharpMap.Demo.Wms/Helpers/ProjHelper.cs b/Examples/SharpMap.Demo.Wms/Helpers/ProjHelper.cs
index 328b656d..5e252526 100644
--- a/Examples/SharpMap.Demo.Wms/Helpers/ProjHelper.cs
+++ b/Examples/SharpMap.Demo.Wms/Helpers/ProjHelper.cs
@@ -1,17 +1,13 @@
namespace SharpMap.Demo.Wms.Helpers
{
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Drawing.Drawing2D;
-
- using GeoAPI.CoordinateSystems;
using ProjNet.CoordinateSystems;
- using GeoAPI.CoordinateSystems.Transformations;
using ProjNet.CoordinateSystems.Transformations;
-
using SharpMap.Layers;
using SharpMap.Rendering;
+ using System;
+ using System.Collections.Generic;
+ using System.Drawing;
+ using System.Drawing.Drawing2D;
public static class ProjHelper
{
@@ -19,7 +15,7 @@ public static ICoordinateTransformation LatLonToGoogle()
{
CoordinateSystemFactory csFac = new CoordinateSystemFactory();
CoordinateTransformationFactory ctFac = new CoordinateTransformationFactory();
- IGeographicCoordinateSystem sourceCs = csFac.CreateGeographicCoordinateSystem(
+ GeographicCoordinateSystem sourceCs = csFac.CreateGeographicCoordinateSystem(
"WGS 84",
AngularUnit.Degrees,
HorizontalDatum.WGS84,
@@ -38,7 +34,7 @@ public static ICoordinateTransformation LatLonToGoogle()
new ProjectionParameter("false_northing", 0.0)
};
IProjection projection = csFac.CreateProjection("Google Mercator", "mercator_1sp", parameters);
- IProjectedCoordinateSystem targetCs = csFac.CreateProjectedCoordinateSystem(
+ ProjectedCoordinateSystem targetCs = csFac.CreateProjectedCoordinateSystem(
"Google Mercator",
sourceCs,
projection,
@@ -56,14 +52,14 @@ public static LabelLayer CreateLabelLayer(VectorLayer src, string column)
{
string name = String.Format("{0}:Labels", src.LayerName);
LabelLayer layer = new LabelLayer(name)
- {
- DataSource = src.DataSource,
- LabelColumn = column,
- LabelFilter = LabelCollisionDetection.ThoroughCollisionDetection,
- MultipartGeometryBehaviour = LabelLayer.MultipartGeometryBehaviourEnum.CommonCenter,
- MaxVisible = src.MaxVisible,
- MinVisible = src.MinVisible,
- Style =
+ {
+ DataSource = src.DataSource,
+ LabelColumn = column,
+ LabelFilter = LabelCollisionDetection.ThoroughCollisionDetection,
+ MultipartGeometryBehaviour = LabelLayer.MultipartGeometryBehaviourEnum.CommonCenter,
+ MaxVisible = src.MaxVisible,
+ MinVisible = src.MinVisible,
+ Style =
{
CollisionDetection = true,
CollisionBuffer = new SizeF(10F, 10F),
@@ -71,10 +67,10 @@ public static LabelLayer CreateLabelLayer(VectorLayer src, string column)
Font = new Font(FontFamily.GenericSansSerif, 12),
Halo = new Pen(Color.White, 2)
},
- SmoothingMode = SmoothingMode.HighQuality,
- CoordinateTransformation = src.CoordinateTransformation
- };
+ SmoothingMode = SmoothingMode.HighQuality,
+ CoordinateTransformation = src.CoordinateTransformation
+ };
return layer;
}
}
-}
\ No newline at end of file
+}
diff --git a/Examples/SharpMap.Demo.Wms/Helpers/ShapefileHelper.cs b/Examples/SharpMap.Demo.Wms/Helpers/ShapefileHelper.cs
index 47cd69d9..2a281857 100644
--- a/Examples/SharpMap.Demo.Wms/Helpers/ShapefileHelper.cs
+++ b/Examples/SharpMap.Demo.Wms/Helpers/ShapefileHelper.cs
@@ -1,7 +1,10 @@
-using ProjNet.CoordinateSystems;
-
namespace SharpMap.Demo.Wms.Helpers
{
+ using ProjNet.CoordinateSystems;
+ using SharpMap.Data.Providers;
+ using SharpMap.Demo.Wms.Models;
+ using SharpMap.Layers;
+ using SharpMap.Styles;
using System;
using System.Collections.Generic;
using System.Drawing;
@@ -9,13 +12,6 @@ namespace SharpMap.Demo.Wms.Helpers
using System.IO;
using System.Web;
- using GeoAPI.CoordinateSystems.Transformations;
-
- using SharpMap.Data.Providers;
- using SharpMap.Demo.Wms.Models;
- using SharpMap.Layers;
- using SharpMap.Styles;
-
public static class ShapefileHelper
{
private static readonly IDictionary Nyc;
diff --git a/Examples/SharpMap.Demo.Wms/Models/DemoItem.cs b/Examples/SharpMap.Demo.Wms/Models/DemoItem.cs
index acce6e14..4597c58d 100644
--- a/Examples/SharpMap.Demo.Wms/Models/DemoItem.cs
+++ b/Examples/SharpMap.Demo.Wms/Models/DemoItem.cs
@@ -6,9 +6,9 @@ public class DemoItem : IEquatable
{
public DemoItem(string name, string url)
{
- if (name == null)
+ if (name == null)
throw new ArgumentNullException("name");
- if (url == null)
+ if (url == null)
throw new ArgumentNullException("url");
this.Name = name;
this.Url = url;
@@ -25,20 +25,20 @@ public override string ToString()
public bool Equals(DemoItem other)
{
- if (ReferenceEquals(null, other))
+ if (ReferenceEquals(null, other))
return false;
- if (ReferenceEquals(this, other))
+ if (ReferenceEquals(this, other))
return true;
return Equals(other.Name, this.Name) && Equals(other.Url, this.Url);
}
public override bool Equals(object obj)
{
- if (ReferenceEquals(null, obj))
+ if (ReferenceEquals(null, obj))
return false;
- if (ReferenceEquals(this, obj))
+ if (ReferenceEquals(this, obj))
return true;
- if (obj.GetType() != typeof(DemoItem))
+ if (obj.GetType() != typeof(DemoItem))
return false;
return this.Equals((DemoItem)obj);
}
@@ -49,6 +49,6 @@ public override int GetHashCode()
{
return (this.Name.GetHashCode() * 397) ^ this.Url.GetHashCode();
}
- }
+ }
}
}
\ No newline at end of file
diff --git a/Examples/SharpMap.Demo.Wms/Plugins/GraphicsPathBuilder.cs b/Examples/SharpMap.Demo.Wms/Plugins/GraphicsPathBuilder.cs
index 6f29674f..68312562 100644
--- a/Examples/SharpMap.Demo.Wms/Plugins/GraphicsPathBuilder.cs
+++ b/Examples/SharpMap.Demo.Wms/Plugins/GraphicsPathBuilder.cs
@@ -1,13 +1,13 @@
// code adapted from: https://github.com/awcoats/mapstache
namespace Mapstache
{
+ using NetTopologySuite.Geometries;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
-
- using GeoAPI.Geometries;
+ using Point = System.Drawing.Point;
public class GraphicsPathBuilder
{
@@ -22,36 +22,36 @@ public GraphicsPathBuilder(RectangleF bounds, Size size)
if (size.IsEmpty)
throw new ArgumentException("Size is empty.", "size");
- this.metersToPixel = bounds.Width/size.Width;
- this.topLeft = new Point((int) bounds.Left, (int) (bounds.Top));
+ this.metersToPixel = bounds.Width / size.Width;
+ this.topLeft = new Point((int)bounds.Left, (int)(bounds.Top));
this.size = size;
}
- public GraphicsPath Build(IGeometry geometry)
+ public GraphicsPath Build(Geometry geometry)
{
GraphicsPath graphicsPath = new GraphicsPath { FillMode = FillMode.Alternate };
string geometryType = geometry.GeometryType;
switch (geometryType)
{
case "Polygon":
- this.AddPolygon((IPolygon)geometry, graphicsPath);
+ this.AddPolygon((Polygon)geometry, graphicsPath);
break;
case "MultiPolygon":
- this.AddMultiPolygon((IMultiPolygon)geometry, graphicsPath);
+ this.AddMultiPolygon((MultiPolygon)geometry, graphicsPath);
break;
case "GeometryCollection":
for (int i = 0; i < geometry.NumGeometries; i++)
{
- IGeometry geom = geometry.GetGeometryN(i + 1);
+ Geometry geom = geometry.GetGeometryN(i + 1);
switch (geom.GeometryType)
{
case "Polygon":
- this.AddPolygon((IPolygon)geom, graphicsPath);
+ this.AddPolygon((Polygon)geom, graphicsPath);
break;
case "MultiPolygon":
- this.AddMultiPolygon((IMultiPolygon)geom, graphicsPath);
+ this.AddMultiPolygon((MultiPolygon)geom, graphicsPath);
break;
}
}
@@ -64,32 +64,32 @@ public GraphicsPath Build(IGeometry geometry)
return graphicsPath;
}
- private void AddMultiPolygon(IMultiPolygon geometry, GraphicsPath graphicsPath)
+ private void AddMultiPolygon(MultiPolygon geometry, GraphicsPath graphicsPath)
{
if (geometry == null)
throw new ArgumentNullException("geometry");
foreach (var geom in geometry.Geometries)
- this.AddPolygon((IPolygon)geom, graphicsPath);
+ this.AddPolygon((Polygon)geom, graphicsPath);
}
- private void AddPolygon(IPolygon polygon, GraphicsPath graphicsPath)
+ private void AddPolygon(Polygon polygon, GraphicsPath graphicsPath)
{
if (polygon == null)
throw new ArgumentNullException("polygon");
- ILineString exterior = polygon.ExteriorRing;
+ LineString exterior = polygon.ExteriorRing;
IEnumerable coords = this.GetCoords(exterior);
graphicsPath.AddPolygon(coords.ToArray());
- foreach (ILineString ring in polygon.InteriorRings)
+ foreach (LineString ring in polygon.InteriorRings)
{
coords = this.GetCoords(ring);
graphicsPath.AddPolygon(coords.ToArray());
}
}
- private IEnumerable GetCoords(IGeometry lineString)
+ private IEnumerable GetCoords(Geometry lineString)
{
if (lineString == null)
throw new ArgumentNullException("lineString");
@@ -102,8 +102,8 @@ private IEnumerable GetCoords(IGeometry lineString)
private PointF GetPixel(PointF ll)
{
Point meters = SphericalMercator.FromLonLat(ll);
- float x = (meters.X - this.topLeft.X)/this.metersToPixel;
- float y = (meters.Y - this.topLeft.Y)/this.metersToPixel;
+ float x = (meters.X - this.topLeft.X) / this.metersToPixel;
+ float y = (meters.Y - this.topLeft.Y) / this.metersToPixel;
y = this.size.Height - y;
return new PointF(x, y);
}
diff --git a/Examples/SharpMap.Demo.Wms/Plugins/Utf8Grid.cs b/Examples/SharpMap.Demo.Wms/Plugins/Utf8Grid.cs
index c1d8c4ed..34b8e9aa 100644
--- a/Examples/SharpMap.Demo.Wms/Plugins/Utf8Grid.cs
+++ b/Examples/SharpMap.Demo.Wms/Plugins/Utf8Grid.cs
@@ -1,6 +1,7 @@
// code adapted from: https://github.com/awcoats/mapstache
namespace Mapstache
{
+ using NetTopologySuite.Geometries;
using System;
using System.Collections.Generic;
using System.Drawing;
@@ -9,8 +10,7 @@ namespace Mapstache
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
-
- using GeoAPI.Geometries;
+ using Point = System.Drawing.Point;
public class Utf8GridResults
{
@@ -29,11 +29,11 @@ public Utf8GridResults()
}
public class Utf8Grid : IDisposable
- {
+ {
private Bitmap bitmap;
private Graphics graphics;
- private readonly Utf8GridResults results;
+ private readonly Utf8GridResults results;
private readonly GraphicsPathBuilder graphicsPathBuilder;
public Utf8Grid(int utfGridResolution, int tileX, int tileY, int zoom)
@@ -42,7 +42,7 @@ public Utf8Grid(int utfGridResolution, int tileX, int tileY, int zoom)
this.bitmap = new Bitmap(size.Width, size.Height, PixelFormat.Format32bppRgb);
this.graphics = Graphics.FromImage(this.bitmap);
RectangleF bbox = this.GetBoundingBoxInLatLngWithMargin(tileX, tileY, zoom);
- this.graphicsPathBuilder = new GraphicsPathBuilder(SphericalMercator.FromLonLat(bbox), size);
+ this.graphicsPathBuilder = new GraphicsPathBuilder(SphericalMercator.FromLonLat(bbox), size);
this.results = new Utf8GridResults();
}
@@ -53,7 +53,7 @@ public RectangleF GetBoundingBoxInLatLngWithMargin(int tileX, int tileY, int zoo
return RectangleF.FromLTRB(lonlat1.X, lonlat2.Y, lonlat2.X, lonlat1.Y);
}
- public void FillPolygon(IGeometry geometry, int i, object data = null)
+ public void FillPolygon(Geometry geometry, int i, object data = null)
{
using (GraphicsPath gp = this.graphicsPathBuilder.Build(geometry))
using (Brush brush = CreateBrush(i))
@@ -65,7 +65,7 @@ public void FillPolygon(IGeometry geometry, int i, object data = null)
public Utf8GridResults CreateUtfGridJson()
{
BitmapData bitmapData = this.bitmap.LockBits(
- new Rectangle(0, 0, this.bitmap.Width, this.bitmap.Height),
+ new Rectangle(0, 0, this.bitmap.Width, this.bitmap.Height),
ImageLockMode.ReadOnly, this.bitmap.PixelFormat);
IntPtr ptr = bitmapData.Scan0;
int bytes = Math.Abs(bitmapData.Stride) * this.bitmap.Height;
diff --git a/Examples/SharpMap.Demo.Wms/Scripts/leaflet.js b/Examples/SharpMap.Demo.Wms/Scripts/leaflet.js
index fb79a997..8f5765b3 100644
--- a/Examples/SharpMap.Demo.Wms/Scripts/leaflet.js
+++ b/Examples/SharpMap.Demo.Wms/Scripts/leaflet.js
@@ -7616,4 +7616,4 @@ L.Map.include({
-}(this));
\ No newline at end of file
+}(this));
diff --git a/Examples/SharpMap.Demo.Wms/Scripts/script_buildings.js b/Examples/SharpMap.Demo.Wms/Scripts/script_buildings.js
index 732c770d..bd0f5dd1 100644
--- a/Examples/SharpMap.Demo.Wms/Scripts/script_buildings.js
+++ b/Examples/SharpMap.Demo.Wms/Scripts/script_buildings.js
@@ -1,11 +1,10 @@
$(document).ready(function () {
- var map = new L.Map('map'), zoom = 16, cloudmade, buildings;
- cloudmade = new L.TileLayer(['http://{s}tile.cloudmade.com', '/1a235b638b614b458deeb77c7dae4f80', '/998/256/{z}/{x}/{y}.png'].join(''), {
- maxZoom: 18,
- subdomains: ['a.', 'b.', 'c.', '']
- });
- map.addLayer(cloudmade);
-
+ var map = new L.Map('map'), zoom = 16;
+ var osm = new L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
+ attribution: '© OpenStreetMap contributors'
+ })
+ map.addLayer(osm);
+
$('#link1').click(function () {
map.setView(new L.LatLng(52.52111, 13.40988), zoom);
}).click();
@@ -16,6 +15,6 @@
map.setView(new L.LatLng(52.50983, 13.37455), zoom);
});
- buildings = new OSMBuildings(map);
+ var buildings = new OSMBuildings(map);
buildings.loadData('/buildings/getdata?w={w}&n={n}&e={e}&s={s}&z={z}');
-});
\ No newline at end of file
+});
diff --git a/Examples/SharpMap.Demo.Wms/Scripts/script_editor.js b/Examples/SharpMap.Demo.Wms/Scripts/script_editor.js
index a106154c..a2002875 100644
--- a/Examples/SharpMap.Demo.Wms/Scripts/script_editor.js
+++ b/Examples/SharpMap.Demo.Wms/Scripts/script_editor.js
@@ -63,4 +63,4 @@
editor.startEditMode();
};
init();
-});
\ No newline at end of file
+});
diff --git a/Examples/SharpMap.Demo.Wms/Scripts/script_geojs.js b/Examples/SharpMap.Demo.Wms/Scripts/script_geojs.js
index 7a231337..50e9dcb8 100644
--- a/Examples/SharpMap.Demo.Wms/Scripts/script_geojs.js
+++ b/Examples/SharpMap.Demo.Wms/Scripts/script_geojs.js
@@ -12,7 +12,7 @@ $(document).ready(function () {
options = {
wms: 'WMS',
controls: [],
- projection: 'EPSG:900913',
+ projection: 'EPSG:3857',
displayProjection: 'EPSG:4326',
format: 'text/json'
};
diff --git a/Examples/SharpMap.Demo.Wms/Scripts/script_ll.js b/Examples/SharpMap.Demo.Wms/Scripts/script_ll.js
index ba935259..508839c1 100644
--- a/Examples/SharpMap.Demo.Wms/Scripts/script_ll.js
+++ b/Examples/SharpMap.Demo.Wms/Scripts/script_ll.js
@@ -3,9 +3,8 @@
map = new L.Map('map'), center, url, cloudmade;
map.on('load', function (e) {
- var bounds, jsurl, options, layer;
- bounds = e.target.getBounds();
- jsurl = [
+ var bounds = e.target.getBounds();
+ var jsurl = [
'/json.ashx?MAP_TYPE=DEF&BBOX=',
bounds._southWest.lat, ',',
bounds._southWest.lng, ',',
@@ -13,7 +12,7 @@
bounds._northEast.lng
].join('');
- options = {
+ var options = {
radius: 8,
fillColor: "#FF7800",
color: "#000000",
@@ -21,7 +20,7 @@
opacity: 1,
fillOpacity: 0.8
};
- layer = new L.GeoJSON(null, {
+ var layer = new L.GeoJSON(null, {
pointToLayer: function (f) {
var raw = f.geometry.coordinates;
var ll = new L.LatLng(raw[1], raw[0]);
@@ -50,15 +49,11 @@
});
});
- center = new L.LatLng(lat, lon);
+ var center = new L.LatLng(lat, lon);
map.setView(center, zoom);
- url = ['http://{s}tile.cloudmade.com', '/1a235b638b614b458deeb77c7dae4f80', '/998/256/{z}/{x}/{y}.png'].join('');
- cloudmade = new L.TileLayer(url, {
- maxZoom: 18,
- subdomains: ['a.', 'b.', 'c.', '']
- });
- map.addLayer(cloudmade);
-
-
-});
\ No newline at end of file
+ var osm = new L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
+ attribution: '© OpenStreetMap contributors'
+ })
+ map.addLayer(osm);
+});
diff --git a/Examples/SharpMap.Demo.Wms/Scripts/script_tc.js b/Examples/SharpMap.Demo.Wms/Scripts/script_tc.js
index 02ab3bdd..15ce3a79 100644
--- a/Examples/SharpMap.Demo.Wms/Scripts/script_tc.js
+++ b/Examples/SharpMap.Demo.Wms/Scripts/script_tc.js
@@ -4,12 +4,10 @@
var zoom = 10;
var map = new L.Map('map');
- var cmurl = ['http://{s}tile.cloudmade.com', '/1a235b638b614b458deeb77c7dae4f80', '/997/256/{z}/{x}/{y}.png'].join('');
- var cloudmade = new L.TileLayer(cmurl, {
- maxZoom: 18,
- subdomains: ['a.', 'b.', 'c.', '']
- });
- map.addLayer(cloudmade);
+ var osm = new L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
+ attribution: '© OpenStreetMap contributors'
+ })
+ map.addLayer(osm);
var tile = new L.TileLayer.TileJSON({
debug: false,
@@ -60,4 +58,4 @@
var center = new L.LatLng(lat, lon);
map.setView(center, zoom);
-});
\ No newline at end of file
+});
diff --git a/Examples/SharpMap.Demo.Wms/Scripts/script_utfgrid.js b/Examples/SharpMap.Demo.Wms/Scripts/script_utfgrid.js
index 5b2068a3..646930a6 100644
--- a/Examples/SharpMap.Demo.Wms/Scripts/script_utfgrid.js
+++ b/Examples/SharpMap.Demo.Wms/Scripts/script_utfgrid.js
@@ -83,4 +83,4 @@ $(document).ready(function () {
map.setCenter(center, zoom);
};
init();
-});
\ No newline at end of file
+});
diff --git a/Examples/SharpMap.Demo.Wms/SharpMap.Demo.Wms.csproj b/Examples/SharpMap.Demo.Wms/SharpMap.Demo.Wms.csproj
index 69545110..2b6863a8 100644
--- a/Examples/SharpMap.Demo.Wms/SharpMap.Demo.Wms.csproj
+++ b/Examples/SharpMap.Demo.Wms/SharpMap.Demo.Wms.csproj
@@ -58,33 +58,40 @@
..\..\packages\Common.Logging.Core.3.4.1\lib\net40\Common.Logging.Core.dll
-
- ..\..\packages\GeoAPI.Core.1.7.5\lib\net40-client\GeoAPI.dll
-
-
- ..\..\packages\GeoAPI.CoordinateSystems.1.7.5\lib\net40-client\GeoAPI.CoordinateSystems.dll
-
-
- ..\..\packages\NetTopologySuite.Core.1.15.3\lib\net45\NetTopologySuite.dll
+
+ ..\..\packages\Microsoft.Web.Infrastructure.2.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
-
- ..\..\packages\NetTopologySuite.CoordinateSystems.1.15.3\lib\net45\NetTopologySuite.CoordinateSystems.dll
+
+ ..\..\packages\NetTopologySuite.2.5.0\lib\netstandard2.0\NetTopologySuite.dll
-
- ..\..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll
+
+ ..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
-
- ..\..\packages\ProjNET4GeoAPI.1.4.1\lib\net40-client\ProjNET.dll
+
+ ..\..\packages\ProjNET.2.0.0\lib\netstandard2.0\ProjNET.dll
+
+ ..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
+
-
- ..\..\packages\System.Data.SQLite.Core.1.0.112.0\lib\net46\System.Data.SQLite.dll
+
+ ..\..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.116.0\lib\net46\System.Data.SQLite.dll
+
+
+ ..\..\packages\System.Drawing.Common.6.0.0\lib\net461\System.Drawing.Common.dll
-
- ..\..\packages\System.Drawing.Common.4.6.0\lib\net461\System.Drawing.Common.dll
+
+ ..\..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll
+
+
+
+ ..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
+
+
+ ..\..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
@@ -95,34 +102,30 @@
- ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll
+ ..\..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.Helpers.dll
-
- ..\..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll
+
+ ..\..\packages\Microsoft.AspNet.Mvc.5.2.9\lib\net45\System.Web.Mvc.dll
- ..\..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll
+ ..\..\packages\Microsoft.AspNet.Razor.3.2.9\lib\net45\System.Web.Razor.dll
- ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll
+ ..\..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.dll
- ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll
+ ..\..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.Deployment.dll
- ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll
+ ..\..\packages\Microsoft.AspNet.WebPages.3.2.9\lib\net45\System.Web.WebPages.Razor.dll
-
- ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
- True
-
@@ -758,11 +761,11 @@
-
+
- Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
+
\ No newline at end of file
diff --git a/Examples/SharpMap.Demo.Wms/Web.config b/Examples/SharpMap.Demo.Wms/Web.config
index f1efc51d..197989a6 100644
--- a/Examples/SharpMap.Demo.Wms/Web.config
+++ b/Examples/SharpMap.Demo.Wms/Web.config
@@ -1,13 +1,11 @@
-
+
-
+
-
-
+
+
/// A GraphicsPath
- public static GraphicsPath LineStringToPath(ILineString lineString, MapViewport map/*, bool useClipping*/)
+ public static GraphicsPath LineStringToPath(LineString lineString, MapViewport map/*, bool useClipping*/)
{
var gp = new GraphicsPath(FillMode.Alternate);
- gp.AddLines(lineString.TransformToImage(map));
+ gp.AddLines(lineString.TransformToImage(map));
return gp;
}
}
diff --git a/SharpMap/Layers/Layer.cs b/SharpMap/Layers/Layer.cs
index de842a52..03f82983 100644
--- a/SharpMap/Layers/Layer.cs
+++ b/SharpMap/Layers/Layer.cs
@@ -15,15 +15,14 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-using System;
-using System.Drawing;
-using GeoAPI.CoordinateSystems.Transformations;
-using GeoAPI.Geometries;
-using NetTopologySuite.Geometries.Utilities;
+using NetTopologySuite.CoordinateSystems.Transformations;
+using NetTopologySuite.Geometries;
+using ProjNet.CoordinateSystems.Transformations;
using SharpMap.Base;
using SharpMap.Rendering;
using SharpMap.Styles;
-using SharpMap.Utilities;
+using System;
+using System.Drawing;
namespace SharpMap.Layers
{
@@ -101,8 +100,8 @@ protected virtual void OnLayerNameChanged(EventArgs eventArgs)
private ICoordinateTransformation _coordinateTransform;
private ICoordinateTransformation _reverseCoordinateTransform;
- private IGeometryFactory _sourceFactory;
- private IGeometryFactory _targetFactory;
+ private GeometryFactory _sourceFactory;
+ private GeometryFactory _targetFactory;
private string _layerName;
private string _layerTitle;
@@ -111,13 +110,13 @@ protected virtual void OnLayerNameChanged(EventArgs eventArgs)
private int? _targetSrid;
[field: NonSerialized]
private bool _shouldNotResetCt;
-
+
///
/// The area of the map that was covered by this layer
///
[field: NonSerialized]
protected RectangleF CanvasArea = RectangleF.Empty;
-
+
// ReSharper disable PublicConstructorInAbstractClass
///
/// Creates an instance of this class using the given Style
@@ -150,7 +149,7 @@ protected override void ReleaseManagedResources()
}
///
- /// Gets or sets the applied
+ /// Gets or sets the applied
/// to this vectorlayer prior to rendering
///
public virtual ICoordinateTransformation CoordinateTransformation
@@ -185,7 +184,7 @@ public virtual ICoordinateTransformation CoordinateTransformation
}
else
{
- _sourceFactory = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory(SRID);
+ _sourceFactory = NetTopologySuite.NtsGeometryServices.Instance.CreateGeometryFactory(SRID);
// causes targetFactory to be cleared
TargetSRID = 0;
}
@@ -230,15 +229,15 @@ protected virtual void OnCoordinateTransformationChanged(EventArgs e)
///
/// Gets the geometry factory to create source geometries
///
- protected internal IGeometryFactory SourceFactory { get { return _sourceFactory ?? (_sourceFactory = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory(SRID)); } }
+ protected internal GeometryFactory SourceFactory { get { return _sourceFactory ?? (_sourceFactory = NetTopologySuite.NtsGeometryServices.Instance.CreateGeometryFactory(SRID)); } }
///
/// Gets the geometry factory to create target geometries
///
- protected internal IGeometryFactory TargetFactory { get { return _targetFactory ?? _sourceFactory; } }
+ protected internal GeometryFactory TargetFactory { get { return _targetFactory ?? _sourceFactory; } }
///
- /// Certain Transformations cannot be inverted in ProjNet, in those cases use this property to set the reverse (of CoordinateTransformation) to fetch data from Datasource
+ /// Certain Transformations cannot be inverted in ProjNet, in those cases use this property to set the reverse (of CoordinateTransformation) to fetch data from Datasource
///
/// If your CoordinateTransformation can be inverted you can leave this property to null
///
@@ -302,7 +301,7 @@ public virtual int SRID
{
_srid = value;
- _sourceFactory = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory(value);
+ _sourceFactory = NetTopologySuite.NtsGeometryServices.Instance.CreateGeometryFactory(value);
if (!_shouldNotResetCt)
_coordinateTransform = _reverseCoordinateTransform = null;
@@ -327,7 +326,7 @@ public virtual int TargetSRID
else if (_targetSrid != value)
{
_targetSrid = value;
- _targetFactory = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory(value);
+ _targetFactory = NetTopologySuite.NtsGeometryServices.Instance.CreateGeometryFactory(value);
}
if (!_shouldNotResetCt)
_coordinateTransform = _reverseCoordinateTransform = null;
@@ -367,7 +366,7 @@ public virtual void Render(Graphics g, MapViewport map)
Rectangle ILayerEx.Render(Graphics g, MapViewport map)
{
Render(g, map, out var canvasArea);
- return canvasArea;
+ return canvasArea;
}
private bool _renderCalled;
@@ -381,12 +380,12 @@ protected virtual void Render(Graphics g, MapViewport mvp, out Rectangle affecte
{
if (_renderCalled)
return;
-
+
_renderCalled = true;
Render(g, mvp);
_renderCalled = false;
- var mapRect = new Rectangle(new Point(0, 0), mvp.Size);
+ var mapRect = new Rectangle(new System.Drawing.Point(0, 0), mvp.Size);
if (CanvasArea.IsEmpty)
{
affectedArea = mapRect;
@@ -400,7 +399,7 @@ protected virtual void Render(Graphics g, MapViewport mvp, out Rectangle affecte
CanvasArea = RectangleF.Empty;
}
-
+
OnLayerRendered(g);
}
@@ -423,16 +422,16 @@ protected static Rectangle ToGraphicsCanvas(RectangleF area, System.Drawing.Draw
// This is the area of the graphics canvas that needs to be refreshed when invalidating the image.
var affectedArea = area.ToRectangle();
-// // proof of concept: draw affected area to screen aligned with graphics canvas
-// using (var orig = g.Transform.Clone())
-// {
-// var areaToBeRendered = affectedArea;
-// areaToBeRendered.Intersect(mapRect);
-// g.ResetTransform();
-// g.DrawRectangle(new Pen(Color.Red, 3f) {Alignment = System.Drawing.Drawing2D.PenAlignment.Inset},
-// areaToBeRendered);
-// g.Transform = orig;
-// }
+ // // proof of concept: draw affected area to screen aligned with graphics canvas
+ // using (var orig = g.Transform.Clone())
+ // {
+ // var areaToBeRendered = affectedArea;
+ // areaToBeRendered.Intersect(mapRect);
+ // g.ResetTransform();
+ // g.DrawRectangle(new Pen(Color.Red, 3f) {Alignment = System.Drawing.Drawing2D.PenAlignment.Inset},
+ // areaToBeRendered);
+ // g.Transform = orig;
+ // }
// allow for bleed and/or minor labelling misdemeanours
affectedArea.Inflate(1, 1);
@@ -583,7 +582,7 @@ public void RaiseRenderRequired()
/// Utility function to transform given envelope using a specific transformation
///
/// The source envelope
- /// The to use.
+ /// The to use.
/// The target envelope
protected virtual Envelope ToTarget(Envelope envelope, ICoordinateTransformation coordinateTransformation)
{
@@ -633,7 +632,7 @@ protected virtual Envelope ToSource(Envelope envelope)
///
/// A geometry
/// The transformed geometry
- protected virtual IGeometry ToTarget(IGeometry geometry)
+ protected virtual Geometry ToTarget(Geometry geometry)
{
if (geometry.SRID == TargetSRID)
return geometry;
@@ -651,7 +650,7 @@ protected virtual IGeometry ToTarget(IGeometry geometry)
///
/// A geometry
/// The transformed geometry
- protected virtual IGeometry ToSource(IGeometry geometry)
+ protected virtual Geometry ToSource(Geometry geometry)
{
if (geometry.SRID == SRID)
return geometry;
diff --git a/SharpMap/Layers/LayerCollection.cs b/SharpMap/Layers/LayerCollection.cs
index 9d889a88..e30f8f7d 100644
--- a/SharpMap/Layers/LayerCollection.cs
+++ b/SharpMap/Layers/LayerCollection.cs
@@ -73,7 +73,7 @@ public LayerCollection Clone()
{
var cloneable = lay as ICloneable;
if (cloneable != null)
- newColl.Add((ILayer) cloneable.Clone());
+ newColl.Add((ILayer)cloneable.Clone());
else
newColl.Add(lay);
}
diff --git a/SharpMap/Layers/LayerGroup.cs b/SharpMap/Layers/LayerGroup.cs
index e5a24ce3..b29d29d2 100644
--- a/SharpMap/Layers/LayerGroup.cs
+++ b/SharpMap/Layers/LayerGroup.cs
@@ -15,15 +15,15 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using NetTopologySuite.Geometries;
+using ProjNet.CoordinateSystems.Transformations;
+using SharpMap.Data;
+using SharpMap.Styles;
using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Linq;
-using SharpMap.Data;
-using GeoAPI.Geometries;
-using SharpMap.Styles;
-using GeoAPI.CoordinateSystems.Transformations;
namespace SharpMap.Layers
{
@@ -121,13 +121,13 @@ public override Envelope Envelope
var layerEnvelope = layers[i].Envelope;
if (layerEnvelope != null)
{
- if(bbox == null)
+ if (bbox == null)
bbox = new Envelope(layerEnvelope);
else
bbox.ExpandToInclude(layerEnvelope);
}
}
-
+
return bbox;
}
}
@@ -141,7 +141,7 @@ public override Envelope Envelope
public virtual bool SkipTransformationPropagation { get; set; }
///
- /// Gets or sets the applied
+ /// Gets or sets the applied
/// to this vectorlayer prior to rendering
///
@@ -163,7 +163,7 @@ public override ICoordinateTransformation CoordinateTransformation
}
///
- /// Certain Transformations cannot be inverted in ProjNet, in those cases use this property to set the reverse (of CoordinateTransformation) to fetch data from Datasource
+ /// Certain Transformations cannot be inverted in ProjNet, in those cases use this property to set the reverse (of CoordinateTransformation) to fetch data from Datasource
///
/// If your CoordinateTransformation can be inverted you can leave this property to null
///
@@ -236,7 +236,7 @@ protected override void ReleaseManagedResources()
var layers = GetSnapshot();
foreach (var layer in layers.OfType().Where(layer => layer != null))
layer.Dispose();
-
+
Layers.Clear();
base.ReleaseManagedResources();
}
@@ -263,8 +263,8 @@ public virtual ILayer GetLayerByName(string name)
public override void Render(Graphics g, MapViewport map)
{
var layers = GetSnapshot();
- var compare = VisibilityUnits == VisibilityUnits.ZoomLevel
- ? map.Zoom
+ var compare = VisibilityUnits == VisibilityUnits.ZoomLevel
+ ? map.Zoom
: map.GetMapScale((int)g.DpiX);
foreach (var layer in layers)
@@ -275,7 +275,7 @@ public override void Render(Graphics g, MapViewport map)
}
}
- #region Implementation of ICanQueryLayer
+ #region Implementation of ICanQueryLayer
///
/// Returns the data associated with all the geometries that are intersected by 'geom'
@@ -297,7 +297,7 @@ public virtual void ExecuteIntersectionQuery(Envelope box, FeatureDataSet ds)
///
/// Geometry to intersect with
/// FeatureDataSet to fill data into
- public virtual void ExecuteIntersectionQuery(IGeometry geometry, FeatureDataSet ds)
+ public virtual void ExecuteIntersectionQuery(Geometry geometry, FeatureDataSet ds)
{
var layers = GetSnapshot();
@@ -307,7 +307,7 @@ public virtual void ExecuteIntersectionQuery(IGeometry geometry, FeatureDataSet
}
}
- #endregion
+ #endregion
///
/// Create an empty new LayerGroup instance.
@@ -350,7 +350,7 @@ public virtual object Clone()
{
var cloneable = layer as ICloneable;
if (cloneable != null)
- clonedGroup.Layers.Add((ILayer) cloneable.Clone());
+ clonedGroup.Layers.Add((ILayer)cloneable.Clone());
else
clonedGroup.Layers.Add(layer);
}
diff --git a/SharpMap/Layers/Symbolizer/AnyGeometryVectorLayer.cs b/SharpMap/Layers/Symbolizer/AnyGeometryVectorLayer.cs
index d708c65c..b64c4e26 100644
--- a/SharpMap/Layers/Symbolizer/AnyGeometryVectorLayer.cs
+++ b/SharpMap/Layers/Symbolizer/AnyGeometryVectorLayer.cs
@@ -1,7 +1,7 @@
-using System;
-using GeoAPI.Geometries;
+using NetTopologySuite.Geometries;
using SharpMap.Data.Providers;
using SharpMap.Rendering.Symbolizer;
+using System;
namespace SharpMap.Layers.Symbolizer
{
@@ -9,7 +9,7 @@ namespace SharpMap.Layers.Symbolizer
/// Vector layer class than can symbolize any type of geometry
///
[Serializable]
- public class AnyGeometryVectorLayer : BaseVectorLayer
+ public class AnyGeometryVectorLayer : BaseVectorLayer
{
///
/// Creates an instance of this class
@@ -17,7 +17,7 @@ public class AnyGeometryVectorLayer : BaseVectorLayer
/// The layer's name
public AnyGeometryVectorLayer(string layerName)
: this(layerName, null)
- {}
+ { }
///
/// Creates an instance of this class
@@ -26,11 +26,11 @@ public AnyGeometryVectorLayer(string layerName)
/// The layers's datasource
public AnyGeometryVectorLayer(string layerName, IProvider datasource)
: this(layerName, datasource, new GeometrySymbolizer
- {
- PointSymbolizer = new RasterPointSymbolizer(),
- LineSymbolizer = new BasicLineSymbolizer(),
- PolygonSymbolizer = new BasicPolygonSymbolizer()
- })
+ {
+ PointSymbolizer = new RasterPointSymbolizer(),
+ LineSymbolizer = new BasicLineSymbolizer(),
+ PolygonSymbolizer = new BasicPolygonSymbolizer()
+ })
{
}
diff --git a/SharpMap/Layers/Symbolizer/BaseVectorLayer.cs b/SharpMap/Layers/Symbolizer/BaseVectorLayer.cs
index 35da8071..e6f5a85c 100644
--- a/SharpMap/Layers/Symbolizer/BaseVectorLayer.cs
+++ b/SharpMap/Layers/Symbolizer/BaseVectorLayer.cs
@@ -1,14 +1,14 @@
+using Common.Logging;
+using NetTopologySuite.Geometries;
+using SharpMap.Data;
+using SharpMap.Data.Providers;
+using SharpMap.Rendering.Symbolizer;
using System;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Runtime.CompilerServices;
-using GeoAPI.Geometries;
-using SharpMap.Data;
-using SharpMap.Data.Providers;
-using SharpMap.Rendering.Symbolizer;
-using IGeometry = GeoAPI.Geometries.IGeometry;
-using Common.Logging;
+using Geometry = NetTopologySuite.Geometries.Geometry;
namespace SharpMap.Layers.Symbolizer
{
@@ -18,18 +18,18 @@ namespace SharpMap.Layers.Symbolizer
/// The geometry type
[Serializable]
public abstract class BaseVectorLayer : Layer, ICanQueryLayer
- where TGeometry : class//, IGeometry
+ where TGeometry : class//, Geometry
{
#region Private fields
private readonly object _dataSourceLock = new object();
private IProvider _dataSource;
- private Collection _geometries;
+ private Collection _geometries;
#endregion
static readonly ILog logger = LogManager.GetLogger(typeof(BaseVectorLayer));
-
+
///
/// Creates an instance of this class
///
@@ -95,7 +95,7 @@ public override void Render(Graphics g, MapViewport map)
// Initialize Rendering
OnRender(g, map);
-
+
// Render
OnRendering(g, map);
@@ -227,7 +227,7 @@ public void ExecuteIntersectionQuery(Envelope box, FeatureDataSet ds)
///
/// Geometry to intersect with
/// FeatureDataSet to fill data into
- public void ExecuteIntersectionQuery(IGeometry geometry, FeatureDataSet ds)
+ public void ExecuteIntersectionQuery(Geometry geometry, FeatureDataSet ds)
{
geometry = ToSource(geometry);
diff --git a/SharpMap/Layers/Symbolizer/LinealVectorLayer.cs b/SharpMap/Layers/Symbolizer/LinealVectorLayer.cs
index 0e0fa2f4..fa43be26 100644
--- a/SharpMap/Layers/Symbolizer/LinealVectorLayer.cs
+++ b/SharpMap/Layers/Symbolizer/LinealVectorLayer.cs
@@ -1,7 +1,7 @@
-using System;
-using GeoAPI.Geometries;
+using NetTopologySuite.Geometries;
using SharpMap.Data.Providers;
using SharpMap.Rendering.Symbolizer;
+using System;
namespace SharpMap.Layers.Symbolizer
{
@@ -9,7 +9,7 @@ namespace SharpMap.Layers.Symbolizer
/// A vector layer class that can symbolize lineal geometries
///
[Serializable]
- public class LinealVectorLayer : BaseVectorLayer
+ public class LinealVectorLayer : BaseVectorLayer
{
///
/// Creates an instance of this class
diff --git a/SharpMap/Layers/Symbolizer/PolygonalVectorLayer.cs b/SharpMap/Layers/Symbolizer/PolygonalVectorLayer.cs
index 4e1a3798..5cf16311 100644
--- a/SharpMap/Layers/Symbolizer/PolygonalVectorLayer.cs
+++ b/SharpMap/Layers/Symbolizer/PolygonalVectorLayer.cs
@@ -1,7 +1,7 @@
-using System;
-using GeoAPI.Geometries;
+using NetTopologySuite.Geometries;
using SharpMap.Data.Providers;
using SharpMap.Rendering.Symbolizer;
+using System;
namespace SharpMap.Layers.Symbolizer
{
@@ -9,14 +9,14 @@ namespace SharpMap.Layers.Symbolizer
/// A vector layer class that can symbolize polygonal geometries.
///
[Serializable]
- public class PolygonalVectorLayer : BaseVectorLayer
+ public class PolygonalVectorLayer : BaseVectorLayer
{
///
/// Creates an instance of this class
///
/// The layers's name
- public PolygonalVectorLayer(string layerName)
+ public PolygonalVectorLayer(string layerName)
: this(layerName, null)
{
}
diff --git a/SharpMap/Layers/Symbolizer/PuntalVectorLayer.cs b/SharpMap/Layers/Symbolizer/PuntalVectorLayer.cs
index 7127c6f6..d331167c 100644
--- a/SharpMap/Layers/Symbolizer/PuntalVectorLayer.cs
+++ b/SharpMap/Layers/Symbolizer/PuntalVectorLayer.cs
@@ -1,7 +1,7 @@
-using System;
-using GeoAPI.Geometries;
+using NetTopologySuite.Geometries;
using SharpMap.Data.Providers;
using SharpMap.Rendering.Symbolizer;
+using System;
namespace SharpMap.Layers.Symbolizer
{
diff --git a/SharpMap/Layers/TiledWmsLayer.cs b/SharpMap/Layers/TiledWmsLayer.cs
index c98144f7..b570ddc7 100644
--- a/SharpMap/Layers/TiledWmsLayer.cs
+++ b/SharpMap/Layers/TiledWmsLayer.cs
@@ -16,6 +16,11 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using Common.Logging;
+using NetTopologySuite.Geometries;
+using SharpMap.Rendering.Exceptions;
+using SharpMap.Web.Wms;
+using SharpMap.Web.Wms.Tiling;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -26,12 +31,6 @@
using System.IO;
using System.Net;
using System.Text;
-using GeoAPI.Geometries;
-using SharpMap.Rendering.Exceptions;
-using SharpMap.Utilities;
-using SharpMap.Web.Wms;
-using SharpMap.Web.Wms.Tiling;
-using Common.Logging;
namespace SharpMap.Layers
{
@@ -51,10 +50,10 @@ namespace SharpMap.Layers
/// TiledWmsLayer tiledWmsLayer = new TiledWmsLayer("Metacarta", url);
/// tiledWmsLayer.TileSetsActive.Add(tiledWmsLayer.TileSets["satellite"].Name);
/// map.Layers.Add(tiledWmsLayer);
- /// map.ZoomToBox(new GeoAPI.Geometries.Envelope(-180.0, 180.0, -90.0, 90.0));
+ /// map.ZoomToBox(new NetTopologySuite.Geometries.Envelope(-180.0, 180.0, -90.0, 90.0));
///
///
- [Obsolete("use TileLayer instead") ]
+ [Obsolete("use TileLayer instead")]
public class TiledWmsLayer : Layer, ILayer
{
@@ -258,13 +257,13 @@ public override void Render(Graphics g, MapViewport map)
PointF destMin = map.WorldToImage(tileExtent.Min());
PointF destMax = map.WorldToImage(tileExtent.Max());
- double minX = (int) Math.Round(destMin.X);
- double minY = (int) Math.Round(destMax.Y);
- double maxX = (int) Math.Round(destMax.X);
- double maxY = (int) Math.Round(destMin.Y);
+ double minX = (int)Math.Round(destMin.X);
+ double minY = (int)Math.Round(destMax.Y);
+ double maxX = (int)Math.Round(destMax.X);
+ double maxY = (int)Math.Round(destMin.Y);
g.DrawImage(bitmap,
- new Rectangle((int) minX, (int) minY, (int) (maxX - minX), (int) (maxY - minY)),
+ new Rectangle((int)minX, (int)minY, (int)(maxX - minX), (int)(maxY - minY)),
0, 0, tileSet.Width, tileSet.Height,
GraphicsUnit.Pixel, _ImageAttributes);
}
@@ -286,7 +285,7 @@ public override void Render(Graphics g, MapViewport map)
/// Bounding box corresponding to the extent of the features in the layer
public override Envelope Envelope
{
- get
+ get
{
return _WmsClient.Layer.LatLonBoundingBox; //TODO: no box is allowed in capabilities so check for it
}
@@ -336,7 +335,7 @@ private string GetRequestUrl(Envelope box, TileSet tileSet)
box.MinX, box.MinY, box.MaxX, box.MaxY);
strReq.AppendFormat("&WIDTH={0}&Height={1}", tileSet.Width, tileSet.Height);
strReq.Append("&LAYERS=");
- // LAYERS is set in caps because the current version of tilecache.py does not accept mixed case (a little bug)
+ // LAYERS is set in caps because the current version of tilecache.py does not accept mixed case (a little bug)
if (tileSet.Layers != null && tileSet.Layers.Count > 0)
{
foreach (string layer in tileSet.Layers)
@@ -395,13 +394,13 @@ private Bitmap WmsGetMap(Envelope extent, TileSet tileSet)
try
{
- webResponse = (HttpWebResponse) webRequest.GetResponse();
+ webResponse = (HttpWebResponse)webRequest.GetResponse();
if (webResponse.ContentType.StartsWith("image"))
{
responseStream = webResponse.GetResponseStream();
- bitmap = (Bitmap) Bitmap.FromStream(responseStream);
- return (Bitmap) bitmap;
+ bitmap = (Bitmap)Bitmap.FromStream(responseStream);
+ return (Bitmap)bitmap;
}
else
{
@@ -477,7 +476,7 @@ private static Rectangle RoundRectangle(RectangleF dest)
double minY = Math.Round(dest.Y);
double maxX = Math.Round(dest.Right);
double maxY = Math.Round(dest.Bottom);
- return new Rectangle((int) minX, (int) minY, (int) (maxX - minX), (int) (maxY - minY));
+ return new Rectangle((int)minX, (int)minY, (int)(maxX - minX), (int)(maxY - minY));
}
}
}
diff --git a/SharpMap/Layers/VariableLayerCollection.cs b/SharpMap/Layers/VariableLayerCollection.cs
index c1c6de99..e1049503 100644
--- a/SharpMap/Layers/VariableLayerCollection.cs
+++ b/SharpMap/Layers/VariableLayerCollection.cs
@@ -41,7 +41,7 @@ public enum LayerCollectionType
public class VariableLayerCollection : LayerCollection
{
//private readonly LayerCollection _variableLayers;
-
+
//[NonSerialized]
//private Timer _timer;
diff --git a/SharpMap/Layers/VectorLayer.cs b/SharpMap/Layers/VectorLayer.cs
index 9fd8ee6f..92e00aa4 100644
--- a/SharpMap/Layers/VectorLayer.cs
+++ b/SharpMap/Layers/VectorLayer.cs
@@ -15,18 +15,18 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-using System;
-using System.Collections.ObjectModel;
-using System.Drawing;
-using System.Drawing.Drawing2D;
+using Common.Logging;
+using NetTopologySuite.Geometries;
using SharpMap.Data;
using SharpMap.Data.Providers;
-using GeoAPI.Geometries;
using SharpMap.Rendering;
using SharpMap.Rendering.Thematics;
using SharpMap.Styles;
+using System;
using System.Collections.Generic;
-using Common.Logging;
+using System.Collections.ObjectModel;
+using System.Drawing;
+using System.Drawing.Drawing2D;
namespace SharpMap.Layers
{
@@ -89,8 +89,8 @@ public ITheme Theme
/// Specifies whether polygons should be clipped prior to rendering
///
///
- /// Clipping will clip and
- /// to the current view prior
+ /// Clipping will clip and
+ /// to the current view prior
/// to rendering the object.
/// Enabling clipping might improve rendering speed if you are rendering
/// only small portions of very large objects.
@@ -269,7 +269,7 @@ protected void RenderInternal(Graphics g, MapViewport map, Envelope envelope, IT
evalStyle = new ThemeExEvaluator((IThemeEx)theme).GetStyle;
else
evalStyle = new ThemeEvaluator(theme).GetStyle;
-
+
foreach (FeatureDataTable features in ds.Tables)
{
// Transform geometries if necessary
@@ -301,14 +301,14 @@ protected void RenderInternal(Graphics g, MapViewport map, Envelope envelope, IT
if (outlineStyle != null)
{
//Draw background of all line-outlines first
- if (feature.Geometry is ILineString)
+ if (feature.Geometry is LineString)
{
- canvasArea = VectorRenderer.DrawLineStringEx(g, feature.Geometry as ILineString, outlineStyle.Outline,
+ canvasArea = VectorRenderer.DrawLineStringEx(g, feature.Geometry as LineString, outlineStyle.Outline,
map, outlineStyle.LineOffset);
}
- else if (feature.Geometry is IMultiLineString)
+ else if (feature.Geometry is MultiLineString)
{
- canvasArea = VectorRenderer.DrawMultiLineStringEx(g, feature.Geometry as IMultiLineString,
+ canvasArea = VectorRenderer.DrawMultiLineStringEx(g, feature.Geometry as MultiLineString,
outlineStyle.Outline, map, outlineStyle.LineOffset);
}
combinedArea = canvasArea.ExpandToInclude(combinedArea);
@@ -374,7 +374,7 @@ protected void RenderInternal(Graphics g, MapViewport map, Envelope envelope)
var canvasArea = RectangleF.Empty;
var combinedArea = RectangleF.Empty;
- Collection geoms = null;
+ Collection geoms = null;
foreach (var style in stylesToRender)
{
@@ -428,17 +428,17 @@ protected void RenderInternal(Graphics g, MapViewport map, Envelope envelope)
if (geom != null)
{
//Draw background of all line-outlines first
- if (geom is ILineString)
- canvasArea = VectorRenderer.DrawLineStringEx(g, geom as ILineString, vStyle.Outline, map, vStyle.LineOffset);
- else if (geom is IMultiLineString)
- canvasArea = VectorRenderer.DrawMultiLineStringEx(g, geom as IMultiLineString, vStyle.Outline, map, vStyle.LineOffset);
+ if (geom is LineString)
+ canvasArea = VectorRenderer.DrawLineStringEx(g, geom as LineString, vStyle.Outline, map, vStyle.LineOffset);
+ else if (geom is MultiLineString)
+ canvasArea = VectorRenderer.DrawMultiLineStringEx(g, geom as MultiLineString, vStyle.Outline, map, vStyle.LineOffset);
combinedArea = canvasArea.ExpandToInclude(combinedArea);
}
}
}
}
- foreach (IGeometry geom in geoms)
+ foreach (Geometry geom in geoms)
{
if (geom != null)
{
@@ -492,7 +492,7 @@ public static IEnumerable GetStylesToRender(IStyle style)
/// The map
/// The feature's geometry
/// The style to apply
- protected void RenderGeometry(Graphics g, MapViewport map, IGeometry feature, VectorStyle style)
+ protected void RenderGeometry(Graphics g, MapViewport map, Geometry feature, VectorStyle style)
{
RenderGeometryEx(g, map, feature, style);
}
@@ -504,7 +504,7 @@ protected void RenderGeometry(Graphics g, MapViewport map, IGeometry feature, Ve
/// The map
/// The feature's geometry
/// The style to apply
- protected RectangleF RenderGeometryEx(Graphics g, MapViewport map, IGeometry feature, VectorStyle style)
+ protected RectangleF RenderGeometryEx(Graphics g, MapViewport map, Geometry feature, VectorStyle style)
{
if (feature == null) return RectangleF.Empty;
@@ -513,62 +513,62 @@ protected RectangleF RenderGeometryEx(Graphics g, MapViewport map, IGeometry fea
{
case OgcGeometryType.Polygon:
if (style.EnableOutline)
- return VectorRenderer.DrawPolygonEx(g, (IPolygon)feature, style.Fill, style.Outline, _clippingEnabled,
+ return VectorRenderer.DrawPolygonEx(g, (Polygon)feature, style.Fill, style.Outline, _clippingEnabled,
map);
else
- return VectorRenderer.DrawPolygonEx(g, (IPolygon)feature, style.Fill, null, _clippingEnabled, map);
+ return VectorRenderer.DrawPolygonEx(g, (Polygon)feature, style.Fill, null, _clippingEnabled, map);
case OgcGeometryType.MultiPolygon:
if (style.EnableOutline)
- return VectorRenderer.DrawMultiPolygonEx(g, (IMultiPolygon)feature, style.Fill, style.Outline, _clippingEnabled, map);
- return VectorRenderer.DrawMultiPolygonEx(g, (IMultiPolygon)feature, style.Fill, null, _clippingEnabled, map);
+ return VectorRenderer.DrawMultiPolygonEx(g, (MultiPolygon)feature, style.Fill, style.Outline, _clippingEnabled, map);
+ return VectorRenderer.DrawMultiPolygonEx(g, (MultiPolygon)feature, style.Fill, null, _clippingEnabled, map);
case OgcGeometryType.LineString:
if (style.LineSymbolizer != null)
{
- style.LineSymbolizer.Render(map, (ILineString)feature, g);
- return RectangleF.Empty;
+ style.LineSymbolizer.Render(map, (LineString)feature, g);
+ return RectangleF.Empty;
}
- return VectorRenderer.DrawLineStringEx(g, (ILineString)feature, style.Line, map, style.LineOffset);
+ return VectorRenderer.DrawLineStringEx(g, (LineString)feature, style.Line, map, style.LineOffset);
case OgcGeometryType.MultiLineString:
if (style.LineSymbolizer != null)
{
- style.LineSymbolizer.Render(map, (IMultiLineString)feature, g);
+ style.LineSymbolizer.Render(map, (MultiLineString)feature, g);
return RectangleF.Empty;
}
- return VectorRenderer.DrawMultiLineStringEx(g, (IMultiLineString)feature, style.Line, map, style.LineOffset);
-
+ return VectorRenderer.DrawMultiLineStringEx(g, (MultiLineString)feature, style.Line, map, style.LineOffset);
+
case OgcGeometryType.Point:
if (style.PointSymbolizer != null)
- return VectorRenderer.DrawPointEx(style.PointSymbolizer, g, (IPoint)feature, map);
+ return VectorRenderer.DrawPointEx(style.PointSymbolizer, g, (NetTopologySuite.Geometries.Point)feature, map);
if (style.Symbol != null || style.PointColor == null)
- return VectorRenderer.DrawPointEx(g, (IPoint)feature, style.Symbol, style.SymbolScale, style.SymbolOffset,
+ return VectorRenderer.DrawPointEx(g, (NetTopologySuite.Geometries.Point)feature, style.Symbol, style.SymbolScale, style.SymbolOffset,
style.SymbolRotation, map);
- return VectorRenderer.DrawPointEx(g, (IPoint)feature, style.PointColor, style.PointSize, style.SymbolOffset, map);
+ return VectorRenderer.DrawPointEx(g, (NetTopologySuite.Geometries.Point)feature, style.PointColor, style.PointSize, style.SymbolOffset, map);
case OgcGeometryType.MultiPoint:
if (style.PointSymbolizer != null)
- return VectorRenderer.DrawMultiPointEx(style.PointSymbolizer, g, (IMultiPoint)feature, map);
-
+ return VectorRenderer.DrawMultiPointEx(style.PointSymbolizer, g, (MultiPoint)feature, map);
+
if (style.Symbol != null || style.PointColor == null)
- return VectorRenderer.DrawMultiPointEx(g, (IMultiPoint)feature, style.Symbol, style.SymbolScale, style.SymbolOffset, style.SymbolRotation, map);
+ return VectorRenderer.DrawMultiPointEx(g, (MultiPoint)feature, style.Symbol, style.SymbolScale, style.SymbolOffset, style.SymbolRotation, map);
- return VectorRenderer.DrawMultiPointEx(g, (IMultiPoint)feature, style.PointColor, style.PointSize, style.SymbolOffset, map);
+ return VectorRenderer.DrawMultiPointEx(g, (MultiPoint)feature, style.PointColor, style.PointSize, style.SymbolOffset, map);
case OgcGeometryType.GeometryCollection:
- var coll = (IGeometryCollection)feature;
+ var coll = (GeometryCollection)feature;
var combinedArea = RectangleF.Empty;
for (var i = 0; i < coll.NumGeometries; i++)
{
- IGeometry geom = coll[i];
+ Geometry geom = coll[i];
var canvasArea = RenderGeometryEx(g, map, geom, style);
combinedArea = canvasArea.ExpandToInclude(combinedArea);
}
return combinedArea;
-
+
}
throw new NotSupportedException();
}
@@ -609,7 +609,7 @@ public void ExecuteIntersectionQuery(Envelope box, FeatureDataSet ds)
///
/// Geometry to intersect with
/// FeatureDataSet to fill data into
- public void ExecuteIntersectionQuery(IGeometry geometry, FeatureDataSet ds)
+ public void ExecuteIntersectionQuery(Geometry geometry, FeatureDataSet ds)
{
geometry = ToSource(geometry);
diff --git a/SharpMap/Layers/WmsLayer.cs b/SharpMap/Layers/WmsLayer.cs
index ff264797..ac792418 100644
--- a/SharpMap/Layers/WmsLayer.cs
+++ b/SharpMap/Layers/WmsLayer.cs
@@ -15,19 +15,19 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using Common.Logging;
+using NetTopologySuite.Geometries;
+using SharpMap.CoordinateSystems;
+using SharpMap.Rendering.Exceptions;
+using SharpMap.Web.Wms;
using System;
-using System.Collections.ObjectModel;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Net;
using System.Text;
-using GeoAPI.Geometries;
-using SharpMap.CoordinateSystems;
-using SharpMap.Rendering.Exceptions;
-using SharpMap.Web.Wms;
-using Common.Logging;
namespace SharpMap.Layers
{
@@ -53,7 +53,7 @@ namespace SharpMap.Layers
/// myLayer.SetImageFormat(layWms.OutputFormats[0]);
/// myLayer.SRID = 4326;
/// myMap.Layers.Add(myLayer);
- /// myMap.Center = new GeoAPI.Geometries.Coordinate(0, 0);
+ /// myMap.Center = new NetTopologySuite.Geometries.Coordinate(0, 0);
/// myMap.Zoom = 360;
/// myMap.MaximumZoom = 360;
/// myMap.MinimumZoom = 0.1;
@@ -137,7 +137,7 @@ public WmsLayer(string layername, string url, TimeSpan cachetime, IWebProxy prox
///
public WmsLayer(string layername, string url, TimeSpan cachetime, IWebProxy proxy,
ICredentials credentials)
- :this(layername, GetClient(url, proxy, credentials, cachetime))
+ : this(layername, GetClient(url, proxy, credentials, cachetime))
{
}
@@ -207,7 +207,7 @@ public void ForceOnlineResourceUrl(string url)
for (int i = 0; i < _wmsClient.GetMapRequests.Length; i++)
{
_wmsClient.GetMapRequests[i].OnlineResource = url;
- }
+ }
}
@@ -369,7 +369,7 @@ public ImageAttributes ImageAttributes
/// Returns the extent of the layer
///
/// Bounding box corresponding to the extent of the features in the layer
- public override Envelope Envelope
+ public override Envelope Envelope
{
get { return _envelope ?? (_envelope = GetEnvelope()); }
}
@@ -608,7 +608,7 @@ public override void Render(Graphics g, MapViewport map)
if (Logger.IsDebugEnabled)
Logger.Debug("Beginning request");
- using(var myWebResponse = (HttpWebResponse)myWebRequest.GetResponse())
+ using (var myWebResponse = (HttpWebResponse)myWebRequest.GetResponse())
{
if (Logger.IsDebugEnabled)
Logger.Debug("Got response");
@@ -620,7 +620,7 @@ public override void Render(Graphics g, MapViewport map)
if (Logger.IsDebugEnabled)
Logger.Debug("Reading image from stream");
- var cLength = (int) myWebResponse.ContentLength;
+ var cLength = (int)myWebResponse.ContentLength;
if (Logger.IsDebugEnabled)
Logger.Debug("Content-Length: " + cLength);
diff --git a/SharpMap/Map/Map.cs b/SharpMap/Map/Map.cs
index 357d751c..80d1a189 100644
--- a/SharpMap/Map/Map.cs
+++ b/SharpMap/Map/Map.cs
@@ -15,30 +15,26 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using Common.Logging;
+using NetTopologySuite.Geometries;
+using SharpMap.Layers;
+using SharpMap.Rendering;
+using SharpMap.Rendering.Decoration;
+using SharpMap.Styles;
+using SharpMap.Utilities;
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
-using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
using System.Globalization;
using System.IO;
using System.Linq;
-using System.Runtime.InteropServices;
-using GeoAPI.Geometries;
-using NetTopologySuite;
-using SharpMap.Layers;
-using SharpMap.Rendering;
-using SharpMap.Rendering.Decoration;
-using SharpMap.Styles;
-using SharpMap.Utilities;
-using Point = GeoAPI.Geometries.Coordinate;
-using System.Drawing.Imaging;
-using Common.Logging;
using System.Reflection;
+using Point = NetTopologySuite.Geometries.Coordinate;
namespace SharpMap
{
@@ -60,14 +56,14 @@ public static void Configure()
}
///
- /// Static constructor. Needed to get set.
+ /// Static constructor. Needed to get set.
///
static Map()
{
try
{
- _logger.Debug("Trying to get GeoAPI.GeometryServiceProvider.Instance");
- var instance = GeoAPI.GeometryServiceProvider.Instance;
+ _logger.Debug("Trying to get NetTopologySuite.NetTopologySuite.NtsGeometryServices.Instance");
+ var instance = NetTopologySuite.NtsGeometryServices.Instance;
if (instance == null)
{
_logger.Debug("Returned null");
@@ -79,8 +75,8 @@ static Map()
_logger.Debug("Loading NetTopologySuite");
Assembly.Load("NetTopologySuite");
_logger.Debug("Loaded NetTopologySuite");
- _logger.Debug("Trying to get GeoAPI.GeometryServiceProvider.Instance");
- var instance = GeoAPI.GeometryServiceProvider.Instance;
+ _logger.Debug("Trying to get NetTopologySuite.NetTopologySuite.NtsGeometryServices.Instance");
+ var instance = NetTopologySuite.NtsGeometryServices.Instance;
if (instance == null)
{
_logger.Debug("Returned null");
@@ -94,23 +90,23 @@ static Map()
{
_logger.Debug("In design mode");
Trace.WriteLine("In design mode");
- // We have to do this initialization with reflection due to the fact that NTS can reference an older version of GeoAPI and redirection
+ // We have to do this initialization with reflection due to the fact that NTS can reference an older version of NetTopologySuite and redirection
// is not available at design time..
var ntsAssembly = Assembly.Load("NetTopologySuite");
_logger.Debug("Loaded NetTopologySuite");
Trace.WriteLine("Loaded NetTopologySuite");
try
{
- _logger.Debug("Trying to access GeoAPI.GeometryServiceProvider.Instance");
- Trace.WriteLine("Trying to access GeoAPI.GeometryServiceProvider.Instance");
- if (GeoAPI.GeometryServiceProvider.Instance == null)
+ _logger.Debug("Trying to access NetTopologySuite.NetTopologySuite.NtsGeometryServices.Instance");
+ Trace.WriteLine("Trying to access NetTopologySuite.NetTopologySuite.NtsGeometryServices.Instance");
+ if (NetTopologySuite.NetTopologySuite.NtsGeometryServices.Instance == null)
{
_logger.Debug("Returned null, setting it to default");
Trace.WriteLine("Returned null, setting it to default");
var ntsApiGeometryServices = ntsAssembly.GetType("NetTopologySuite.NtsGeometryServices");
- GeoAPI.GeometryServiceProvider.Instance =
+ NetTopologySuite.NetTopologySuite.NtsGeometryServices.Instance =
ntsApiGeometryServices.GetProperty("Instance").GetValue(null, null) as
- GeoAPI.IGeometryServices;
+ NetTopologySuite.IGeometryServices;
}
}
@@ -119,9 +115,9 @@ static Map()
_logger.Debug("InvalidOperationException thrown, setting it to default");
Trace.WriteLine("InvalidOperationException thrown, setting it to default");
var ntsApiGeometryServices = ntsAssembly.GetType("NetTopologySuite.NtsGeometryServices");
- GeoAPI.GeometryServiceProvider.Instance =
+ NetTopologySuite.NetTopologySuite.NtsGeometryServices.Instance =
ntsApiGeometryServices.GetProperty("Instance").GetValue(null, null) as
- GeoAPI.IGeometryServices;
+ NetTopologySuite.IGeometryServices;
}
_logger.Debug("Exiting design mode handling");
Trace.WriteLine("Exiting design mode handling");
@@ -148,14 +144,14 @@ static Map()
private readonly VariableLayerCollection _variableLayers;
#pragma warning disable 169
// both fields redundant, but unable to remove without violating serialization
- private Matrix _mapTransform;
+ private Matrix _mapTransform;
private Matrix _mapTransformInverted;
#pragma warning restore 169
private readonly object _lockMapTransform = new object();
private readonly object _lockMapTransformInverted = new object();
- private float[] _mapTransformElements;
+ private float[] _mapTransformElements;
private float[] _mapTransformInvertedElements;
-
+
private readonly MapViewPortGuard _mapViewportGuard;
private readonly Dictionary
- public interface IThemeEx: ITheme
+ public interface IThemeEx : ITheme
{
///
/// Calculates a style for a given based on a given .
diff --git a/SharpMap/Rendering/Thematics/UniqueValuesTheme.cs b/SharpMap/Rendering/Thematics/UniqueValuesTheme.cs
index be81400b..dd96d27e 100644
--- a/SharpMap/Rendering/Thematics/UniqueValuesTheme.cs
+++ b/SharpMap/Rendering/Thematics/UniqueValuesTheme.cs
@@ -12,9 +12,9 @@
// You should have received a copy of the GNU Lesser General Public License
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using SharpMap.Styles;
using System;
using System.Collections.Generic;
-using SharpMap.Styles;
namespace SharpMap.Rendering.Thematics
{
@@ -23,7 +23,7 @@ namespace SharpMap.Rendering.Thematics
///
/// Type of the featureattribute to match
[Serializable]
- public class UniqueValuesTheme : ITheme, ICloneable
+ public class UniqueValuesTheme : ITheme, ICloneable
{
readonly IStyle _default;
@@ -68,7 +68,7 @@ public IStyle GetStyle(Data.FeatureDataRow attribute)
var val = attribute[_attributeName].ToString();
if (_styleMap.ContainsKey(val))
- return _styleMap[val];
+ return _styleMap[val];
return _default;
}
@@ -112,10 +112,10 @@ public IStyle GetStyle(string value)
///
public object Clone()
{
- var defStyle = (_default is ICloneable) ? (IStyle) ((ICloneable) _default).Clone() : _default;
+ var defStyle = (_default is ICloneable) ? (IStyle)((ICloneable)_default).Clone() : _default;
var styleMap = new Dictionary(_styleMap.Count);
foreach (var style in _styleMap)
- styleMap.Add(_originalValue[style.Key], style.Value is ICloneable ? (IStyle) ((ICloneable) style.Value).Clone() : style.Value);
+ styleMap.Add(_originalValue[style.Key], style.Value is ICloneable ? (IStyle)((ICloneable)style.Value).Clone() : style.Value);
return new UniqueValuesTheme(_attributeName, styleMap, defStyle);
}
diff --git a/SharpMap/Rendering/VectorRenderer.cs b/SharpMap/Rendering/VectorRenderer.cs
index 9a0591d5..8ecf25d0 100644
--- a/SharpMap/Rendering/VectorRenderer.cs
+++ b/SharpMap/Rendering/VectorRenderer.cs
@@ -15,17 +15,17 @@
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using NetTopologySuite.Geometries;
+using SharpMap.Rendering.Symbolizer;
+using SharpMap.Styles;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Reflection;
-using GeoAPI.Geometries;
-using SharpMap.Rendering.Symbolizer;
-using SharpMap.Styles;
-using Point=GeoAPI.Geometries.Coordinate;
using System.Runtime.CompilerServices;
+using Point = NetTopologySuite.Geometries.Point;
namespace SharpMap.Rendering
{
@@ -56,7 +56,7 @@ static VectorRenderer()
/// Map reference
/// Offset by which line will be moved to right
[MethodImpl(MethodImplOptions.Synchronized)]
- public static void DrawMultiLineString(Graphics g, IMultiLineString lines, Pen pen, MapViewport map, float offset)
+ public static void DrawMultiLineString(Graphics g, MultiLineString lines, Pen pen, MapViewport map, float offset)
{
DrawMultiLineStringEx(g, lines, pen, map, offset);
}
@@ -71,12 +71,12 @@ public static void DrawMultiLineString(Graphics g, IMultiLineString lines, Pen p
/// Offset by which line will be moved to right
/// The area of the map that was affected by the drawing operation
[MethodImpl(MethodImplOptions.Synchronized)]
- public static RectangleF DrawMultiLineStringEx(Graphics g, IMultiLineString lines, Pen pen, MapViewport map, float offset)
+ public static RectangleF DrawMultiLineStringEx(Graphics g, MultiLineString lines, Pen pen, MapViewport map, float offset)
{
var canvasArea = RectangleF.Empty;
- for(int i = 0; i < lines.NumGeometries; i++)
+ for (int i = 0; i < lines.NumGeometries; i++)
{
- var line = (ILineString) lines[i];
+ var line = (LineString)lines[i];
var rect = DrawLineStringEx(g, line, pen, map, offset);
canvasArea = rect.ExpandToInclude(canvasArea);
}
@@ -143,7 +143,7 @@ internal static PointF[] OffsetRight(PointF[] points, float offset)
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
[Obsolete("Not called, will be removed")]
- public static void DrawLineString(Graphics g, ILineString line, Pen pen, MapViewport map)
+ public static void DrawLineString(Graphics g, LineString line, Pen pen, MapViewport map)
{
DrawLineString(g, line, pen, map, 0f);
}
@@ -156,7 +156,7 @@ public static void DrawLineString(Graphics g, ILineString line, Pen pen, MapView
/// Pen style used for rendering
/// Map reference
/// Offset by which line will be moved to right
- public static void DrawLineString(Graphics g, ILineString line, Pen pen, MapViewport map, float offset)
+ public static void DrawLineString(Graphics g, LineString line, Pen pen, MapViewport map, float offset)
{
DrawLineStringEx(g, line, pen, map, offset);
}
@@ -170,7 +170,7 @@ public static void DrawLineString(Graphics g, ILineString line, Pen pen, MapView
/// Map reference
/// Offset by which line will be moved to right
/// The area of the map that was affected by the drawing of the geometry.
- public static RectangleF DrawLineStringEx(Graphics g, ILineString line, Pen pen, MapViewport map, float offset)
+ public static RectangleF DrawLineStringEx(Graphics g, LineString line, Pen pen, MapViewport map, float offset)
{
var points = line.TransformToImage(map);
if (points.Length < 2) return RectangleF.Empty;
@@ -199,7 +199,7 @@ public static RectangleF DrawLineStringEx(Graphics g, ILineString line, Pen pen,
/// Specifies whether polygon clipping should be applied
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static void DrawMultiPolygon(Graphics g, IMultiPolygon multiPolygon, Brush brush, Pen pen, bool clip, MapViewport map)
+ public static void DrawMultiPolygon(Graphics g, MultiPolygon multiPolygon, Brush brush, Pen pen, bool clip, MapViewport map)
{
DrawMultiPolygonEx(g, multiPolygon, brush, pen, clip, map);
}
@@ -215,12 +215,12 @@ public static void DrawMultiPolygon(Graphics g, IMultiPolygon multiPolygon, Brus
/// Map reference
/// The area of the map that was affected by the drawing of the geometry.
[MethodImpl(MethodImplOptions.Synchronized)]
- public static RectangleF DrawMultiPolygonEx(Graphics g, IMultiPolygon multiPolygon, Brush brush, Pen pen, bool clip, MapViewport map)
+ public static RectangleF DrawMultiPolygonEx(Graphics g, MultiPolygon multiPolygon, Brush brush, Pen pen, bool clip, MapViewport map)
{
var canvasArea = RectangleF.Empty;
- for (var i = 0; i < multiPolygon.NumGeometries;i++ )
+ for (var i = 0; i < multiPolygon.NumGeometries; i++)
{
- var p = (IPolygon)multiPolygon[i];
+ var p = (Polygon)multiPolygon[i];
var rect = DrawPolygonEx(g, p, brush, pen, clip, map);
canvasArea = rect.ExpandToInclude(canvasArea);
}
@@ -237,7 +237,7 @@ public static RectangleF DrawMultiPolygonEx(Graphics g, IMultiPolygon multiPolyg
/// Specifies whether polygon clipping should be applied
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static void DrawPolygon(Graphics g, IPolygon pol, Brush brush, Pen pen, bool clip, MapViewport map)
+ public static void DrawPolygon(Graphics g, Polygon pol, Brush brush, Pen pen, bool clip, MapViewport map)
{
DrawPolygonEx(g, pol, brush, pen, clip, map);
}
@@ -252,7 +252,7 @@ public static void DrawPolygon(Graphics g, IPolygon pol, Brush brush, Pen pen, b
/// Specifies whether polygon clipping should be applied
/// Map reference
/// The area of the map that was affected by the drawing of the geometry.
- public static RectangleF DrawPolygonEx(Graphics g, IPolygon pol, Brush brush, Pen pen, bool clip, MapViewport map)
+ public static RectangleF DrawPolygonEx(Graphics g, Polygon pol, Brush brush, Pen pen, bool clip, MapViewport map)
{
if (pol.ExteriorRing == null)
return RectangleF.Empty;
@@ -272,7 +272,7 @@ public static RectangleF DrawPolygonEx(Graphics g, IPolygon pol, Brush brush, Pe
//Add the interior polygons (holes)
if (pol.NumInteriorRings > 0)
{
- foreach (ILinearRing ring in pol.InteriorRings)
+ foreach (LinearRing ring in pol.InteriorRings)
{
points = ring.TransformToImage(map);
if (!clip)
@@ -352,9 +352,9 @@ public static PointF[] LimitValues(PointF[] vertices, float limit)
public static SizeOfStringDelegate SizeOfString
{
get { return _sizeOfString ?? (_sizeOfString = SizeOfStringCeiling); }
- set
- {
- if (value != null )
+ set
+ {
+ if (value != null)
_sizeOfString = value;
}
}
@@ -382,7 +382,7 @@ public static SizeF SizeOfStringBase(Graphics g, string text, Font font)
public static SizeF SizeOfString74(Graphics g, string text, Font font)
{
var s = g.MeasureString(text, font);
- return new SizeF(s.Width * 0.74f+1f, s.Height * 0.74f);
+ return new SizeF(s.Width * 0.74f + 1f, s.Height * 0.74f);
}
///
/// Function to get the of a string when rendered with the given font.
@@ -472,7 +472,7 @@ public static RectangleF DrawLabelEx(Graphics g, PointF labelPoint, PointF offse
rotationPoint = rotationPoint ?? labelPoint;
origTrans = g.Transform.Clone();
-
+
g.TranslateTransform(rotationPoint.Value.X, rotationPoint.Value.Y);
g.RotateTransform(rotation);
@@ -489,9 +489,9 @@ public static RectangleF DrawLabelEx(Graphics g, PointF labelPoint, PointF offse
using (var path = new GraphicsPath())
{
- path.AddString(text, font.FontFamily, (int) font.Style, font.Size,
+ path.AddString(text, font.FontFamily, (int)font.Style, font.Size,
new RectangleF(labelPoint, labelSize),
- new StringFormat {Alignment = sAlign});
+ new StringFormat { Alignment = sAlign });
if (halo != null)
{
@@ -509,9 +509,9 @@ public static RectangleF DrawLabelEx(Graphics g, PointF labelPoint, PointF offse
origTrans.Dispose();
}
- if (symTrans == null)
+ if (symTrans == null)
return background;
-
+
var pts = background.ToPointArray();
symTrans.TransformPoints(pts);
symTrans.Dispose();
@@ -679,7 +679,7 @@ internal static PointF[] ClipPolygon(PointF[] vertices, int width, int height)
/// Symbol offset af scale=1
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static void DrawPoint(Graphics g, IPoint point, Brush b, float size, PointF offset, MapViewport map)
+ public static void DrawPoint(Graphics g, Point point, Brush b, float size, PointF offset, MapViewport map)
{
DrawPointEx(g, point, b, size, offset, map);
}
@@ -693,7 +693,7 @@ public static void DrawPoint(Graphics g, IPoint point, Brush b, float size, Poin
/// Symbol offset af scale=1
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static RectangleF DrawPointEx(Graphics g, IPoint point, Brush b, float size, PointF offset, MapViewport map)
+ public static RectangleF DrawPointEx(Graphics g, Point point, Brush b, float size, PointF offset, MapViewport map)
{
if (point == null)
return RectangleF.Empty;
@@ -702,10 +702,10 @@ public static RectangleF DrawPointEx(Graphics g, IPoint point, Brush b, float si
var width = size;
var height = size;
-
+
float minX = (int)pp.X - width / 2 + offset.X;
- float minY = (int) pp.Y - height / 2 + offset.Y;
-
+ float minY = (int)pp.Y - height / 2 + offset.Y;
+
g.FillEllipse(b, minX, minY, width, height);
return new RectangleF(minX, minY, width, height);
@@ -719,7 +719,7 @@ public static RectangleF DrawPointEx(Graphics g, IPoint point, Brush b, float si
/// Symbolizer to decorate point
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static void DrawPoint(IPointSymbolizer symbolizer, Graphics g, IPoint point, MapViewport map) => DrawPointEx(symbolizer, g, point, map);
+ public static void DrawPoint(IPointSymbolizer symbolizer, Graphics g, Point point, MapViewport map) => DrawPointEx(symbolizer, g, point, map);
///
/// Renders a point to the map.
@@ -729,13 +729,13 @@ public static RectangleF DrawPointEx(Graphics g, IPoint point, Brush b, float si
/// Symbolizer to decorate point
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static RectangleF DrawPointEx(IPointSymbolizer symbolizer, Graphics g, IPoint point, MapViewport map)
+ public static RectangleF DrawPointEx(IPointSymbolizer symbolizer, Graphics g, Point point, MapViewport map)
{
if (point == null)
- return RectangleF.Empty;
+ return RectangleF.Empty;
symbolizer.Render(map, point, g);
- return ((IPointSymbolizerEx)symbolizer).CanvasArea;
+ return ((IPointSymbolizerEx)symbolizer).CanvasArea;
}
///
@@ -749,7 +749,7 @@ public static RectangleF DrawPointEx(IPointSymbolizer symbolizer, Graphics g, IP
/// Symbol rotation in degrees
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static void DrawPoint(Graphics g, IPoint point, Image symbol, float symbolscale, PointF offset,
+ public static void DrawPoint(Graphics g, Point point, Image symbol, float symbolscale, PointF offset,
float rotation, MapViewport map) => DrawPointEx(g, point, symbol, symbolscale, offset, rotation, map);
///
@@ -763,7 +763,7 @@ public static void DrawPoint(Graphics g, IPoint point, Image symbol, float symbo
/// Symbol rotation in degrees
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static RectangleF DrawPointEx(Graphics g, IPoint point, Image symbol, float symbolScale, PointF offset,
+ public static RectangleF DrawPointEx(Graphics g, Point point, Image symbol, float symbolScale, PointF offset,
float rotation, MapViewport map)
{
if (point == null)
@@ -779,7 +779,7 @@ public static RectangleF DrawPointEx(Graphics g, IPoint point, Image symbol, flo
float left = pp.X - width / 2 + offset.X * symbolScale;
float top = pp.Y - height / 2 + offset.Y * symbolScale;
- Matrix symTrans = null;
+ Matrix symTrans = null;
Matrix origTrans = null;
if (rotation != 0 && !Single.IsNaN(rotation))
@@ -800,16 +800,16 @@ public static RectangleF DrawPointEx(Graphics g, IPoint point, Image symbol, flo
{
g.DrawImage(symbol, left, top, width, height);
}
-
+
if (origTrans != null)
{
g.Transform = origTrans;
origTrans.Dispose();
}
- if (symTrans== null)
+ if (symTrans == null)
return new RectangleF(left, top, width, height);
-
+
var pts = new[]
{
new PointF(left, top),
@@ -823,7 +823,7 @@ public static RectangleF DrawPointEx(Graphics g, IPoint point, Image symbol, flo
}
///
- /// Renders a to the map.
+ /// Renders a to the map.
///
/// Graphics reference
/// MultiPoint to render
@@ -833,11 +833,11 @@ public static RectangleF DrawPointEx(Graphics g, IPoint point, Image symbol, flo
/// Symbol rotation in degrees
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static void DrawMultiPoint(Graphics g, IMultiPoint points, Image symbol, float symbolScale,
+ public static void DrawMultiPoint(Graphics g, MultiPoint points, Image symbol, float symbolScale,
PointF offset, float rotation, MapViewport map) => DrawMultiPointEx(g, points, symbol, symbolScale, offset, rotation, map);
///
- /// Renders a to the map.
+ /// Renders a to the map.
///
/// Graphics reference
/// MultiPoint to render
@@ -847,45 +847,45 @@ public static void DrawMultiPoint(Graphics g, IMultiPoint points, Image symbol,
/// Symbol rotation in degrees
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static RectangleF DrawMultiPointEx(Graphics g, IMultiPoint points, Image symbol, float symbolScale,
+ public static RectangleF DrawMultiPointEx(Graphics g, MultiPoint points, Image symbol, float symbolScale,
PointF offset, float rotation, MapViewport map)
{
var canvasArea = RectangleF.Empty;
for (var i = 0; i < points.NumGeometries; i++)
{
- var rect = DrawPointEx(g, (IPoint) points[i], symbol, symbolScale, offset, rotation, map);
- canvasArea = rect.ExpandToInclude(canvasArea);
+ var rect = DrawPointEx(g, (Point)points[i], symbol, symbolScale, offset, rotation, map);
+ canvasArea = rect.ExpandToInclude(canvasArea);
}
return canvasArea;
}
///
- /// Renders a to the map.
+ /// Renders a to the map.
///
/// Graphics reference
/// MultiPoint to render
/// Symbolizer to decorate point
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static void DrawMultiPoint(IPointSymbolizer symbolizer, Graphics g, IMultiPoint points, MapViewport map)
+ public static void DrawMultiPoint(IPointSymbolizer symbolizer, Graphics g, MultiPoint points, MapViewport map)
=> DrawMultiPointEx(symbolizer, g, points, map);
///
- /// Renders a to the map.
+ /// Renders a to the map.
///
/// Graphics reference
/// MultiPoint to render
/// Symbolizer to decorate point
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static RectangleF DrawMultiPointEx(IPointSymbolizer symbolizer, Graphics g, IMultiPoint points, MapViewport map)
+ public static RectangleF DrawMultiPointEx(IPointSymbolizer symbolizer, Graphics g, MultiPoint points, MapViewport map)
{
symbolizer.Render(map, points, g);
return ((IPointSymbolizerEx)symbolizer).CanvasArea;
}
///
- /// Renders a to the map.
+ /// Renders a to the map.
///
/// Graphics reference
/// MultiPoint to render
@@ -894,11 +894,11 @@ public static RectangleF DrawMultiPointEx(IPointSymbolizer symbolizer, Graphics
/// Symbol offset af scale=1
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static void DrawMultiPoint(Graphics g, IMultiPoint points, Brush brush, float size, PointF offset, MapViewport map)
+ public static void DrawMultiPoint(Graphics g, MultiPoint points, Brush brush, float size, PointF offset, MapViewport map)
=> DrawMultiPointEx(g, points, brush, size, offset, map);
///
- /// Renders a to the map.
+ /// Renders a to the map.
///
/// Graphics reference
/// MultiPoint to render
@@ -907,12 +907,12 @@ public static void DrawMultiPoint(Graphics g, IMultiPoint points, Brush brush, f
/// Symbol offset af scale=1
/// Map reference
[MethodImpl(MethodImplOptions.Synchronized)]
- public static RectangleF DrawMultiPointEx(Graphics g, IMultiPoint points, Brush brush, float size, PointF offset, MapViewport map)
+ public static RectangleF DrawMultiPointEx(Graphics g, MultiPoint points, Brush brush, float size, PointF offset, MapViewport map)
{
var canvasArea = RectangleF.Empty;
for (var i = 0; i < points.NumGeometries; i++)
{
- var point = (IPoint) points[i];
+ var point = (Point)points[i];
var rect = DrawPointEx(g, point, brush, size, offset, map);
canvasArea = rect.ExpandToInclude(canvasArea);
}
@@ -1040,7 +1040,7 @@ internal static RectangleF ToRectangleF(this PointF[] self)
///
internal static PointF[] ToPointArray(this RectangleF self)
{
- return new []
+ return new[]
{
new PointF(self.X, self.Y),
new PointF(self.X + self.Width, self.Y),
@@ -1074,23 +1074,23 @@ internal static System.Drawing.Point[] ToPointArray(this Rectangle self)
/// Either of the arrays could be empty, so must return new array
internal static PointF[] Union(this PointF[] self, PointF[] other)
{
- if (other.Length == 0)
+ if (other.Length == 0)
return self;
if (self.Length == 0)
return other;
- float minX = Math.Min(self.Min(p => p.X), other.Min(p => p.X));
+ float minX = Math.Min(self.Min(p => p.X), other.Min(p => p.X));
float maxX = Math.Max(self.Max(p => p.X), other.Max(p => p.X));
float minY = Math.Min(self.Min(p => p.Y), other.Min(p => p.Y));
float maxY = Math.Max(self.Max(p => p.Y), other.Max(p => p.Y));
float width = maxX - minX;
float height = maxY - minY;
-
- return new []
+
+ return new[]
{
- new PointF(minX, minY),
+ new PointF(minX, minY),
new PointF(minX + width, minY),
new PointF(minX + width, minY + height),
new PointF(minX, minY + height),
diff --git a/SharpMap/Session.cs b/SharpMap/Session.cs
index 83b2d197..5dc1af09 100644
--- a/SharpMap/Session.cs
+++ b/SharpMap/Session.cs
@@ -1,6 +1,7 @@
-using System;
-using Common.Logging;
-using GeoAPI;
+using Common.Logging;
+using NetTopologySuite;
+using SharpMap.CoordinateSystems;
+using System;
namespace SharpMap
{
@@ -9,8 +10,8 @@ namespace SharpMap
///
public class Session : ISession
{
- private static ICoordinateSystemRepository _repository;
- private ICoordinateSystemServices _coordinateSystemServices;
+ private ICoordinateSystemRepository _repository;
+ private CoordinateSystemServices _coordinateSystemServices;
///
/// Static constructor
@@ -28,12 +29,12 @@ static Session()
///
/// The geometry services instance
///
- public IGeometryServices GeometryServices { get; set; }
+ public NtsGeometryServices GeometryServices { get; set; }
///
/// Gets the coordinate system services instance
///
- public ICoordinateSystemServices CoordinateSystemServices
+ public CoordinateSystemServices CoordinateSystemServices
{
get
{
@@ -60,7 +61,7 @@ public ICoordinateSystemRepository CoordinateSystemRepository
///
/// The geometry services class
/// A reference to this session
- public ISession SetGeometryServices(IGeometryServices geometryServices)
+ public ISession SetGeometryServices(NtsGeometryServices geometryServices)
{
GeometryServices = geometryServices;
return this;
@@ -71,7 +72,7 @@ public ISession SetGeometryServices(IGeometryServices geometryServices)
///
/// The coordinate system services class
/// A reference to this session
- public ISession SetCoordinateSystemServices(ICoordinateSystemServices coordinateSystemServices)
+ public ISession SetCoordinateSystemServices(CoordinateSystemServices coordinateSystemServices)
{
CoordinateSystemServices = coordinateSystemServices;
return this;
@@ -100,4 +101,4 @@ public ISession ReadConfiguration()
}
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/SharpMap/SharpMap.csproj b/SharpMap/SharpMap.csproj
index 0cafd443..45f24081 100644
--- a/SharpMap/SharpMap.csproj
+++ b/SharpMap/SharpMap.csproj
@@ -24,12 +24,12 @@
-
-
-
-
+
+
+
+
-
+
@@ -39,6 +39,10 @@
+
+
+
+