Hi,
I’m trying to load some S-57 nautical chart from NOAA office and I’m getting a rather odd error. I’m using the following code with map units in decimal degrees.
NauticalChartsFeatureLayer nc = new NauticalChartsFeatureLayer(file);
nc.Open();
RectangleShape rect = nc.GetBoundingBox();
FileInfo fi = new FileInfo(file);
LayerOverlay lo = new LayerOverlay();
lo.Layers.Add(fi.Name, nc);
map.Overlays.Add(fi.Name, lo);
The error is as follows. Am I missing a library or is it a v10 issue. The file I am loading is from the HowDoI samples and I can confirm that the sample runs in the HowDoI code which is v12. Interesting, I get a valid extent from the GetBoundingBox.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=ThinkGeo.MapSuite
StackTrace:
at ThinkGeo.MapSuite.Layers.RtreeSpatialIndex.0ig=()
at ThinkGeo.MapSuite.Layers.RtreeSpatialIndex.3yg=(Double upperLeftX, Double upperLeftY, Double lowerRightX, Double lowerRightY)
at ThinkGeo.MapSuite.Layers.RtreeSpatialIndex.3yg=(RectangleShape rectangle)
at ThinkGeo.MapSuite.Layers.RtreeSpatialIndex.GetFeatureIdsIntersectingBoundingBoxCore(RectangleShape boundingBox)
at ThinkGeo.MapSuite.Layers.NauticalChartsFeatureSource.Ak8=(RectangleShape boundingBox, IEnumerable1 returningColumnNames) at ThinkGeo.MapSuite.Layers.NauticalChartsFeatureSource.GetFeaturesForDrawingCore(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable
1 returningColumnNames)
at ThinkGeo.MapSuite.Layers.FeatureSource.GetFeaturesForDrawing(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable1 returningColumnNames) at ThinkGeo.MapSuite.Layers.FeatureSource.GetFeaturesForDrawing(RectangleShape boundingBox, Double screenWidth, Double screenHeight, ReturningColumnsType returningColumnNamesType) at ThinkGeo.MapSuite.Layers.NauticalChartsFeatureLayer.DrawCore(GeoCanvas canvas, Collection
1 labelsInAllLayers)
at ThinkGeo.MapSuite.Layers.Layer.uyc=(GeoCanvas canvas, Collection1 labelsInAllLayers) at ThinkGeo.MapSuite.Layers.Layer.Draw(GeoCanvas canvas, Collection
1 labelsInAllLayers)
at ThinkGeo.MapSuite.WinForms.LayerOverlay.DrawCore(GeoCanvas canvas)
at ThinkGeo.MapSuite.WinForms.Overlay.lVU=(GeoCanvas canvas)
at ThinkGeo.MapSuite.WinForms.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.WinForms.WinformsMap.TlU=(IEnumerable`1 drawingOverlays, RectangleShape extent)
at ThinkGeo.MapSuite.WinForms.WinformsMap.TVU=(RectangleShape drawingExtent, RectangleShape extent)
at ThinkGeo.MapSuite.WinForms.WinformsMap.bFU=(RectangleShape extent)
at ThinkGeo.MapSuite.WinForms.WinformsMap.IRk=(Int32 delayInterval, RectangleShape extent)
at ThinkGeo.MapSuite.WinForms.WinformsMap.Refresh()
at NauticalCharts.Form1.btnNautical_Click(Object sender, EventArgs e) in
Thanks,
Damian