private void Coordinates_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (_ignoreCoordChanged) { return; } switch (e.Action) { case NotifyCollectionChangedAction.Add: foreach (ICoordinate item in e.NewItems) { switch (item.Dimension) { case 2: OgrGeometry.AddPoint_2D(item.X, item.Y); break; case 3: OgrGeometry.AddPoint(item.X, item.Y, item.Z); break; case 4: OgrGeometry.AddPointZM(item.X, item.Y, item.Z, item.M); break; } } break; default: throw new NotImplementedException(); } }
public double Distance(ICoordinate coord) { double ret = 0; if (coord != null) { ret = OgrGeometry.Distance(coord.ToOgrPoint()); } return(ret); }
public double Distance(IGeometry g) { double ret = 0; if (g != null) { ret = OgrGeometry.Distance(g.ToGeometry()); } return(ret); }
public IGeometry Intersection(IGeometry other) { IGeometry destGeometry = null; if (other != null) { destGeometry = OgrGeometry.Intersection(other.ToGeometry()).ToGeometry(); } return(destGeometry); }
public bool Intersects(IGeometry g) { bool ret = false; if (g is Geometry geometry) { ret = OgrGeometry.Intersects(geometry.OgrGeometry); } return(ret); }
public bool Contains(IGeometry g) { bool ret = false; if (g != null) { ret = OgrGeometry.Contains(g.ToGeometry()); } return(ret); }
public IGeometry Union(IGeometry other) { IGeometry destGeometry = null; if (other != null) { var geometry = OgrGeometry.Union(other.ToGeometry()); destGeometry = geometry.ToGeometry(); } return(destGeometry); }
private void Geometries_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (_ignoreGeoChanged) { return; } switch (e.Action) { case NotifyCollectionChangedAction.Add: foreach (Geometry item in e.NewItems) { OgrGeometry.AddGeometry(item.OgrGeometry); } break; default: throw new NotImplementedException(); } }
public override int GetHashCode() { int hashCode = GeometryType.GetHashCode() ^ OgrGeometry.GetHashCode(); return(hashCode); }
public bool IsEmpty() => OgrGeometry == null ? true : OgrGeometry.IsEmpty();
public double Length() => OgrGeometry == null ? 0 : OgrGeometry.Length();
public double Area() => OgrGeometry == null ? 0 : OgrGeometry.Area();