I would like to create one shape per sales rep that is made of multiple zip. I think that the code is OK but I am not that sure...
anyway when I execute it I got this exception on the : unionMultipolygonShape = MultipolygonShape.Union(areaBaseShapes);
statement. The selectedZipFeatures is made of 643 features. (number of zips for a single sales rep).
thanks for your help!
foreach (DictionaryEntry s in _repNameList) { inMemoryFeatureLayer_Zips_Colorization.FeatureSource.Open(); selectedZipFeatures = inMemoryFeatureLayer_Zips_Colorization.FeatureSource.GetFeaturesByColumnValue(RequestedColumns_RepPerZip[0].ColumnName.ToString(), s.Value.ToString()); inMemoryFeatureLayer_Zips_Colorization.FeatureSource.Close(); areaBaseShapes = new Collection<AreaBaseShape>(); if (selectedZipFeatures.Count > 0) { foreach (Feature feature in selectedZipFeatures) { areaBaseShapes.Add((AreaBaseShape)feature.GetShape()); } unionMultipolygonShape = MultipolygonShape.Union(areaBaseShapes); if (unionMultipolygonShape.Polygons.Count > 0) inMemoryFeatureLayer_Zips_Colorization_union.InternalFeatures.Add(new Feature(unionMultipolygonShape)); } }
System.OutOfMemoryException was unhandled by user code
Message=Exception of type 'System.OutOfMemoryException' was thrown.
Source=NetTopologySuite
StackTrace:
at GisSharpBlog.NetTopologySuite.Noding.SegmentNodeList.CreateSplitEdge(SegmentNode ei0, SegmentNode ei1)
at GisSharpBlog.NetTopologySuite.Noding.SegmentNodeList.AddSplitEdges(IList edgeList)
at GisSharpBlog.NetTopologySuite.Noding.SegmentString.GetNodedSubstrings(IList segStrings, IList resultEdgelist)
at GisSharpBlog.NetTopologySuite.Noding.SegmentString.GetNodedSubstrings(IList segStrings)
at GisSharpBlog.NetTopologySuite.Noding.MCIndexNoder.GetNodedSubstrings()
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferBuilder.ComputeNodedEdges(IList bufferSegStrList, IPrecisionModel precisionModel)
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferBuilder.Buffer(IGeometry g, Double distance)
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferOp.BufferOriginalPrecision()
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferOp.ComputeGeometry()
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferOp.GetResultGeometry(Double distance)
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferOp.Buffer(IGeometry g, Double distance)
at GisSharpBlog.NetTopologySuite.Geometries.Geometry.Buffer(Double distance)
at ThinkGeo.MapSuite.Core.AreaBaseShape.Union(IEnumerable`1 areaShapes)
at MapTest.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Users\a09zmzz\Documents\Visual Studio 2010\Projects\MapTest\MapTest\WebForm1.aspx.cs:line 238
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException: