Example: Edit a Shapefile In Place

In this example we learn how to edit ESRI shapefiles  "in place," that is, leaving the data in the shapefile and only linking it into a project and not importing it into the project.

Link a Shapefile into the Project

To edit a file in place we can either link it into the project or create a new data source using the file.   For connections to more complex data such tables within an Oracle database, we would create a new data source using File - Create - New Data Source.   For simple files like shapefiles we will link it into the project using File - Link.




We launch Manifold and then choose File - Link.




In the Link dialog we browse into the folder where our shapefiles are located, we click on the .shp file and then press Open.





The link appears in the project as a database cylinder, indicating the data is hosted outside of the project.  We click on the + plus icon to expand it.






Within the linked data hierarchy we double-click on the states drawing to open it. The drawing shows provinces ("states") in Mexico.   Note that the database cylinder now has an asterisk sub-icon to indicate it has been used and thus may have been changed.


Edit the Drawing


When we edit the drawing that is in the linked shapefile we are editing the shapefile.   To demonstrate, we will do two simple edits.  First we will delete some objects from the drawing and then next we will edit a field in the drawing's table.






Ctrl-click on some of the area objects to select them.






Press the Delete key or choose Edit - Delete and they are deleted.






Double-click the states Table table to open it.   





We click into the PROVINCE cell for the province of Durango and we edit it to use a mix of upper and lower case.






We press Ctrl-Enter to commit the edit and then we choose File - Save to save the changes to the shapefile.






The linked data's database cylinder no longer has an * asterisk sub-icon since we have saved the changes.

Verify the Shapefile has been Edited

Now that we have edited the shapefile in place, we can try importing it into a new blank project to see if we have indeed made the edits we intended.   We choose File - New to close the project and to open a new, blank project.





Choose File - Import.




In the Import dialog we browse over to the shapefile, click it to highlight it and then press Open.   Note that in the file folder there is now a .mapcache file that Manifold wrote when we edited the shapefile, to make it easier and quicker for Manifold to use the shapefile again.






The shapefile imports as a drawing and the drawing's table.  We double-click on the drawing to open it.   We see that the provinces we deleted are indeed deleted.





We double-click on the table to open that as well.  We can see that the edit we made to the PROVINCE field for the province of Durango has indeed happened: the name of the province is in mixed case.


Shapefiles have limitations as discussed in the SHP, Shapefiles  topic.   For example, a shapefile can contain only points, or only lines or only areas, but not a mix of points, lines and areas.   Because of that limitation of shapefile format we could have edited this shapefile to add a square shape to it, for example, but we could not have edited it to add group of points or lines.

See Also

File - Export


Change Projection


Initial Projection


SHP, Shapefiles


Example: Import a Shapefile - ESRI shapefiles are a very popular format for publishing GIS and other spatial data.  Unfortunately, shapefiles often will not specify what projection should be used.  This example shows how to deal with that quickly and easily.


Latitude and Longitude are Not Enough


Shapefiles Strangely Out of Shape


Three Letter Extensions