Revision: 810
http://nhcontrib.svn.sourceforge.net/nhcontrib/?rev=810&view=rev
Author: rstuven
Date: 2009-03-09 05:24:07 +0000 (Mon, 09 Mar 2009)
Log Message:
-----------
Fixed issue #NHSP-5. Thanks to Nathan Stults for the patch.
Modified Paths:
--------------
trunk/src/NHibernate.Spatial/src/NHibernate.Spatial.PostGis/Type/PostGisGeometryType.cs
trunk/src/NHibernate.Spatial/src/Tests.NHibernate.Spatial/ProjectionsFixture.cs
Modified: trunk/src/NHibernate.Spatial/src/NHibernate.Spatial.PostGis/Type/PostGisGeometryType.cs
===================================================================
--- trunk/src/NHibernate.Spatial/src/NHibernate.Spatial.PostGis/Type/PostGisGeometryType.cs 2009-03-07 13:42:42 UTC (rev 809)
+++ trunk/src/NHibernate.Spatial/src/NHibernate.Spatial.PostGis/Type/PostGisGeometryType.cs 2009-03-09 05:24:07 UTC (rev 810)
@@ -97,7 +97,7 @@
string[] min = parts[0].Split(' ');
string[] max = parts[1].Split(' ');
string wkt = string.Format(
- "POLYGON(({0} {1},{2} {1},{2} {3},{0} {2},{0} {1}))",
+ "POLYGON(({0} {1},{0} {3},{2} {3},{2} {1},{0} {1}))",
min[0], min[1], max[0], max[1]);
return new WKTReader().Read(wkt);
}
Modified: trunk/src/NHibernate.Spatial/src/Tests.NHibernate.Spatial/ProjectionsFixture.cs
===================================================================
--- trunk/src/NHibernate.Spatial/src/Tests.NHibernate.Spatial/ProjectionsFixture.cs 2009-03-07 13:42:42 UTC (rev 809)
+++ trunk/src/NHibernate.Spatial/src/Tests.NHibernate.Spatial/ProjectionsFixture.cs 2009-03-09 05:24:07 UTC (rev 810)
@@ -28,10 +28,10 @@
{
session = sessions.OpenSession();
- session.Save(new County("aaaa", "AA", Wkt.Read("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))")));
- session.Save(new County("bbbb", "BB", Wkt.Read("POLYGON((0 1, 1 1, 1 2, 0 2, 0 1))")));
- session.Save(new County("cccc", "BB", Wkt.Read("POLYGON((1 1, 2 1, 2 2, 1 2, 1 1))")));
- session.Save(new County("dddd", "AA", Wkt.Read("POLYGON((1 0, 2 0, 2 1, 1 1, 1 0))")));
+ session.Save(new County("aaaa", "AA", Wkt.Read("POLYGON((1 0, 2 0, 2 1, 1 1, 1 0))")));
+ session.Save(new County("bbbb", "BB", Wkt.Read("POLYGON((1 1, 2 1, 2 2, 1 2, 1 1))")));
+ session.Save(new County("cccc", "BB", Wkt.Read("POLYGON((2 1, 3 1, 3 2, 2 2, 2 1))")));
+ session.Save(new County("dddd", "AA", Wkt.Read("POLYGON((2 0, 3 0, 3 1, 2 1, 2 0))")));
session.Flush();
}
@@ -55,7 +55,7 @@
object[] result = (object[])results[0];
- IGeometry expected = Wkt.Read("POLYGON((0 0, 0 1, 0 2, 1 2, 2 2, 2 1, 2 0, 1 0, 0 0))");
+ IGeometry expected = Wkt.Read("POLYGON((1 0, 1 1, 1 2, 2 2, 3 2, 3 1, 3 0, 2 0, 1 0))");
IGeometry aggregated = (IGeometry)result[1];
Assert.AreEqual(4, result[0]);
@@ -85,8 +85,8 @@
IGeometry aggregatedAA = (IGeometry)resultAA[2];
IGeometry aggregatedBB = (IGeometry)resultBB[2];
- IGeometry expectedAA = Wkt.Read("POLYGON((0 0, 0 1, 2 1, 2 0, 0 0))");
- IGeometry expectedBB = Wkt.Read("POLYGON((0 1, 0 2, 2 2, 2 1, 0 1))");
+ IGeometry expectedAA = Wkt.Read("POLYGON((1 0, 1 1, 3 1, 3 0, 1 0))");
+ IGeometry expectedBB = Wkt.Read("POLYGON((1 1, 1 2, 3 2, 3 1, 1 1))");
Assert.AreEqual(2, countAA);
Assert.AreEqual(2, countBB);
@@ -105,7 +105,7 @@
Assert.AreEqual(1, results.Count);
IGeometry aggregated = (IGeometry)results[0];
- IEnvelope expected = new Envelope(0, 2, 0, 2);
+ IEnvelope expected = new Envelope(1, 3, 0, 2);
Assert.IsTrue(expected.Equals(aggregated.EnvelopeInternal));
@@ -136,7 +136,7 @@
Assert.AreEqual(1, results.Count);
IGeometry aggregated = (IGeometry)results[0];
- IGeometry expected = new Point(1, 1);
+ IGeometry expected = new Point(2, 1);
Assert.IsTrue(expected.Equals(aggregated));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|