riyas
July 19, 2016, 7:17am
1
Hi,
I create one ShapeFileFeatureLayer as ‘Polyline’.
ShapeFileFeatureLayer.CreateShapeFile(ShapeFileType.Polyline, sDataPathName + “.shp”, dbfColumns);
Is it possible to create multiple feature types(Polyline and Polygon) in one ShapeFileFeatureLayer. If it is not possible, Is any other way to store Polyline and Polygon feature data as ‘shape file’.
Thanks,
Riyaz
Peter
July 20, 2016, 6:53am
2
Hi Riyas,
It’s not allow to save more than one shape types into one shapefile. There are 2 options for this:
Save the features to memory instead of file(InMemoryFeatureLayer and MapShapeLayer).
Save the features to database file (Sqlite database, MS Server database and Oracle database).
Hope it is helpful.
Thanks,
Peter
riyas
July 20, 2016, 7:38am
3
Hi Peter,
Got it.
One more thing, I am adding the features to shape file one by one. like
ShapeFileFeatureLayer.CreateShapeFile(ShapeFileType.Polyline, sDataPathName + “.shp”, dbfColumns);
ShapeFileFeatureLayer fixedLayer = new ShapeFileFeatureLayer( sDataPathName + “.shp”);
fixedLayer.Open();
fixedLayer.FeatureSource.BeginTransaction();
fixedLayer.FeatureSource.AddFeature(ft);
fixedLayer.FeatureSource.CommitTransaction();
fixedLayer.Close();
Is any provision for adding all features at once by list?
Thanks,
Riyas
Ethan
July 21, 2016, 3:21am
4
Hi Riyas,
I think you don’t need commit transaction for each feature.
fixedLayer.FeatureSource.BeginTransaction();
For(…) // loop here
{
fixedLayer.FeatureSource.AddFeature(ft);
}
fixedLayer.FeatureSource.CommitTransaction();
Regards,
Don