I have loaded a shapefile using Desktop Edition in Windows form application. I need to draw some shapes[say Rectangle] on shp file and these changes have to be committed in shp file. Now i will be able to draw shapes over shapefiles. Is is possible to save additionally added rectangle shape in my .shp file using ThinkGeo?
Cheers,
Gokul.
Editing shapefile
Hi Gokul,
MapSuite support to render, create, edit and delete shape files.
If you only want to edit data, you can try our product GisEditor. If you need handle that in our map control, please try the code as below:
ShapeFileFeatureLayer shapeFileFeatureLayer = new ShapeFileFeatureLayer(YourPath);
shapeFileFeatureLayer.EditTools.BeginTransaction();
shapeFileFeatureLayer.EditTools.Add(YourFeature);
shapeFileFeatureLayer.EditTools.CommitTransaction();
Regards,
Don
Thanks Don, really that one was useful. But my rectangle shape what i drawn is appearing on default feature style as same as that of what shapefile property is. Can i change this default rectangle colour [to some blue colour filed on shape area] and commit the same in shape file ?. Will my shape file allow this change ?
Refer this link pasteboard.co/2PPFEF5.png
Cheers,
Gokul.
Hi Gokul,
The shape file don’t contains style information, it only contains the shape and some additional information.
The style is assigned when you want to render a shape file.
If you have to save the style, you need to serialize it as your format, then save that as additional information, and when you want to render it, you read it back from additional information and write logic to restore it to style then assigned to map.
But we don’t recommend you do that.
Regards,
Don
Thanks Don. Your hints are really useful. I am a beginner to ThinkGeo, can you suggest some ThinkGeo samples in Wiki page to demo this scenario or something similar test-case ?
Cheers,
Gokul
Hi Gokul,
I am sorry maybe we don’t have an entire sample which works for your scenario.
But you can view our HowDoISamples to see how to render shape file layer and assign style to it.
Save information in feature can directly save that to feature.ColumnValue and try to write it to shape file.
Regards,
Don