Skip to content

Commit c295cf4

Browse files
committed
Fix build warnings
1 parent 3b2004f commit c295cf4

File tree

10 files changed

+75
-69
lines changed

10 files changed

+75
-69
lines changed

NHibernate.Spatial/Type/GeometryTypeBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ bool IUserType.Equals(object a, object b)
235235
}
236236
if (ga == null && gb == null)
237237
{
238-
return Util.EqualsHelper.Equals((T)a, (T)b);
238+
return Equals((T) a, (T) b);
239239
}
240240
return false;
241241
}

NetTopologySuite.TestRunner/Functions/GeometryFunctions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static IGeometry getGeometryN(IGeometry g, int i)
6868
public static IGeometry getCoordinates(IGeometry g)
6969
{
7070
var pts = g.Coordinates;
71-
return g.Factory.CreateMultiPoint(pts);
71+
return g.Factory.CreateMultiPointFromCoords(pts);
7272
}
7373
}
7474
}

NetTopologySuite.TestRunner/Functions/PolygonizeFunctions.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
using NetTopologySuite.Geometries;
33
using NetTopologySuite.Geometries.Utilities;
44
using NetTopologySuite.Operation.Polygonize;
5-
using NetTopologySuite.Utilities;
65
using System.Collections.Generic;
6+
using System.Linq;
77

88
namespace Open.Topology.TestRunner.Functions
99
{
@@ -24,17 +24,22 @@ public static IGeometry polygonizeDangles(IGeometry g)
2424
var lines = LineStringExtracter.GetLines(g);
2525
Polygonizer polygonizer = new Polygonizer();
2626
polygonizer.Add(lines);
27-
var geom = polygonizer.GetDangles();
28-
return g.Factory.BuildGeometry(CollectionUtil.Cast<ILineString, IGeometry>(geom));
27+
var geomList = polygonizer.GetDangles()
28+
.Select(x => (IGeometry) x)
29+
.ToList();
30+
31+
return g.Factory.BuildGeometry(geomList);
2932
}
3033

3134
public static IGeometry polygonizeCutEdges(IGeometry g)
3235
{
3336
var lines = LineStringExtracter.GetLines(g);
3437
Polygonizer polygonizer = new Polygonizer();
3538
polygonizer.Add(lines);
36-
var geom = polygonizer.GetCutEdges();
37-
return g.Factory.BuildGeometry(CollectionUtil.Cast<ILineString, IGeometry>(geom));
39+
var geomList = polygonizer.GetCutEdges()
40+
.Select(x => (IGeometry) x)
41+
.ToList();
42+
return g.Factory.BuildGeometry(geomList);
3843
}
3944

4045
public static IGeometry polygonizeInvalidRingLines(IGeometry g)
@@ -51,11 +56,12 @@ public static IGeometry polygonizeAllErrors(IGeometry g)
5156
var lines = LineStringExtracter.GetLines(g);
5257
Polygonizer polygonizer = new Polygonizer();
5358
polygonizer.Add(lines);
54-
var errs = new List<ILineString>();
55-
errs.AddRange(polygonizer.GetDangles());
56-
errs.AddRange(polygonizer.GetCutEdges());
57-
errs.AddRange(CollectionUtil.Cast<IGeometry, ILineString>(polygonizer.GetInvalidRingLines()));
58-
return g.Factory.BuildGeometry(CollectionUtil.Cast<ILineString, IGeometry>(errs));
59+
var geomList = new List<IGeometry>();
60+
geomList.AddRange(polygonizer.GetDangles());
61+
geomList.AddRange(polygonizer.GetCutEdges());
62+
geomList.AddRange(polygonizer.GetInvalidRingLines());
63+
64+
return g.Factory.BuildGeometry(geomList);
5965
}
6066
}
6167
}

NetTopologySuite.TestRunner/XmlTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ protected virtual bool TestDensify()
871871
if (geom != null)
872872
{
873873
var res = NetTopologySuite.Densify.Densifier.Densify(geom, dArg);
874-
return res.Equals(geoResult);
874+
return res.EqualsTopologically(geoResult);
875875
}
876876
return false;
877877
}
@@ -1091,22 +1091,22 @@ protected virtual bool TestEquals()
10911091
{
10921092
if (_objArgument1 == null)
10931093
{
1094-
return _objGeometryA.Equals(_objGeometryB) == bResult;
1094+
return _objGeometryA.EqualsTopologically(_objGeometryB) == bResult;
10951095
}
10961096
else
10971097
{
1098-
return _objGeometryA.Equals((Geometry)_objArgument1) == bResult;
1098+
return _objGeometryA.EqualsTopologically((Geometry)_objArgument1) == bResult;
10991099
}
11001100
}
11011101
else if (_objGeometryB != null)
11021102
{
11031103
if (_objArgument1 == null)
11041104
{
1105-
return _objGeometryB.Equals(_objGeometryA) == bResult;
1105+
return _objGeometryB.EqualsTopologically(_objGeometryA) == bResult;
11061106
}
11071107
else
11081108
{
1109-
return _objGeometryB.Equals((Geometry)_objArgument1) == bResult;
1109+
return _objGeometryB.EqualsTopologically((Geometry)_objArgument1) == bResult;
11101110
}
11111111
}
11121112

@@ -1817,7 +1817,7 @@ protected virtual bool TestMinClearanceLine()
18171817
{
18181818
MinimumClearance c = new MinimumClearance(_objGeometryA);
18191819
IGeometry gClearance = c.GetLine();
1820-
return gResult.Equals(gClearance);
1820+
return gResult.EqualsTopologically(gClearance);
18211821
}
18221822
return false;
18231823
}
@@ -1830,8 +1830,8 @@ private bool CompareGeometries(Geometry a, Geometry b)
18301830
{
18311831
if (a != null && b != null && a.GetType().Name == b.GetType().Name)
18321832
{
1833-
Geometry aClone = (Geometry)a.Clone();
1834-
Geometry bClone = (Geometry)b.Clone();
1833+
Geometry aClone = (Geometry) a.Copy();
1834+
Geometry bClone = (Geometry) b.Copy();
18351835

18361836
aClone.Normalize();
18371837
bClone.Normalize();

Tests.NHibernate.Spatial.MsSql2008/MsSql2008ConformanceItemsFixture.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ from t in session.Query<RoadSegment>()
3131
IGeometry geometry = query.Single();
3232
IGeometry expected = Wkt.Read("POINT( 0 18 )");
3333

34-
Assert.IsTrue(expected.Equals(geometry));
34+
Assert.IsTrue(expected.EqualsTopologically(geometry));
3535
}
3636

3737
/// <summary>
@@ -48,7 +48,7 @@ from t in session.Query<Lake>()
4848
IGeometry geometry = query.Single();
4949
IGeometry expected = Wkt.Read("LINESTRING(59 18, 67 18, 67 13, 59 13, 59 18)");
5050

51-
Assert.IsTrue(expected.Equals(geometry));
51+
Assert.IsTrue(expected.EqualsTopologically(geometry));
5252
}
5353

5454
/// <summary>
@@ -65,7 +65,7 @@ from t in session.Query<DividedRoute>()
6565
IGeometry geometry = query.Single();
6666
IGeometry expected = Wkt.Read("LINESTRING( 16 0, 16 23, 16 48 )");
6767

68-
Assert.IsTrue(expected.Equals(geometry));
68+
Assert.IsTrue(expected.EqualsTopologically(geometry));
6969
}
7070

7171
/// <summary>

Tests.NHibernate.Spatial.MySQL/MySQLConformanceItemsFixture.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ from t in session.Query<RoadSegment>()
3131
IGeometry geometry = query.Single();
3232
IGeometry expected = Wkt.Read("POINT( 0 18 )");
3333

34-
Assert.IsTrue(expected.Equals(geometry));
34+
Assert.IsTrue(expected.EqualsTopologically(geometry));
3535
}
3636

3737
/// <summary>
@@ -48,7 +48,7 @@ from t in session.Query<Lake>()
4848
IGeometry geometry = query.Single();
4949
IGeometry expected = Wkt.Read("LINESTRING(59 18, 67 18, 67 13, 59 13, 59 18)");
5050

51-
Assert.IsTrue(expected.Equals(geometry));
51+
Assert.IsTrue(expected.EqualsTopologically(geometry));
5252
}
5353

5454
/// <summary>
@@ -65,7 +65,7 @@ from t in session.Query<DividedRoute>()
6565
IGeometry geometry = query.Single();
6666
IGeometry expected = Wkt.Read("LINESTRING( 16 0, 16 23, 16 48 )");
6767

68-
Assert.IsTrue(expected.Equals(geometry));
68+
Assert.IsTrue(expected.EqualsTopologically(geometry));
6969
}
7070

7171
/// <summary>

Tests.NHibernate.Spatial.PostGis/PostGisConformanceItemsFixture.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ from t in session.Query<RoadSegment>()
3131
IGeometry geometry = query.Single();
3232
IGeometry expected = Wkt.Read("POINT( 0 18 )");
3333

34-
Assert.IsTrue(expected.Equals(geometry));
34+
Assert.IsTrue(expected.EqualsTopologically(geometry));
3535
}
3636

3737
/// <summary>
@@ -48,7 +48,7 @@ from t in session.Query<Lake>()
4848
IGeometry geometry = query.Single();
4949
IGeometry expected = Wkt.Read("LINESTRING(59 18, 67 18, 67 13, 59 13, 59 18)");
5050

51-
Assert.IsTrue(expected.Equals(geometry));
51+
Assert.IsTrue(expected.EqualsTopologically(geometry));
5252
}
5353

5454
/// <summary>
@@ -65,7 +65,7 @@ from t in session.Query<DividedRoute>()
6565
IGeometry geometry = query.Single();
6666
IGeometry expected = Wkt.Read("LINESTRING( 16 0, 16 23, 16 48 )");
6767

68-
Assert.IsTrue(expected.Equals(geometry));
68+
Assert.IsTrue(expected.EqualsTopologically(geometry));
6969
}
7070

7171
/// <summary>

0 commit comments

Comments
 (0)