public static void TestEditShape_()
		{
			{
				// std::shared_ptr<Esri_runtimecore::Geometry::Polygon> poly_base_6
				// = std::make_shared<Esri_runtimecore::Geometry::Polygon>();
				// Single part polygon
				com.esri.core.geometry.Polygon poly = new com.esri.core.geometry.Polygon();
				poly.StartPath(10, 10);
				poly.LineTo(10, 12);
				poly.LineTo(14, 15);
				poly.LineTo(10, 11);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				com.esri.core.geometry.Polygon poly2 = (com.esri.core.geometry.Polygon)editShape.GetGeometry(geom);
				NUnit.Framework.Assert.IsTrue(poly.Equals(poly2));
			}
			{
				// Two part poly
				com.esri.core.geometry.Polygon poly = new com.esri.core.geometry.Polygon();
				poly.StartPath(10, 10);
				poly.LineTo(10, 12);
				poly.LineTo(14, 15);
				poly.LineTo(10, 11);
				poly.StartPath(100, 10);
				poly.LineTo(100, 12);
				poly.LineTo(14, 150);
				poly.LineTo(10, 101);
				poly.LineTo(100, 11);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				com.esri.core.geometry.Polygon poly2 = (com.esri.core.geometry.Polygon)editShape.GetGeometry(geom);
				NUnit.Framework.Assert.IsTrue(poly.Equals(poly2));
			}
			{
				// Single part polyline
				com.esri.core.geometry.Polyline poly = new com.esri.core.geometry.Polyline();
				poly.StartPath(10, 10);
				poly.LineTo(10, 12);
				poly.LineTo(14, 15);
				poly.LineTo(10, 11);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				com.esri.core.geometry.Polyline poly2 = (com.esri.core.geometry.Polyline)editShape.GetGeometry(geom);
				NUnit.Framework.Assert.IsTrue(poly.Equals(poly2));
			}
			{
				// Two part poly
				com.esri.core.geometry.Polyline poly = new com.esri.core.geometry.Polyline();
				poly.StartPath(10, 10);
				poly.LineTo(10, 12);
				poly.LineTo(14, 15);
				poly.LineTo(10, 11);
				poly.StartPath(100, 10);
				poly.LineTo(100, 12);
				poly.LineTo(14, 150);
				poly.LineTo(10, 101);
				poly.LineTo(100, 11);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				com.esri.core.geometry.Polyline poly2 = (com.esri.core.geometry.Polyline)editShape.GetGeometry(geom);
				NUnit.Framework.Assert.IsTrue(poly.Equals(poly2));
			}
			{
				// Five part poly. Close one of parts to test if it works.
				com.esri.core.geometry.Polyline poly = new com.esri.core.geometry.Polyline();
				poly.StartPath(10, 10);
				poly.LineTo(10, 12);
				poly.LineTo(14, 15);
				poly.LineTo(10, 11);
				poly.StartPath(100, 10);
				poly.LineTo(100, 12);
				poly.LineTo(14, 150);
				poly.LineTo(10, 101);
				poly.LineTo(100, 11);
				poly.StartPath(1100, 101);
				poly.LineTo(1300, 132);
				poly.LineTo(144, 150);
				poly.LineTo(106, 1051);
				poly.LineTo(1600, 161);
				poly.StartPath(100, 190);
				poly.LineTo(1800, 192);
				poly.LineTo(184, 8150);
				poly.LineTo(1080, 181);
				poly.StartPath(1030, 10);
				poly.LineTo(1300, 132);
				poly.LineTo(314, 3150);
				poly.LineTo(310, 1301);
				poly.LineTo(3100, 311);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				editShape.SetClosedPath(editShape.GetNextPath(editShape.GetFirstPath(geom)), true);
				((com.esri.core.geometry.MultiPathImpl)poly._getImpl()).ClosePathWithLine(1);
				com.esri.core.geometry.Polyline poly2 = (com.esri.core.geometry.Polyline)editShape.GetGeometry(geom);
				NUnit.Framework.Assert.IsTrue(poly.Equals(poly2));
			}
			{
				// Test erase
				com.esri.core.geometry.Polyline poly = new com.esri.core.geometry.Polyline();
				poly.StartPath(10, 10);
				poly.LineTo(10, 12);
				poly.LineTo(314, 3150);
				poly.LineTo(310, 1301);
				poly.LineTo(3100, 311);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				int vertex = editShape.GetFirstVertex(editShape.GetFirstPath(geom));
				vertex = editShape.RemoveVertex(vertex, true);
				vertex = editShape.GetNextVertex(vertex);
				editShape.RemoveVertex(vertex, true);
				com.esri.core.geometry.Polyline poly2 = (com.esri.core.geometry.Polyline)editShape.GetGeometry(geom);
				poly.SetEmpty();
				poly.StartPath(10, 12);
				poly.LineTo(310, 1301);
				poly.LineTo(3100, 311);
				NUnit.Framework.Assert.IsTrue(poly.Equals(poly2));
			}
			{
				// Test erase
				com.esri.core.geometry.Polygon poly = new com.esri.core.geometry.Polygon();
				poly.StartPath(10, 10);
				poly.LineTo(10, 12);
				poly.LineTo(314, 3150);
				poly.LineTo(310, 1301);
				poly.LineTo(3100, 311);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				int vertex = editShape.GetFirstVertex(editShape.GetFirstPath(geom));
				vertex = editShape.RemoveVertex(vertex, true);
				vertex = editShape.GetNextVertex(vertex);
				editShape.RemoveVertex(vertex, true);
				com.esri.core.geometry.Polygon poly2 = (com.esri.core.geometry.Polygon)editShape.GetGeometry(geom);
				poly.SetEmpty();
				poly.StartPath(10, 12);
				poly.LineTo(310, 1301);
				poly.LineTo(3100, 311);
				NUnit.Framework.Assert.IsTrue(poly.Equals(poly2));
			}
			{
				// Test Filter Close Points
				com.esri.core.geometry.Polygon poly = new com.esri.core.geometry.Polygon();
				poly.StartPath(10, 10);
				poly.LineTo(10, 10.001);
				poly.LineTo(10.001, 10);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				editShape.FilterClosePoints(0.002, true, false);
				com.esri.core.geometry.Polygon poly2 = (com.esri.core.geometry.Polygon)editShape.GetGeometry(geom);
				NUnit.Framework.Assert.IsTrue(poly2.IsEmpty());
			}
			{
				// Test Filter Close Points
				com.esri.core.geometry.Polygon poly = new com.esri.core.geometry.Polygon();
				poly.StartPath(10, 10);
				poly.LineTo(10, 10.0025);
				poly.LineTo(11.0, 10);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				editShape.FilterClosePoints(0.002, true, false);
				com.esri.core.geometry.Polygon poly2 = (com.esri.core.geometry.Polygon)editShape.GetGeometry(geom);
				NUnit.Framework.Assert.IsTrue(!poly2.IsEmpty());
			}
			{
				// Test Filter Close Points
				com.esri.core.geometry.Polygon poly = new com.esri.core.geometry.Polygon();
				poly.StartPath(10, 10);
				poly.LineTo(10, 10.001);
				poly.LineTo(11.0, 10);
				com.esri.core.geometry.EditShape editShape = new com.esri.core.geometry.EditShape();
				int geom = editShape.AddGeometry(poly);
				editShape.FilterClosePoints(0.002, true, false);
				com.esri.core.geometry.Polygon poly2 = (com.esri.core.geometry.Polygon)editShape.GetGeometry(geom);
				NUnit.Framework.Assert.IsTrue(poly2.IsEmpty());
			}
			{
				// Test attribute splitting 1
				com.esri.core.geometry.Polyline polyline = new com.esri.core.geometry.Polyline();
				polyline.StartPath(0, 0);
				polyline.LineTo(1, 1);
				polyline.LineTo(2, 2);
				polyline.LineTo(3, 3);
				polyline.LineTo(4, 4);
				polyline.StartPath(5, 5);
				polyline.LineTo(6, 6);
				polyline.LineTo(7, 7);
				polyline.LineTo(8, 8);
				polyline.LineTo(9, 9);
				polyline.AddAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 0, 0, 4);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 1, 0, 8);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 2, 0, 12);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 3, 0, 16);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 4, 0, 20);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 5, 0, 22);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 6, 0, 26);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 7, 0, 30);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 8, 0, 34);
				polyline.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.Z, 9, 0, 38);
				com.esri.core.geometry.EditShape shape = new com.esri.core.geometry.EditShape();
				int geometry = shape.AddGeometry(polyline);
				com.esri.core.geometry.AttributeStreamOfInt32 vertex_handles = new com.esri.core.geometry.AttributeStreamOfInt32(0);
				for (int path = shape.GetFirstPath(geometry); path != -1; path = shape.GetNextPath(path))
				{
					for (int vertex = shape.GetFirstVertex(path); vertex != -1; vertex = shape.GetNextVertex(vertex))
					{
						if (vertex != shape.GetLastVertex(path))
						{
							vertex_handles.Add(vertex);
						}
					}
				}
				double[] t = new double[1];
				for (int i = 0; i < vertex_handles.Size(); i++)
				{
					int vertex = vertex_handles.Read(i);
					t[0] = 0.5;
					shape.SplitSegment(vertex, t, 1);
				}
				com.esri.core.geometry.Polyline chopped_polyline = (com.esri.core.geometry.Polyline)shape.GetGeometry(geometry);
				NUnit.Framework.Assert.IsTrue(chopped_polyline.GetPointCount() == 18);
				double att_ = 4;
				for (int i_1 = 0; i_1 < 18; i_1++)
				{
					double att = chopped_polyline.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.Z, i_1, 0);
					NUnit.Framework.Assert.IsTrue(att == att_);
					att_ += 2;
				}
			}
			{
				// Test attribute splitting 2
				com.esri.core.geometry.Polyline line1 = new com.esri.core.geometry.Polyline();
				com.esri.core.geometry.Polyline line2 = new com.esri.core.geometry.Polyline();
				line1.AddAttribute(com.esri.core.geometry.VertexDescription.Semantics.M);
				line2.AddAttribute(com.esri.core.geometry.VertexDescription.Semantics.M);
				line1.StartPath(0, 0);
				line1.LineTo(10, 10);
				line2.StartPath(10, 0);
				line2.LineTo(0, 10);
				line1.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 0, 0, 7);
				line1.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 1, 0, 17);
				line2.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 0, 0, 5);
				line2.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 1, 0, 15);
				com.esri.core.geometry.EditShape shape = new com.esri.core.geometry.EditShape();
				int g1 = shape.AddGeometry(line1);
				int g2 = shape.AddGeometry(line2);
				com.esri.core.geometry.CrackAndCluster.Execute(shape, 0.001, null, true);
				com.esri.core.geometry.Polyline chopped_line1 = (com.esri.core.geometry.Polyline)shape.GetGeometry(g1);
				com.esri.core.geometry.Polyline chopped_line2 = (com.esri.core.geometry.Polyline)shape.GetGeometry(g2);
				double att1 = chopped_line1.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 1, 0);
				double att2 = chopped_line2.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 1, 0);
				NUnit.Framework.Assert.IsTrue(att1 == 12);
				NUnit.Framework.Assert.IsTrue(att2 == 10);
			}
			{
				// Test attribute splitting 3
				com.esri.core.geometry.Polygon polygon = new com.esri.core.geometry.Polygon();
				polygon.AddAttribute(com.esri.core.geometry.VertexDescription.Semantics.M);
				polygon.StartPath(0, 0);
				polygon.LineTo(0, 10);
				polygon.LineTo(10, 10);
				polygon.LineTo(10, 0);
				polygon.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 0, 0, 7);
				polygon.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 1, 0, 17);
				polygon.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 2, 0, 23);
				polygon.SetAttribute(com.esri.core.geometry.VertexDescription.Semantics.M, 3, 0, 43);
				com.esri.core.geometry.EditShape shape = new com.esri.core.geometry.EditShape();
				int geometry = shape.AddGeometry(polygon);
				com.esri.core.geometry.AttributeStreamOfInt32 vertex_handles = new com.esri.core.geometry.AttributeStreamOfInt32(0);
				int start_v = shape.GetFirstVertex(shape.GetFirstPath(geometry));
				int v = start_v;
				do
				{
					vertex_handles.Add(v);
					v = shape.GetNextVertex(v);
				}
				while (v != start_v);
				double[] t = new double[1];
				for (int i = 0; i < vertex_handles.Size(); i++)
				{
					int v1 = vertex_handles.Read(i);
					t[0] = 0.5;
					shape.SplitSegment(v1, t, 1);
				}
				com.esri.core.geometry.Polygon cut_polygon = (com.esri.core.geometry.Polygon)shape.GetGeometry(geometry);
				NUnit.Framework.Assert.IsTrue(cut_polygon.GetPointCount() == 8);
				com.esri.core.geometry.Point2D pt0 = cut_polygon.GetXY(0);
				double a0 = cut_polygon.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 0, 0);
				NUnit.Framework.Assert.IsTrue(a0 == 25);
				com.esri.core.geometry.Point2D pt1 = cut_polygon.GetXY(1);
				double a1 = cut_polygon.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 1, 0);
				NUnit.Framework.Assert.IsTrue(a1 == 7);
				com.esri.core.geometry.Point2D pt2 = cut_polygon.GetXY(2);
				double a2 = cut_polygon.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 2, 0);
				NUnit.Framework.Assert.IsTrue(a2 == 12);
				com.esri.core.geometry.Point2D pt3 = cut_polygon.GetXY(3);
				double a3 = cut_polygon.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 3, 0);
				NUnit.Framework.Assert.IsTrue(a3 == 17);
				com.esri.core.geometry.Point2D pt4 = cut_polygon.GetXY(4);
				double a4 = cut_polygon.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 4, 0);
				NUnit.Framework.Assert.IsTrue(a4 == 20);
				com.esri.core.geometry.Point2D pt5 = cut_polygon.GetXY(5);
				double a5 = cut_polygon.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 5, 0);
				NUnit.Framework.Assert.IsTrue(a5 == 23);
				com.esri.core.geometry.Point2D pt6 = cut_polygon.GetXY(6);
				double a6 = cut_polygon.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 6, 0);
				NUnit.Framework.Assert.IsTrue(a6 == 33);
				com.esri.core.geometry.Point2D pt7 = cut_polygon.GetXY(7);
				double a7 = cut_polygon.GetAttributeAsDbl(com.esri.core.geometry.VertexDescription.Semantics.M, 7, 0);
				NUnit.Framework.Assert.IsTrue(a7 == 43);
			}
		}
		public static void TestPointTypes()
		{
			com.esri.core.geometry.OperatorFactoryLocal engine = com.esri.core.geometry.OperatorFactoryLocal.GetInstance();
			com.esri.core.geometry.OperatorDifference difference = (com.esri.core.geometry.OperatorDifference)engine.GetOperator(com.esri.core.geometry.Operator.Type.Difference);
			com.esri.core.geometry.OperatorSymmetricDifference sym_difference = (com.esri.core.geometry.OperatorSymmetricDifference)engine.GetOperator(com.esri.core.geometry.Operator.Type.SymmetricDifference);
			{
				// point/point
				com.esri.core.geometry.Point point_1 = new com.esri.core.geometry.Point();
				com.esri.core.geometry.Point point_2 = new com.esri.core.geometry.Point();
				point_1.SetXY(0, 0);
				point_2.SetXY(0.000000009, 0.000000009);
				com.esri.core.geometry.Point differenced = (com.esri.core.geometry.Point)(difference.Execute(point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced.IsEmpty());
				com.esri.core.geometry.MultiPoint sym_differenced = (com.esri.core.geometry.MultiPoint)(sym_difference.Execute(point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(sym_differenced.IsEmpty());
			}
			{
				// point/point
				com.esri.core.geometry.Point point_1 = new com.esri.core.geometry.Point();
				com.esri.core.geometry.Point point_2 = new com.esri.core.geometry.Point();
				point_1.SetXY(0, 0);
				point_2.SetXY(0.000000009, 0.0);
				com.esri.core.geometry.Point differenced = (com.esri.core.geometry.Point)(difference.Execute(point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced.IsEmpty());
				com.esri.core.geometry.MultiPoint sym_differenced = (com.esri.core.geometry.MultiPoint)(sym_difference.Execute(point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(sym_differenced.IsEmpty());
			}
			{
				// point/point
				com.esri.core.geometry.Point point_1 = new com.esri.core.geometry.Point();
				com.esri.core.geometry.Point point_2 = new com.esri.core.geometry.Point();
				point_1.SetXY(0, 0);
				point_2.SetXY(0.00000002, 0.00000002);
				com.esri.core.geometry.Point differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty());
				com.esri.core.geometry.Point differenced_2 = (com.esri.core.geometry.Point)(difference.Execute(point_2, point_1, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_2.IsEmpty());
				com.esri.core.geometry.MultiPoint sym_differenced = (com.esri.core.geometry.MultiPoint)(sym_difference.Execute(point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!sym_differenced.IsEmpty());
				NUnit.Framework.Assert.IsTrue(sym_differenced.GetXY(0).x == 0 && sym_differenced.GetXY(0).y == 0);
				NUnit.Framework.Assert.IsTrue(sym_differenced.GetXY(1).x == 0.00000002 && sym_differenced.GetXY(1).y == 0.00000002);
			}
			{
				// multi_point/point
				com.esri.core.geometry.MultiPoint multi_point_1 = new com.esri.core.geometry.MultiPoint();
				com.esri.core.geometry.Point point_2 = new com.esri.core.geometry.Point();
				multi_point_1.Add(0, 0);
				multi_point_1.Add(1, 1);
				point_2.SetXY(0.000000009, 0.000000009);
				com.esri.core.geometry.MultiPoint differenced_1 = (com.esri.core.geometry.MultiPoint)(difference.Execute(multi_point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty());
				NUnit.Framework.Assert.IsTrue(differenced_1.GetPointCount() == 1);
				NUnit.Framework.Assert.IsTrue(differenced_1.GetXY(0).x == 1 && differenced_1.GetXY(0).y == 1);
				com.esri.core.geometry.Point differenced_2 = (com.esri.core.geometry.Point)(difference.Execute(point_2, multi_point_1, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced_2.IsEmpty());
			}
			{
				// multi_point/point
				com.esri.core.geometry.MultiPoint multi_point_1 = new com.esri.core.geometry.MultiPoint();
				com.esri.core.geometry.Point point_2 = new com.esri.core.geometry.Point();
				multi_point_1.Add(0, 0);
				multi_point_1.Add(1, 1);
				point_2.SetXY(0.000000009, 0.0);
				com.esri.core.geometry.MultiPoint differenced_1 = (com.esri.core.geometry.MultiPoint)(difference.Execute(multi_point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty());
				NUnit.Framework.Assert.IsTrue(differenced_1.GetXY(0).x == 1.0 && differenced_1.GetXY(0).y == 1.0);
				com.esri.core.geometry.Point differenced_2 = (com.esri.core.geometry.Point)(difference.Execute(point_2, multi_point_1, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced_2.IsEmpty());
				com.esri.core.geometry.MultiPoint sym_differenced = (com.esri.core.geometry.MultiPoint)(sym_difference.Execute(multi_point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!sym_differenced.IsEmpty());
				NUnit.Framework.Assert.IsTrue(sym_differenced.GetPointCount() == 1);
				NUnit.Framework.Assert.IsTrue(sym_differenced.GetXY(0).x == 1 && sym_differenced.GetXY(0).y == 1);
			}
			{
				// multi_point/point
				com.esri.core.geometry.MultiPoint multi_point_1 = new com.esri.core.geometry.MultiPoint();
				com.esri.core.geometry.Point point_2 = new com.esri.core.geometry.Point();
				multi_point_1.Add(0, 0);
				multi_point_1.Add(0, 0);
				point_2.SetXY(0.000000009, 0.0);
				com.esri.core.geometry.MultiPoint differenced_1 = (com.esri.core.geometry.MultiPoint)(difference.Execute(multi_point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced_1.IsEmpty());
				com.esri.core.geometry.MultiPoint sym_differenced = (com.esri.core.geometry.MultiPoint)(sym_difference.Execute(multi_point_1, point_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(sym_differenced.IsEmpty());
			}
			{
				// multi_point/polygon
				com.esri.core.geometry.MultiPoint multi_point_1 = new com.esri.core.geometry.MultiPoint();
				com.esri.core.geometry.Polygon polygon_2 = new com.esri.core.geometry.Polygon();
				multi_point_1.Add(0, 0);
				multi_point_1.Add(0, 0);
				multi_point_1.Add(2, 2);
				polygon_2.StartPath(-1, -1);
				polygon_2.LineTo(-1, 1);
				polygon_2.LineTo(1, 1);
				polygon_2.LineTo(1, -1);
				com.esri.core.geometry.MultiPoint differenced_1 = (com.esri.core.geometry.MultiPoint)(difference.Execute(multi_point_1, polygon_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty());
				NUnit.Framework.Assert.IsTrue(differenced_1.GetPointCount() == 1);
				NUnit.Framework.Assert.IsTrue(differenced_1.GetXY(0).x == 2 && differenced_1.GetXY(0).y == 2);
			}
			{
				// multi_point/polygon
				com.esri.core.geometry.MultiPoint multi_point_1 = new com.esri.core.geometry.MultiPoint();
				com.esri.core.geometry.Polygon polygon_2 = new com.esri.core.geometry.Polygon();
				multi_point_1.Add(0, 0);
				multi_point_1.Add(0, 0);
				multi_point_1.Add(1, 1);
				polygon_2.StartPath(-1, -1);
				polygon_2.LineTo(-1, 1);
				polygon_2.LineTo(1, 1);
				polygon_2.LineTo(1, -1);
				com.esri.core.geometry.MultiPoint differenced_1 = (com.esri.core.geometry.MultiPoint)(difference.Execute(multi_point_1, polygon_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced_1.IsEmpty());
			}
			{
				// multi_point/envelope
				com.esri.core.geometry.MultiPoint multi_point_1 = new com.esri.core.geometry.MultiPoint();
				com.esri.core.geometry.Envelope envelope_2 = new com.esri.core.geometry.Envelope();
				multi_point_1.Add(-2, 0);
				multi_point_1.Add(0, 2);
				multi_point_1.Add(2, 0);
				multi_point_1.Add(0, -2);
				envelope_2.SetCoords(-1, -1, 1, 1);
				com.esri.core.geometry.MultiPoint differenced_1 = (com.esri.core.geometry.MultiPoint)(difference.Execute(multi_point_1, envelope_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty() && differenced_1 == multi_point_1);
			}
			{
				// multi_point/polygon
				com.esri.core.geometry.MultiPoint multi_point_1 = new com.esri.core.geometry.MultiPoint();
				com.esri.core.geometry.Polygon polygon_2 = new com.esri.core.geometry.Polygon();
				multi_point_1.Add(2, 2);
				multi_point_1.Add(2, 2);
				multi_point_1.Add(-2, -2);
				polygon_2.StartPath(-1, -1);
				polygon_2.LineTo(-1, 1);
				polygon_2.LineTo(1, 1);
				polygon_2.LineTo(1, -1);
				com.esri.core.geometry.MultiPoint differenced_1 = (com.esri.core.geometry.MultiPoint)(difference.Execute(multi_point_1, polygon_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty() && differenced_1 == multi_point_1);
			}
			{
				// point/polygon
				com.esri.core.geometry.Point point_1 = new com.esri.core.geometry.Point();
				com.esri.core.geometry.Polygon polygon_2 = new com.esri.core.geometry.Polygon();
				point_1.SetXY(0, 0);
				polygon_2.StartPath(-1, -1);
				polygon_2.LineTo(-1, 1);
				polygon_2.LineTo(1, 1);
				polygon_2.LineTo(1, -1);
				com.esri.core.geometry.Point differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, polygon_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced_1.IsEmpty());
				polygon_2.SetEmpty();
				polygon_2.StartPath(1, 1);
				polygon_2.LineTo(1, 2);
				polygon_2.LineTo(2, 2);
				polygon_2.LineTo(2, 1);
				differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, polygon_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty());
				NUnit.Framework.Assert.IsTrue(differenced_1 == point_1);
			}
			{
				// point/polygon
				com.esri.core.geometry.Point point_1 = new com.esri.core.geometry.Point();
				com.esri.core.geometry.Polygon polygon_2 = new com.esri.core.geometry.Polygon();
				point_1.SetXY(0, 0);
				polygon_2.StartPath(1, 0);
				polygon_2.LineTo(0, 1);
				polygon_2.LineTo(1, 1);
				com.esri.core.geometry.Point differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, polygon_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty());
				NUnit.Framework.Assert.IsTrue(differenced_1 == point_1);
				point_1.SetEmpty();
				point_1.SetXY(0.5, 0.5);
				polygon_2.SetEmpty();
				polygon_2.StartPath(1, 0);
				polygon_2.LineTo(0, 1);
				polygon_2.LineTo(1, 1);
				differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, polygon_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced_1.IsEmpty());
			}
			{
				// point/envelope
				com.esri.core.geometry.Point point_1 = new com.esri.core.geometry.Point();
				com.esri.core.geometry.Envelope envelope_2 = new com.esri.core.geometry.Envelope();
				point_1.SetXY(0, 0);
				envelope_2.SetCoords(-1, -1, 1, 1);
				com.esri.core.geometry.Point differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, envelope_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced_1.IsEmpty());
				envelope_2.SetEmpty();
				envelope_2.SetCoords(1, 1, 2, 2);
				differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, envelope_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty());
				NUnit.Framework.Assert.IsTrue(differenced_1 == point_1);
			}
			{
				// point/polyline
				com.esri.core.geometry.Point point_1 = new com.esri.core.geometry.Point();
				com.esri.core.geometry.Polyline polyline_2 = new com.esri.core.geometry.Polyline();
				point_1.SetXY(0, 0);
				polyline_2.StartPath(-1, 0);
				polyline_2.LineTo(1, 0);
				com.esri.core.geometry.Point differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, polyline_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(differenced_1.IsEmpty());
				polyline_2.SetEmpty();
				polyline_2.StartPath(1, 0);
				polyline_2.LineTo(2, 0);
				differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, polyline_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty());
				NUnit.Framework.Assert.IsTrue(differenced_1 == point_1);
				polyline_2.SetEmpty();
				polyline_2.StartPath(-1, -1);
				polyline_2.LineTo(-1, 1);
				polyline_2.LineTo(1, 1);
				polyline_2.LineTo(1, -1);
				differenced_1 = (com.esri.core.geometry.Point)(difference.Execute(point_1, polyline_2, com.esri.core.geometry.SpatialReference.Create(4326), null));
				NUnit.Framework.Assert.IsTrue(!differenced_1.IsEmpty());
				NUnit.Framework.Assert.IsTrue(differenced_1 == point_1);
			}
		}
		public virtual void TestPolygonPolylineDisjoint()
		{
			com.esri.core.geometry.OperatorDisjoint disjoint = (com.esri.core.geometry.OperatorDisjoint)(com.esri.core.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.esri.core.geometry.Operator.Type.Disjoint));
			com.esri.core.geometry.SpatialReference sr = com.esri.core.geometry.SpatialReference.Create(102100);
			double tolerance = sr.GetTolerance(com.esri.core.geometry.VertexDescription.Semantics.POSITION);
			com.esri.core.geometry.Polygon polygon1 = new com.esri.core.geometry.Polygon();
			com.esri.core.geometry.Polyline polyline2 = new com.esri.core.geometry.Polyline();
			polygon1.StartPath(0, 0);
			polygon1.LineTo(0, 10);
			polygon1.LineTo(10, 10);
			polygon1.LineTo(10, 0);
			polygon1.StartPath(1, 1);
			polygon1.LineTo(9, 1);
			polygon1.LineTo(9, 9);
			polygon1.LineTo(1, 9);
			polyline2.StartPath(3, 3);
			polyline2.LineTo(6, 6);
			bool res = disjoint.Execute(polyline2, polygon1, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			res = disjoint.Execute(polygon1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline2.StartPath(0, 0);
			polyline2.LineTo(0, 5);
			res = disjoint.Execute(polyline2, polygon1, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = disjoint.Execute(polygon1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			polygon1.SetEmpty();
			polyline2.SetEmpty();
			polygon1.StartPath(0, 0);
			polygon1.LineTo(0, 10);
			polygon1.LineTo(10, 10);
			polygon1.LineTo(10, 0);
			polyline2.StartPath(2, 2);
			polyline2.LineTo(4, 4);
			com.esri.core.geometry.OperatorFactoryLocal factory = com.esri.core.geometry.OperatorFactoryLocal.GetInstance();
			com.esri.core.geometry.OperatorSimplify simplify_op = (com.esri.core.geometry.OperatorSimplify)factory.GetOperator(com.esri.core.geometry.Operator.Type.Simplify);
			simplify_op.IsSimpleAsFeature(polygon1, sr, null);
			simplify_op.IsSimpleAsFeature(polyline2, sr, null);
			res = disjoint.Execute(polyline2, polygon1, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = disjoint.Execute(polygon1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
		}
		public virtual void TestPolylinePointDisjoint()
		{
			com.esri.core.geometry.OperatorDisjoint disjoint = (com.esri.core.geometry.OperatorDisjoint)(com.esri.core.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.esri.core.geometry.Operator.Type.Disjoint));
			com.esri.core.geometry.OperatorContains contains = (com.esri.core.geometry.OperatorContains)(com.esri.core.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.esri.core.geometry.Operator.Type.Contains));
			com.esri.core.geometry.SpatialReference sr = com.esri.core.geometry.SpatialReference.Create(102100);
			double tolerance = sr.GetTolerance(com.esri.core.geometry.VertexDescription.Semantics.POSITION);
			com.esri.core.geometry.Polyline polyline1 = new com.esri.core.geometry.Polyline();
			com.esri.core.geometry.Point point2 = new com.esri.core.geometry.Point();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(2, 0);
			polyline1.LineTo(4, 2);
			point2.SetXY(1, 1);
			bool res = disjoint.Execute(polyline1, point2, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			res = disjoint.Execute(point2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			res = contains.Execute(polyline1, point2, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = contains.Execute(point2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			point2.SetXY(4, 2);
			polyline1 = (com.esri.core.geometry.Polyline)com.esri.core.geometry.OperatorDensifyByLength.Local().Execute(polyline1, 0.1, null);
			disjoint.AccelerateGeometry(polyline1, sr, com.esri.core.geometry.Geometry.GeometryAccelerationDegree.enumHot);
			res = disjoint.Execute(polyline1, point2, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = disjoint.Execute(point2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = contains.Execute(polyline1, point2, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = contains.Execute(point2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			polyline1.SetEmpty();
			point2.SetEmpty();
			polyline1.StartPath(659062.37370000035, 153070.85220000148);
			polyline1.LineTo(660916.47940000147, 151481.10269999877);
			point2.SetXY(659927.85020000115, 152328.77430000156);
			res = contains.Execute(polyline1, point2, com.esri.core.geometry.SpatialReference.Create(54004), null);
			NUnit.Framework.Assert.IsTrue(res);
		}
		public virtual void TestPolylineMultiPointRelate()
		{
			com.esri.core.geometry.OperatorRelate op = com.esri.core.geometry.OperatorRelate.Local();
			com.esri.core.geometry.SpatialReference sr = com.esri.core.geometry.SpatialReference.Create(4326);
			bool res;
			string scl;
			com.esri.core.geometry.Polyline polyline1 = new com.esri.core.geometry.Polyline();
			com.esri.core.geometry.MultiPoint multipoint2 = new com.esri.core.geometry.MultiPoint();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(10, 0);
			multipoint2.Add(0, 0);
			multipoint2.Add(5, 5);
			scl = "FF10F00F2";
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			multipoint2.Add(5, 0);
			scl = "0F10F00F2";
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "0F11F00F2";
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			polyline1.SetEmpty();
			multipoint2.SetEmpty();
			polyline1.StartPath(4, 0);
			polyline1.LineTo(0, 4);
			polyline1.LineTo(4, 8);
			polyline1.LineTo(8, 4);
			polyline1.LineTo(4, 0);
			// has no boundary
			multipoint2.Add(8, 1);
			multipoint2.Add(8, 2);
			op.AccelerateGeometry(polyline1, sr, com.esri.core.geometry.Geometry.GeometryAccelerationDegree.enumHot);
			scl = "FF1FFF0F2";
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			multipoint2.SetEmpty();
			polyline1.StartPath(4, 0);
			polyline1.LineTo(4, 0);
			multipoint2.Add(8, 1);
			multipoint2.Add(8, 2);
			scl = "FF0FFF0F2";
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			multipoint2.Add(-2, 0);
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			op.AccelerateGeometry(polyline1, sr, com.esri.core.geometry.Geometry.GeometryAccelerationDegree.enumHot);
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			multipoint2.SetEmpty();
			polyline1.StartPath(10, 10);
			polyline1.LineTo(10, 10);
			multipoint2.Add(10, 10);
			scl = "0FFFFFFF2";
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.StartPath(12, 12);
			polyline1.LineTo(12, 12);
			scl = "0F0FFFFF2";
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			multipoint2.SetEmpty();
			polyline1.StartPath(10, 10);
			polyline1.LineTo(10, 10);
			multipoint2.Add(0, 0);
			scl = "FF0FFF0F2";
			res = op.Execute(polyline1, multipoint2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
		}
		public virtual void TestPolylinePointRelate()
		{
			com.esri.core.geometry.OperatorRelate op = com.esri.core.geometry.OperatorRelate.Local();
			com.esri.core.geometry.SpatialReference sr = com.esri.core.geometry.SpatialReference.Create(4326);
			bool res;
			string scl;
			com.esri.core.geometry.Polyline polyline = new com.esri.core.geometry.Polyline();
			com.esri.core.geometry.Point point = new com.esri.core.geometry.Point();
			polyline.StartPath(0, 2);
			polyline.LineTo(0, 4);
			point.SetXY(0, 3);
			scl = "0F1FF0FF2";
			res = op.Execute(polyline, point, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			point.SetXY(1, 3);
			scl = "FF1FF00F2";
			res = op.Execute(polyline, point, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline.LineTo(4, 4);
			polyline.LineTo(4, 2);
			polyline.LineTo(0, 2);
			// no bounadry
			point.SetXY(0, 3);
			scl = "0F1FFFFF2";
			res = op.Execute(polyline, point, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "0F1FFFFF2";
			res = op.Execute(polyline, point, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			point.SetXY(1, 3);
			scl = "FF1FFF0F2";
			res = op.Execute(polyline, point, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			point.SetXY(10, 10);
			scl = "FF1FFF0F2";
			res = op.Execute(polyline, point, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline.SetEmpty();
			point.SetEmpty();
			polyline.StartPath(10, 10);
			polyline.LineTo(10, 10);
			point.SetXY(10, 10);
			scl = "0FFFFFFF2";
			res = op.Execute(polyline, point, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline.StartPath(12, 12);
			polyline.LineTo(12, 12);
			scl = "0F0FFFFF2";
			res = op.Execute(polyline, point, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline.SetEmpty();
			point.SetEmpty();
			polyline.StartPath(10, 10);
			polyline.LineTo(10, 10);
			point.SetXY(0, 0);
			scl = "FF0FFF0F2";
			res = op.Execute(polyline, point, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
		}
		public virtual void TestPolygonPolylineRelate()
		{
			com.esri.core.geometry.OperatorRelate op = com.esri.core.geometry.OperatorRelate.Local();
			com.esri.core.geometry.SpatialReference sr = com.esri.core.geometry.SpatialReference.Create(4326);
			bool res;
			string scl;
			com.esri.core.geometry.Polygon polygon1 = new com.esri.core.geometry.Polygon();
			com.esri.core.geometry.Polyline polyline2 = new com.esri.core.geometry.Polyline();
			polygon1.StartPath(0, 0);
			polygon1.LineTo(0, 10);
			polygon1.LineTo(10, 10);
			polygon1.LineTo(10, 0);
			polyline2.StartPath(-10, 0);
			polyline2.LineTo(0, 0);
			scl = "FF2F01102";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "**1*0110*";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "T***T****";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "FF2FT****";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline2.SetEmpty();
			polyline2.StartPath(0, 0);
			polyline2.LineTo(10, 0);
			scl = "**21*1FF*";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "F*21*1FF*";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "0**1*1FF*";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "F**1*1TF*";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			polyline2.SetEmpty();
			polyline2.StartPath(1, 1);
			polyline2.LineTo(5, 5);
			scl = "TT2******";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "1T2FF1FF*";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "1T1FF1FF*";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			polyline2.SetEmpty();
			polyline2.StartPath(5, 5);
			polyline2.LineTo(15, 5);
			scl = "1T20F*T0T";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polygon1.SetEmpty();
			polyline2.SetEmpty();
			polygon1.StartPath(2, 0);
			polygon1.LineTo(0, 2);
			polygon1.LineTo(2, 4);
			polygon1.LineTo(4, 2);
			polyline2.StartPath(1, 2);
			polyline2.LineTo(3, 2);
			op.AccelerateGeometry(polygon1, sr, com.esri.core.geometry.Geometry.GeometryAccelerationDegree.enumHot);
			scl = "TTTFF****";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline2.SetEmpty();
			polyline2.StartPath(5, 2);
			polyline2.LineTo(7, 2);
			scl = "FF2FFT***";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polygon1.SetEmpty();
			polyline2.SetEmpty();
			polygon1.StartPath(0, 0);
			polygon1.LineTo(0, 1);
			polygon1.LineTo(1, 0);
			polyline2.StartPath(0, 10);
			polyline2.LineTo(0, 9);
			polyline2.StartPath(10, 0);
			polyline2.LineTo(9, 0);
			polyline2.StartPath(0, -10);
			polyline2.LineTo(0, -9);
			scl = "**2******";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polygon1.SetEmpty();
			polyline2.SetEmpty();
			polygon1.StartPath(0, 0);
			polygon1.LineTo(0, 1);
			polygon1.LineTo(0, 0);
			polyline2.StartPath(0, 10);
			polyline2.LineTo(0, 9);
			scl = "**1******";
			res = op.Execute(polygon1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
		}
		public virtual void TestPolylinePolylineRelate()
		{
			com.esri.core.geometry.OperatorRelate op = com.esri.core.geometry.OperatorRelate.Local();
			com.esri.core.geometry.SpatialReference sr = com.esri.core.geometry.SpatialReference.Create(4326);
			bool res;
			string scl;
			com.esri.core.geometry.Polyline polyline1 = new com.esri.core.geometry.Polyline();
			com.esri.core.geometry.Polyline polyline2 = new com.esri.core.geometry.Polyline();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(1, 1);
			polyline2.StartPath(1, 1);
			polyline2.LineTo(2, 0);
			scl = "FF1FT01T2";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "****TF*T*";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "****F****";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "**1*0*T**";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "****1****";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "**T*001*T";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "T********";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "F********";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(1, 0);
			polyline2.StartPath(0, 0);
			polyline2.LineTo(1, 0);
			scl = "1FFFTFFFT";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "1*T*T****";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "1T**T****";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(0.5, 0.5);
			polyline1.LineTo(1, 1);
			polyline2.StartPath(1, 0);
			polyline2.LineTo(0.5, 0.5);
			polyline2.LineTo(0, 1);
			scl = "0F1FFTT0T";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "*T*******";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "*F*F*****";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(1, 0);
			polyline2.StartPath(1, -1);
			polyline2.LineTo(1, 1);
			scl = "FT1TF01TT";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(!res);
			scl = "***T*****";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(0, 20);
			polyline1.LineTo(20, 20);
			polyline1.LineTo(20, 0);
			polyline1.LineTo(0, 0);
			// has no boundary
			polyline2.StartPath(3, 3);
			polyline2.LineTo(5, 5);
			op.AccelerateGeometry(polyline1, sr, com.esri.core.geometry.Geometry.GeometryAccelerationDegree.enumHot);
			scl = "FF1FFF102";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(4, 0);
			polyline1.LineTo(0, 4);
			polyline1.LineTo(4, 8);
			polyline1.LineTo(8, 4);
			polyline2.StartPath(8, 1);
			polyline2.LineTo(8, 2);
			op.AccelerateGeometry(polyline1, sr, com.esri.core.geometry.Geometry.GeometryAccelerationDegree.enumHot);
			scl = "FF1FF0102";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(4, 0);
			polyline1.LineTo(0, 4);
			polyline2.StartPath(3, 2);
			polyline2.LineTo(3, 2);
			NUnit.Framework.Assert.IsTrue(polyline2.GetBoundary().IsEmpty());
			scl = "******0F*";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline2.LineTo(3, 2);
			NUnit.Framework.Assert.IsTrue(polyline2.GetBoundary().IsEmpty());
			scl = "******0F*";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "******0F*";
			polyline2.LineTo(3, 2);
			NUnit.Framework.Assert.IsTrue(polyline2.GetBoundary().IsEmpty());
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(3, 3);
			polyline1.LineTo(3, 4);
			polyline1.LineTo(3, 3);
			polyline2.StartPath(1, 1);
			polyline2.LineTo(1, 1);
			scl = "FF1FFF0F2";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "FF0FFF1F2";
			res = op.Execute(polyline2, polyline1, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(4, 0);
			polyline1.LineTo(0, 4);
			polyline2.StartPath(2, 2);
			polyline2.LineTo(2, 2);
			scl = "0F*******";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline2.LineTo(2, 2);
			scl = "0F*******";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
			scl = "0F*******";
			res = op.Execute(polyline1, polyline2, sr, scl, null);
			NUnit.Framework.Assert.IsTrue(res);
		}
		public virtual void TestPolygonPolylineCrosses()
		{
			com.esri.core.geometry.OperatorCrosses crosses = (com.esri.core.geometry.OperatorCrosses)(com.esri.core.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.esri.core.geometry.Operator.Type.Crosses));
			com.esri.core.geometry.SpatialReference sr = com.esri.core.geometry.SpatialReference.Create(102100);
			double tolerance = sr.GetTolerance(com.esri.core.geometry.VertexDescription.Semantics.POSITION);
			com.esri.core.geometry.Polygon polygon1 = new com.esri.core.geometry.Polygon();
			com.esri.core.geometry.Polyline polyline2 = new com.esri.core.geometry.Polyline();
			polygon1.StartPath(0, 0);
			polygon1.LineTo(0, 10);
			polygon1.LineTo(10, 10);
			polygon1.LineTo(10, 0);
			polyline2.StartPath(5, -5);
			polyline2.LineTo(5, 15);
			bool res = crosses.Execute(polygon1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			res = crosses.Execute(polyline2, polygon1, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline2.SetEmpty();
			polyline2.StartPath(5, 0);
			polyline2.LineTo(5, 10);
			res = crosses.Execute(polygon1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = crosses.Execute(polyline2, polygon1, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			polygon1.SetEmpty();
			polyline2.SetEmpty();
			polygon1.StartPath(0, 0);
			polygon1.LineTo(0, 10);
			polygon1.LineTo(10, 10);
			polygon1.LineTo(10, 8);
			polygon1.LineTo(15, 5);
			polygon1.LineTo(10, 2);
			polygon1.LineTo(10, 0);
			polyline2.StartPath(10, 15);
			polyline2.LineTo(10, -5);
			res = crosses.Execute(polygon1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			res = crosses.Execute(polyline2, polygon1, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
		}
		public virtual void TestPolylinePolylineWithin()
		{
			com.esri.core.geometry.OperatorWithin within = (com.esri.core.geometry.OperatorWithin)(com.esri.core.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.esri.core.geometry.Operator.Type.Within));
			com.esri.core.geometry.OperatorContains contains = (com.esri.core.geometry.OperatorContains)(com.esri.core.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.esri.core.geometry.Operator.Type.Contains));
			com.esri.core.geometry.SpatialReference sr = com.esri.core.geometry.SpatialReference.Create(102100);
			double tolerance = sr.GetTolerance(com.esri.core.geometry.VertexDescription.Semantics.POSITION);
			com.esri.core.geometry.Polyline polyline1 = new com.esri.core.geometry.Polyline();
			com.esri.core.geometry.Polyline polyline2 = new com.esri.core.geometry.Polyline();
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(2, 0);
			polyline2.StartPath(1.9989, 0);
			polyline2.LineTo(2.0011, 0);
			bool res = within.Execute(polyline2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = contains.Execute(polyline1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(2, 0);
			polyline2.StartPath(1.9989, 0);
			polyline2.LineTo(2.001, 0);
			res = within.Execute(polyline2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			res = contains.Execute(polyline1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(2, 0);
			polyline1.LineTo(3, 0);
			polyline1.LineTo(4, 0);
			polyline1.LineTo(5, 0);
			polyline1.LineTo(6, 0);
			polyline1.LineTo(7, 0);
			polyline1.LineTo(8, 0);
			polyline2.StartPath(0, 0);
			polyline2.LineTo(.1, 0);
			polyline2.LineTo(.2, 0);
			polyline2.LineTo(.4, 0);
			polyline2.LineTo(1.1, 0);
			polyline2.LineTo(2.5, 0);
			polyline2.StartPath(2.7, 0);
			polyline2.LineTo(4, 0);
			res = within.Execute(polyline2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			res = contains.Execute(polyline1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
		}
		public virtual void TestPolylinePolylineOverlaps()
		{
			com.esri.core.geometry.OperatorOverlaps overlaps = (com.esri.core.geometry.OperatorOverlaps)(com.esri.core.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.esri.core.geometry.Operator.Type.Overlaps));
			com.esri.core.geometry.SpatialReference sr = com.esri.core.geometry.SpatialReference.Create(102100);
			double tolerance = sr.GetTolerance(com.esri.core.geometry.VertexDescription.Semantics.POSITION);
			com.esri.core.geometry.Polyline polyline1 = new com.esri.core.geometry.Polyline();
			com.esri.core.geometry.Polyline polyline2 = new com.esri.core.geometry.Polyline();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(2, 0);
			polyline2.StartPath(1, 0);
			polyline2.LineTo(3, 0);
			polyline2.LineTo(1, 1);
			polyline2.LineTo(1, -1);
			WiggleGeometry(polyline1, tolerance, 1982);
			WiggleGeometry(polyline2, tolerance, 511);
			bool res = overlaps.Execute(polyline1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			res = overlaps.Execute(polyline2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(2, 0);
			polyline2.StartPath(1.9989, 0);
			polyline2.LineTo(2.0011, 0);
			// wiggleGeometry(polyline1, tolerance, 1982);
			// wiggleGeometry(polyline2, tolerance, 511);
			res = overlaps.Execute(polyline1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			res = overlaps.Execute(polyline2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(2, 0);
			polyline2.StartPath(1.9989, 0);
			polyline2.LineTo(2.0009, 0);
			WiggleGeometry(polyline1, tolerance, 1982);
			WiggleGeometry(polyline2, tolerance, 511);
			res = overlaps.Execute(polyline1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = overlaps.Execute(polyline2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			polyline1.SetEmpty();
			polyline2.SetEmpty();
			polyline1.StartPath(0, 0);
			polyline1.LineTo(2, 0);
			polyline2.StartPath(0, 0);
			polyline2.LineTo(2, 0);
			polyline2.StartPath(0, -1);
			polyline2.LineTo(2, -1);
			res = overlaps.Execute(polyline1, polyline2, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
			res = overlaps.Execute(polyline2, polyline1, sr, null);
			NUnit.Framework.Assert.IsTrue(!res);
		}