Ejemplo n.º 1
0
		///<summary>
		///  Returns string containing error message if IsValid() returns false or OK if no error exists.  
		///</summary>
		///<returns>Returns string corresponding to error message if IsValid fails.</returns>
		public virtual string IsValidErrorMessage()
		{
			TopologyValidationError er = GetValidOpError();
			string errorMessage = "OK";
			if ( er != null )
				errorMessage = er.ToString();

			return errorMessage;
		}
Ejemplo n.º 2
0
        public void TestInvalidCoordinate()
        {
            Coordinate badCoord = new Coordinate(1.0, Double.NaN);

            Coordinate[]            pts       = { new Coordinate(0.0, 0.0), badCoord };
            IGeometry               line      = geometryFactory.CreateLineString(pts);
            IsValidOp               isValidOp = new IsValidOp(line);
            bool                    valid     = isValidOp.IsValid;
            TopologyValidationError err       = isValidOp.ValidationError;
            Coordinate              errCoord  = err.Coordinate;

            Assert.AreEqual(TopologyValidationErrors.InvalidCoordinate, err.ErrorType);
            Assert.IsTrue(Double.IsNaN(errCoord.Y));
            Assert.AreEqual(false, valid);
        }