4

I am creating a shapefile programmatically using DotSpatial using the following example syntax / pseudo code

FeatureSet features = new FeatureSet(DotSpatial.Topology.FeatureType.Polygon);
features.DataTable.Columns.Add( … // add column names and types

foreach (var featureData in featurDataCollection) //loop adding many features
{ 
    IGeometry feature = …  // create feature with attribution + geometry
    features.add(feature);
}

features.SaveAs(filepath, true);

I would like to ensure the output ShapeFile has a spatial index. Is there a way to do this programmatically in .Net, (preferably using the DotSpatial libraries).


It would appear that in my naiveté that I have asked a more difficult question than I thought. It seems that the .sbn format is not as open as the other shapefile formats and there has been some work on reverse engineering this. There also seems some mention of a C# implementation that creates .sbn files but I am still trying to figure this out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.