private static void WriteSR(com.epl.geometry.SpatialReference spatialReference, com.epl.geometry.JsonWriter jsonWriter) { int wkid = spatialReference.GetOldID(); if (wkid > 0) { jsonWriter.AddPairObject("spatialReference"); jsonWriter.AddPairInt("wkid", wkid); int latest_wkid = spatialReference.GetLatestID(); if (latest_wkid > 0 && latest_wkid != wkid) { jsonWriter.AddPairInt("latestWkid", latest_wkid); } jsonWriter.EndObject(); } else { string wkt = spatialReference.GetText(); if (wkt != null) { jsonWriter.AddPairObject("spatialReference"); jsonWriter.AddPairString("wkt", wkt); jsonWriter.EndObject(); } } }
public virtual void Test_80() { com.epl.geometry.SpatialReference sr = com.epl.geometry.SpatialReference.Create(3857); NUnit.Framework.Assert.IsTrue(sr.GetID() == 3857); NUnit.Framework.Assert.IsTrue(sr.GetLatestID() == 3857); NUnit.Framework.Assert.IsTrue(sr.GetOldID() == 102100); NUnit.Framework.Assert.IsTrue(sr.GetTolerance() == 0.001); }
public virtual void Test() { com.epl.geometry.SpatialReference sr = com.epl.geometry.SpatialReference.Create(102100); NUnit.Framework.Assert.IsTrue(sr.GetID() == 102100); NUnit.Framework.Assert.IsTrue(sr.GetLatestID() == 3857); NUnit.Framework.Assert.IsTrue(sr.GetOldID() == 102100); NUnit.Framework.Assert.IsTrue(sr.GetTolerance() == 0.001); com.epl.geometry.SpatialReference sr84 = com.epl.geometry.SpatialReference.Create(4326); double tol84 = sr84.GetTolerance(); NUnit.Framework.Assert.IsTrue(System.Math.Abs(tol84 - 1e-8) < 1e-8 * 1e-8); }