I'm looking at importing some cad data into sharpmap using the OGR extension. The data loads fine and looks good. However it loads into a single layer called entities. What is the best way to split it out into sublayers?
I tried this.
var myFile = new SharpMap.Data.Providers.Ogr(@"Q:\GIS\DXF Sample\KP105-01.dxf", 0);
var myLayer = new SharpMap.Layers.VectorLayer("Floorplan", myFile);
var myfoundationSource = new SharpMap.Data.Providers.GeometryFeatureProvider(new FeatureDataTable());
for (int i = 0; i <= myLayer.DataSource.GetFeatureCount() - 1; i++)
var myfeat = myLayer.DataSource.GetFeature((uint)i);
but it doesn't work. I get no features, even though there are some that meet the conditions. Addrow throws a 'Row already part of table error'.
Is there a clone method? or do I need to remove from the source table first? is the GeometryFeatureProvider the best way of doing this?