Dear John Diss,
I am using SharpMap v0.9 - build 2423 in a WinForms application.
I am filling the geometries in a FeatureDataTable and setting the VectorLayer's DataSource property to a GeometryFeatureProvider which holds the before mentioned FeatureDataTable. It has been working wonderfully until now.
Now I have a need to also add Shape file layers into the map. Below is the code I am using to load a shape file:
VectorLayer shpLayer = new VectorLayer(layerName);
shpLayer.DataSource = new ShapeFile(shpFilePath, false);
shpLayer.Style.Outline = Pens.Black;
shpLayer.Style.EnableOutline = true;
The problem is that most of the shape files I use for testing raise an exception in the constructor of QuadTree(List<BoxObjects> objList, uint depth, Heuristic heurdata). The objList parameter contains zero elements in it. Therefore the line "_box
= objList.box;" throws an IndexOutOfRange exception.
For some files, no exceptions are thrown, but nothing is displayed in the map either!
I do understand that based on the Datum of various layers the projections need to be transformed. But in the proof-of-concept I am working right now, there are no such tricky circumstances. I have a dummy form with a MapImage control and the above code
to load shape file in it.
Please help me out with this. I definitely don't want to upgrade to SharpMap v2 before it atleast reaches the RC stage. If I am not wrong, it is in alpha right now.