Index: src/Common/SharpMap/Converters/Geometries/GeometryFactory.cs
===================================================================
diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a
--- src/Common/SharpMap/Converters/Geometries/GeometryFactory.cs (.../GeometryFactory.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9)
+++ src/Common/SharpMap/Converters/Geometries/GeometryFactory.cs (.../GeometryFactory.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a)
@@ -9,92 +9,95 @@
using System;
using GeoAPI.Geometries;
+using GisSharpBlog.NetTopologySuite.Algorithm;
+using GisSharpBlog.NetTopologySuite.Geometries;
using NTS = GisSharpBlog.NetTopologySuite;
namespace SharpMap.Converters.Geometries
{
- ///
- /// Description of GeometryFactory.
- ///
- // TODO: remove this, inject it using NTS, DON'T USE IT DIRECTLY
+ ///
+ /// Description of GeometryFactory.
+ ///
+ // TODO: remove this, inject it using NTS, DON'T USE IT DIRECTLY
[Obsolete]
- public class GeometryFactory
- {
- private static NTS.Geometries.GeometryFactory geomFactory = new NTS.Geometries.GeometryFactory();
+ public class GeometryFactory
+ {
+ private static readonly GisSharpBlog.NetTopologySuite.Geometries.GeometryFactory geomFactory = new GisSharpBlog.NetTopologySuite.Geometries.GeometryFactory();
- public static ICoordinate CreateCoordinate(double x, double y)
+ public static ICoordinate CreateCoordinate(double x, double y)
{
// use 0.0 as default for z
- return new NTS.Geometries.Coordinate(x, y, 0.0);
+ return new Coordinate(x, y, 0.0);
}
- public static IPoint CreatePoint(double x, double y)
+ public static IPoint CreatePoint(double x, double y)
{
- return geomFactory.CreatePoint(new NTS.Geometries.Coordinate(x, y, 0.0));
+ return geomFactory.CreatePoint(new Coordinate(x, y, 0.0));
}
public static IPoint CreatePoint(ICoordinate coord)
{
return geomFactory.CreatePoint(coord);
}
-
- public static IMultiPoint CreateMultiPoint(IPoint[] points)
- {
- return geomFactory.CreateMultiPoint(points);
- }
+ public static IMultiPoint CreateMultiPoint(IPoint[] points)
+ {
+ return geomFactory.CreateMultiPoint(points);
+ }
+
public static IEnvelope CreateEnvelope(double minx, double maxx, double miny, double maxy)
- {
- return new NTS.Geometries.Envelope(minx, maxx, miny, maxy);
- }
-
- public static IEnvelope CreateEnvelope()
- {
- return new NTS.Geometries.Envelope();
- }
+ {
+ return new Envelope(minx, maxx, miny, maxy);
+ }
- public static ILineString CreateLineString(ICoordinate[] coords)
- {
- return geomFactory.CreateLineString(coords);
- }
-
- public static IMultiLineString CreateMultiLineString(ILineString[] lineStrings)
- {
- return geomFactory.CreateMultiLineString(lineStrings);
- }
-
- public static ILinearRing CreateLinearRing(ICoordinate[] coords)
- {
- return geomFactory.CreateLinearRing(coords);
- }
+ public static IEnvelope CreateEnvelope()
+ {
+ return new Envelope();
+ }
- public static IPolygon CreatePolygon(ILinearRing shell, ILinearRing[] holes)
- {
- return geomFactory.CreatePolygon(shell, holes);
- }
-
- public static IMultiPolygon CreateMultiPolygon(IPolygon[] polygons)
- {
- return geomFactory.CreateMultiPolygon(polygons);
- }
- public static IMultiPolygon CreateMultiPolygon()
- {
- return geomFactory.CreateMultiPolygon(null);
- }
-
- public static IGeometryCollection CreateGeometryCollection(IGeometry[] geometries)
- {
- return geomFactory.CreateGeometryCollection(geometries);
- }
- public static IGeometryCollection CreateGeometryCollection()
- {
- return geomFactory.CreateGeometryCollection(null);
- }
-
- public static bool IsCCW(ICoordinate[] ring)
- {
- return NTS.Algorithm.CGAlgorithms.IsCCW(ring);
- }
-
- }
-}
+ public static ILineString CreateLineString(ICoordinate[] coords)
+ {
+ return geomFactory.CreateLineString(coords);
+ }
+
+ public static IMultiLineString CreateMultiLineString(ILineString[] lineStrings)
+ {
+ return geomFactory.CreateMultiLineString(lineStrings);
+ }
+
+ public static ILinearRing CreateLinearRing(ICoordinate[] coords)
+ {
+ return geomFactory.CreateLinearRing(coords);
+ }
+
+ public static IPolygon CreatePolygon(ILinearRing shell, ILinearRing[] holes)
+ {
+ return geomFactory.CreatePolygon(shell, holes);
+ }
+
+ public static IMultiPolygon CreateMultiPolygon(IPolygon[] polygons)
+ {
+ return geomFactory.CreateMultiPolygon(polygons);
+ }
+
+ public static IMultiPolygon CreateMultiPolygon()
+ {
+ return geomFactory.CreateMultiPolygon(null);
+ }
+
+ public static IGeometryCollection CreateGeometryCollection(IGeometry[] geometries)
+ {
+ return geomFactory.CreateGeometryCollection(geometries);
+ }
+
+ public static IGeometryCollection CreateGeometryCollection()
+ {
+ return geomFactory.CreateGeometryCollection(null);
+ }
+
+ public static bool IsCCW(ICoordinate[] ring)
+ {
+ return CGAlgorithms.IsCCW(ring);
+ }
+ }
+}
\ No newline at end of file