/// <summary> /// Creates ShapePageSet.Enumerator which can be used to cycle very large datasets. /// </summary> /// <param name="parent"></param> public Enumerator(ShapeReader parent) { _source = parent._source; _pageSize = parent.PageSize; _envelope = parent.Envelope; Reset(); }
/// <summary> /// Update header extents from the geometries in a IShapeSource /// </summary> /// <param name="src"></param> protected void UpdateExtents(IShapeSource src) { var sr = new ShapeReader(src); Extent env = null; foreach (var page in sr) { foreach (var shape in page) { Extent shapeExtent = shape.Value.Range.Extent; if (env == null) { env = (Extent)shapeExtent.Clone(); } else { env.ExpandToInclude(shapeExtent); } } } // Extents for an empty file are unspecified according to the specification, so do nothing if (null == env) { return; } var sh = new ShapefileHeader(Filename); sh.SetExtent(env); sh.Save(); }
/// <summary> /// Creates ShapePageSet.Enumerator which can be used to cycle very large datasets. /// </summary> /// <param name="parent"></param> public Enumerator(ShapeReader parent) { _source = parent._source; _count = -1; _index = -1; _pageSize = parent.PageSize; _envelope = parent.Envelope; }