public virtual void TestCreation() { { com.esri.core.geometry.OperatorFactoryLocal projEnv = com.esri.core.geometry.OperatorFactoryLocal.GetInstance(); com.esri.core.geometry.SpatialReference inputSR = com.esri.core.geometry.SpatialReference.Create(3857); com.esri.core.geometry.Polygon poly1 = new com.esri.core.geometry.Polygon(); com.esri.core.geometry.Envelope2D env1 = new com.esri.core.geometry.Envelope2D(); env1.SetCoords(855277, 3892059, 855277 + 100, 3892059 + 100); poly1.AddEnvelope(env1, false); com.esri.core.geometry.Polygon poly2 = new com.esri.core.geometry.Polygon(); com.esri.core.geometry.Envelope2D env2 = new com.esri.core.geometry.Envelope2D(); env2.SetCoords(855277, 3892059, 855277 + 300, 3892059 + 200); poly2.AddEnvelope(env2, false); { com.esri.core.geometry.OperatorEquals operatorEquals = (com.esri.core.geometry.OperatorEquals)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Equals)); bool result = operatorEquals.Execute(poly1, poly2, inputSR, null); NUnit.Framework.Assert.IsTrue(!result); com.esri.core.geometry.Polygon poly11 = new com.esri.core.geometry.Polygon(); poly1.CopyTo(poly11); result = operatorEquals.Execute(poly1, poly11, inputSR, null); NUnit.Framework.Assert.IsTrue(result); } { com.esri.core.geometry.OperatorCrosses operatorCrosses = (com.esri.core.geometry.OperatorCrosses)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Crosses)); bool result = operatorCrosses.Execute(poly1, poly2, inputSR, null); NUnit.Framework.Assert.IsTrue(!result); } { com.esri.core.geometry.OperatorWithin operatorWithin = (com.esri.core.geometry.OperatorWithin)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Within)); bool result = operatorWithin.Execute(poly1, poly2, inputSR, null); NUnit.Framework.Assert.IsTrue(result); } { com.esri.core.geometry.OperatorDisjoint operatorDisjoint = (com.esri.core.geometry.OperatorDisjoint)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Disjoint)); com.esri.core.geometry.OperatorIntersects operatorIntersects = (com.esri.core.geometry.OperatorIntersects)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Intersects)); bool result = operatorDisjoint.Execute(poly1, poly2, inputSR, null); NUnit.Framework.Assert.IsTrue(!result); { result = operatorIntersects.Execute(poly1, poly2, inputSR, null); NUnit.Framework.Assert.IsTrue(result); } } { com.esri.core.geometry.OperatorDisjoint operatorDisjoint = (com.esri.core.geometry.OperatorDisjoint)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Disjoint)); com.esri.core.geometry.OperatorIntersects operatorIntersects = (com.esri.core.geometry.OperatorIntersects)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Intersects)); com.esri.core.geometry.Envelope2D env2D = new com.esri.core.geometry.Envelope2D(); poly2.QueryEnvelope2D(env2D); com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope(env2D); bool result = operatorDisjoint.Execute(envelope, poly2, inputSR, null); NUnit.Framework.Assert.IsTrue(!result); { result = operatorIntersects.Execute(envelope, poly2, inputSR, null); NUnit.Framework.Assert.IsTrue(result); } } { com.esri.core.geometry.OperatorDisjoint operatorDisjoint = (com.esri.core.geometry.OperatorDisjoint)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Disjoint)); com.esri.core.geometry.OperatorIntersects operatorIntersects = (com.esri.core.geometry.OperatorIntersects)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Intersects)); com.esri.core.geometry.Polygon poly = new com.esri.core.geometry.Polygon(); com.esri.core.geometry.Envelope2D env2D = new com.esri.core.geometry.Envelope2D(); env2D.SetCoords(855277, 3892059, 855277 + 100, 3892059 + 100); poly.AddEnvelope(env2D, false); env2D.SetCoords(855277 + 10, 3892059 + 10, 855277 + 90, 3892059 + 90); poly.AddEnvelope(env2D, true); env2D.SetCoords(855277 + 20, 3892059 + 20, 855277 + 200, 3892059 + 80); com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope(env2D); bool result = operatorDisjoint.Execute(envelope, poly, inputSR, null); NUnit.Framework.Assert.IsTrue(!result); { result = operatorIntersects.Execute(envelope, poly, inputSR, null); NUnit.Framework.Assert.IsTrue(result); } } { com.esri.core.geometry.OperatorTouches operatorTouches = (com.esri.core.geometry.OperatorTouches)(projEnv.GetOperator(com.esri.core.geometry.Operator.Type.Touches)); bool result = operatorTouches.Execute(poly1, poly2, inputSR, null); NUnit.Framework.Assert.IsTrue(!result); } } }