Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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).

EDIT

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 drawing a blank.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.