hello, i have a question,when i worked with dotspatial reference in c# i founded that when you create a polygone shapefile and save it you see that the last line dose not save and we have not a complete polygone layer,please answer,i attached the created polygone shapefile and used codes and filles and methods,Please check my polygone shapefile in attached file and answer why we can not create the closed and complete polygone with dotspatial topology refrences,thanks,
Comments: Polygons have to be closed by definition. That means the first and last point of a polygon have to be the same. Add ``` IFeature existingFeature = polygonF.Features[polygonF.Features.Count - 1]; existingFeature.Coordinates.Add(coord); ``` to the else part (mouse right click) of the polygon case of your map1_MouseDown function. This closes your polygon by adding the first point again as last point. It is not a good idea to add an polygon with only one coordinate to a polygon layer and hope the user adds at least 2 more coordinates afterwards. This causes defective polygons if your user stops editing before he has added 3 coordinates. It would be better to keep a temporary list of the coordinates and only add the polygon to the polygon layer if it has at least 3 differend coordinates and its IsSimple function returns true. Otherwise you have to make sure that your polygon becomes simple before you add it to a polygon layer. You can have a look at the source code of the shape editors [AddShapeFunction.cs](https://dotspatial.codeplex.com/SourceControl/latest#Trunk/DotSpatial.Plugins.ShapeEditor/AddShapeFunction.cs) if you want to know how creating polygons with a temporary list can be done.
Comments: Polygons have to be closed by definition. That means the first and last point of a polygon have to be the same. Add ``` IFeature existingFeature = polygonF.Features[polygonF.Features.Count - 1]; existingFeature.Coordinates.Add(coord); ``` to the else part (mouse right click) of the polygon case of your map1_MouseDown function. This closes your polygon by adding the first point again as last point. It is not a good idea to add an polygon with only one coordinate to a polygon layer and hope the user adds at least 2 more coordinates afterwards. This causes defective polygons if your user stops editing before he has added 3 coordinates. It would be better to keep a temporary list of the coordinates and only add the polygon to the polygon layer if it has at least 3 differend coordinates and its IsSimple function returns true. Otherwise you have to make sure that your polygon becomes simple before you add it to a polygon layer. You can have a look at the source code of the shape editors [AddShapeFunction.cs](https://dotspatial.codeplex.com/SourceControl/latest#Trunk/DotSpatial.Plugins.ShapeEditor/AddShapeFunction.cs) if you want to know how creating polygons with a temporary list can be done.