Dear ThinkGeo team,
Our customer has extra-large scale shapefiles (attached) and got ‘Attempted to divide by zero’ error when click on map-control. The error comes from GetFeaturesNearestTo() method. Below are details of the error information.
Please help us to fix this problem.
Thank you very much!!!
Mengbo
/////////////// Error Details /////////////////////
We use your Map suite Desktop with version 9.0.0.854 (today version).
Open an extra-large scale shape file (attached). Click on the map-control and get a point shape (X = 35671570693374.945, Y = 20838915659409.129). Then pass this shape to ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesNearestTo(BaseShape targetShape, …). Got exception as below.
************** Exception Text **************
System.DivideByZeroException: Attempted to divide by zero.
at GisSharpBlog.NetTopologySuite.Algorithm.CGAlgorithms.IsCCW(ICoordinate[] ring)
at GisSharpBlog.NetTopologySuite.Operation.Buffer.OffsetCurveSetBuilder.AddPolygonRing(ICoordinate[] coord, Double offsetDistance, Positions side, Locations cwLeftLoc, Locations cwRightLoc)
at GisSharpBlog.NetTopologySuite.Operation.Buffer.OffsetCurveSetBuilder.AddPolygon(IPolygon p)
at GisSharpBlog.NetTopologySuite.Operation.Buffer.OffsetCurveSetBuilder.Add(IGeometry g)
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.Buffer(IGeometry g, Double distance, Int32 quadrantSegments, BufferStyle endCapStyle)
at ThinkGeo.MapSuite.Core.BaseShape.eT4=(Double distance, Int32 quadrantSegments, BufferCapType bufferCapType)
at ThinkGeo.MapSuite.Core.BaseShape.BufferCore(Double distance, Int32 quadrantSegments, BufferCapType bufferCapType, GeographyUnit shapeUnit, DistanceUnit distanceUnit)
at ThinkGeo.MapSuite.Core.BaseShape.Buffer(Double distance, GeographyUnit shapeUnit, DistanceUnit distanceUnit)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesWithinDistanceOfCore(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, Double distance, IEnumerable1 returningColumnNames) at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesWithinDistanceOf(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, Double distance, IEnumerable
1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesNearestTo(BaseShape targetShape, GeographyUnit unitOfData, Int32 maxItemsToFind, IEnumerable`1 returningColumnNames, Double searchRadius, DistanceUnit unitOfSearchRadius)