Пример #1
0
 internal bool? BaseEquals(Geometry other)
 {
     if (other == null)
     {
         return false;
     }
     if (object.ReferenceEquals(this, other))
     {
         return true;
     }
     if (!this.coordinateSystem.Equals(other.coordinateSystem))
     {
         return false;
     }
     if (this.IsEmpty || other.IsEmpty)
     {
         return new bool?(this.IsEmpty && other.IsEmpty);
     }
     return null;
 }
Пример #2
0
 public virtual double Distance(Geometry operand1, Geometry operand2)
 {
     throw new NotImplementedException();
 }
Пример #3
0
 internal static string ToWellKnownText(Geometry instance)
 {
     return Formatter.Write(instance);
 }
 /// <summary>
 /// Geometry Distance
 /// </summary>
 /// <param name="operand1">Operand 1</param>
 /// <param name="operand2">Operand 2</param>
 /// <returns>The operation result</returns>
 public static double? Distance(this Geometry operand1, Geometry operand2)
 {
     return OperationsFor(operand1, operand2).IfValidReturningNullable(ops => ops.Distance(operand1, operand2));
 }
        /// <summary>
        /// Try to parse the given text to a Geometry object.
        /// </summary>
        /// <param name="text">Text to parse.</param>
        /// <param name="targetValue">Geometry to return.</param>
        /// <returns>True if succeeds, false if not.</returns>
        private static bool TryUriStringToGeometry(string text, out Geometry targetValue)
        {
            if (!TryRemoveLiteralPrefix(ExpressionConstants.LiteralPrefixGeometry, ref text))
            {
                targetValue = default(Geometry);
                return false;
            }

            if (!TryRemoveQuotes(ref text))
            {
                targetValue = default(Geometry);
                return false;
            }

            try
            {
                targetValue = LiteralUtils.ParseGeometry(text);
                return true;
            }
            catch (ParseErrorException)
            {
                targetValue = default(Geometry);
                return false;
            }
        }
Пример #6
0
 public static double? Distance(this Geometry operand1, Geometry operand2)
 {
     return OperationsFor(new Geometry[] { operand1, operand2 }).IfValidReturningNullable<SpatialOperations, double>(ops => ops.Distance(operand1, operand2));
 }
Пример #7
0
 private static bool TryUriStringToGeometry(string text, out Geometry targetValue)
 {
     if (!TryRemoveLiteralPrefix("geometry", ref text))
     {
         targetValue = null;
         return false;
     }
     if (!TryRemoveQuotes(ref text))
     {
         targetValue = null;
         return false;
     }
     try
     {
         targetValue = LiteralUtils.ParseGeometry(text);
         return true;
     }
     catch (ParseErrorException)
     {
         targetValue = null;
         return false;
     }
 }