예제 #1
0
        static bool BinaryPredicate(MgGeometryRef thisRef, IGeometryRef otherRef, Func <MgGeometry, MgGeometry, bool> operation)
        {
            var impl = otherRef as MgGeometryRef;

            if (impl != null)
            {
                return(operation(thisRef._geom, impl._geom));
            }
            throw new ArgumentException("Incorrect IGeometryRef implementation");
        }
예제 #2
0
        static IGeometryRef BinaryOperator(MgGeometryRef thisRef, IGeometryRef otherRef, Func <MgGeometry, MgGeometry, MgGeometry> operation)
        {
            var impl = otherRef as MgGeometryRef;

            if (impl != null)
            {
                var result = operation(thisRef._geom, impl._geom);
                return(new MgGeometryRef(result));
            }
            throw new ArgumentException("Incorrect IGeometryRef implementation");
        }
        /// <summary>
        /// Sets the geometry value of the specified property
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        public void SetGeometry(string name, IGeometryRef value)
        {
            var propVal = _values[name] as GeometryValue;

            if (propVal == null)
            {
                throw new InvalidOperationException(string.Format(Strings.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Geometry.ToString()));
            }

            propVal.Value = value;
        }
예제 #4
0
        public static MgByteReader GetAgf(IGeometryRef geom)
        {
            MgGeometry mgeom = _wktRw.Read(geom.AsText());

            return(_agfRw.Write(mgeom));
        }
예제 #5
0
 public bool Within(IGeometryRef other) => BinaryPredicate(this, other, (a, b) => a.Within(b));
예제 #6
0
 public IGeometryRef Union(IGeometryRef other) => BinaryOperator(this, other, (a, b) => a.Union(b));
예제 #7
0
 public bool Touches(IGeometryRef other) => BinaryPredicate(this, other, (a, b) => a.Touches(b));
예제 #8
0
 public IGeometryRef SymmetricDifference(IGeometryRef other) => BinaryOperator(this, other, (a, b) => a.SymetricDifference(b));
예제 #9
0
 public bool Overlaps(IGeometryRef other) => BinaryPredicate(this, other, (a, b) => a.Overlaps(b));
예제 #10
0
 public IGeometryRef Intersection(IGeometryRef other) => BinaryOperator(this, other, (a, b) => a.Intersection(b));
예제 #11
0
 public bool Intersects(IGeometryRef other) => BinaryPredicate(this, other, (a, b) => a.Intersects(b));
예제 #12
0
 public bool Equals(IGeometryRef other) => BinaryPredicate(this, other, (a, b) => a.Equals(b));
예제 #13
0
 public bool Disjoint(IGeometryRef other) => BinaryPredicate(this, other, (a, b) => a.Disjoint(b));
예제 #14
0
 public bool Crosses(IGeometryRef other) => BinaryPredicate(this, other, (a, b) => a.Crosses(b));
예제 #15
0
 public bool Contains(IGeometryRef other) => BinaryPredicate(this, other, (a, b) => a.Contains(b));
 /// <summary>
 /// Sets the geometry value at the specified index
 /// </summary>
 /// <param name="index"></param>
 /// <param name="value"></param>
 public void SetGeometry(int index, IGeometryRef value)
 {
     SetGeometry(_ordinalMap[index], value);
 }