Hi,
We have been having trouble with using CAD files (CadFeatureLayer) in our projects. One we are seeing a lot is an exception when getting the bounding box.
featureSource.Open();
bounds = featureSource.GetBoundingBox();
featureSource.Close();
gives:
Exception thrown: 'System.Reflection.TargetInvocationException' in mscorlib.dll
'Pear GIS.exe' (CLR v4.0.30319: Pear GIS.exe): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PrivateAssemblies\Runtime\Microsoft.VisualStudio.Debugger.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: The input double value is out of range.
Parameter name: degreeAngle
at CadDumper.DwgDxfCadDumper.Dump()
at CadDumper.CadDumper.GetCadFeatures()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at ThinkGeo.MapSuite.Layers.CadFeatureSource.5ko=(String cadPathFilename)
at ThinkGeo.MapSuite.Layers.CadFeatureSource.40o=()
at ThinkGeo.MapSuite.Layers.CadFeatureSource.GetAllFeaturesCore(IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Layers.FeatureSource.GetBoundingBoxCore()
at ThinkGeo.MapSuite.Layers.FeatureSource.GetBoundingBox()
at enzo.PearProjection.ProjectionHelper.OutOfBounds(FeatureSource featureSource, Double eastingLimit, Double northingLimit) in C:\Users\User\Source\Workspaces\Pear Technology\Enzo\enzo\Projection\ProjectionHelper.cs:line 85
I believe the files are georeferenced for the UK national grid (OSGB) and the units are mm.