private void UpdateGeometry(Geometri.Område område, Geometry geometry) { foreach (OmrådeMedGeometry t in Områder) { if (t.Område.AreaId != område.AreaId) { continue; } t.Geometry = geometry; return; } Områder.Add(new OmrådeMedGeometry(område, geometry)); }
public bool ClipAndAdd(Geometri.Område område, Geometry geometry, double marginFactor) { if (!geometry.Envelope.Intersects(GetEnvelope())) { Log.w("TILE", $"Tried to update tile {TileCoordinates}, but nothing to do for {område.Type} Id {område.AreaId}"); } var envelope = GetBufferedEnvelope(marginFactor); var clip = Intersect(new Feature(geometry), envelope); if (clip == null || clip.IsEmpty) { return(false); } UpdateGeometry(område, clip); VisualizeEnvelope(); return(true); }
/// <summary> /// Allows each geometry to control any custom behavior that cannot be solved with MemberwiseClone. /// The Coordinates of the geometry are already duplicated. /// </summary> /// <param name="copy"></param> protected virtual void OnCopy(Geometry copy) { }
/// <summary> /// Handles the duplication process for geometry collections /// </summary> protected override void OnCopy(Geometry copy) { GeometryCollection gc = copy as GeometryCollection; if (gc == null) return; gc._geometries = new Geometry[_geometries.Length]; for (int i = 0; i < _geometries.Length; i++) gc._geometries[i] = (Geometry)_geometries[i].Clone(); }
/// <summary> /// Creates a copy of this Point with the same factory /// specifications and values. /// </summary> protected override void OnCopy(Geometry copy) { base.OnCopy(copy); Point p = copy as Point; if (p != null) { p.SetCoordinate(Coordinate.Copy()); } }
/// <summary> /// Returns a copy of this ILineString /// </summary> protected override void OnCopy(Geometry copy) { base.OnCopy(copy); LineString ls = copy as LineString; if (ls == null) return; ls.Coordinates = new List<Coordinate>(); foreach (Coordinate coordinate in _points) { ls.Coordinates.Add(coordinate); } }
/// <summary> /// Occurs during the copy process and ensures that the shell and holes are all duplicated and not direct references /// </summary> /// <param name="copy"></param> protected override void OnCopy(Geometry copy) { base.OnCopy(copy); Polygon poly = copy as Polygon; if (poly == null) return; poly.Shell = _shell.Copy(); poly.Holes = new ILinearRing[_holes.Length]; for (int i = 0; i < _holes.Length; i++) poly.Holes[i] = Holes[i].Copy(); }
public OmrådeMedGeometry(Geometri.Område område, Geometry geometry) { Geometry = geometry; Område = område; }