Example: Repair a Wrong Edit using a Backup

This example shows how to quickly make a backup table and to then copy and paste geometry from that table to repair errors made when editing objects.  This technique is a life-saver when edits go astray.

 

The technique is simple:

 

 

In the example that follows we show all steps.  That makes for a longer topic but it helps beginners who might not be familiar with basic moves.

 

eg_repair_edit01_00.png

 

We begin with a project that has one drawing, along with, of course, that drawing's table.

 

eg_repair_edit01_01.png

 

Opening the drawing we see it shows the pre-2016 arrangement of regions in France (before regions were consolidated into a smaller number of larger, but less visually pretty, regions).

 

eg_repair_edit01_02.png

 

Opening the drawing's table we see it gives the name of each region, called a Province in this example, along with the Geom field that gives the geometry for each area.   When we edit the shapes of objects in a drawing, we are editing the geometry that is contained within the Geom field for each object.

Make a Backup Copy of the Table

All of the geometry for the drawing is stored in the drawing's table.   We begin by making a backup copy of the table, so that if anything goes wrong when we edit the drawing we have a snapshot of what the geometry was before we started editing. Making a backup copy takes but a second.

 

eg_repair_edit01_03.png

 

In the Project pane we click the Provinces Table to highlight it and then we press Ctrl-C to Copy the table.  We could also have chosen Edit - Copy from the main menu, or we could also have right-clicked onto the table and chosen Copy from the context menu.   Experienced Manifold users just click and Ctrl-C.  

 

eg_repair_edit01_04.png

 

We then press Ctrl-V to Paste a copy of the table.   Manifold automatically names the copy Provinces Table 2.   We could also have chosen Edit - Paste from the main menu, or we could also have right-clicked onto a blank spot in the Project pane and chosen Paste from the context menu.   Experienced Manifold users simply do a Ctrl-V.  

Edit the Drawing

Now that we have a backup, we can fearlessly edit the drawing, knowing that we can use our backup copy of the table to recover from errors in editing.

 

eg_repair_edit01_05.png

 

We zoom into the Gironde estuary, on the Atlantic coast between Aquitaine and Poitou-Charentes.   

 

eg_repair_edit01_06.png

 

We will edit the shape of Aquitaine.   To put the area into editing mode, we Shift-Alt-click onto it.

 

eg_repair_edit01_07.png

 

Editing handles appear.  We can move these about as described in the Editing Drawings and other topics.

 

eg_repair_edit01_08.png

 

Whoops!   Suppose we have edited the shape of Aquitaine in a catastrophically wrong manner.   Without an "undo" how can we restore the original shape of Aquitaine?

 

eg_repair_edit01_09.png

 

That is easy.  We begin by Ctrl-clicking the area to select it.  

 

eg_repair_edit01_10.png

 

The area immediately is redrawn in red selection color.

 

eg_repair_edit01_11.png

 

The corresponding record in the drawing's table also immediately is redrawn in red selection color.  We select the object not because we are required to select it to fix it.   We select the object because doing so immediately highlights in red selection color the record for the object that must be repaired.    If we have a very large table it can be difficult to find the right record for an object that must be repaired.  Once we visually select it in the drawing, we can easily use a Filter to show only selected records in the table.    Given the very small size of the table in this example we do not need to use a filter, as the selected record is obvious, but if the table were large, without doubt we would use a filter.   

 

Another reason to select the area first is that we might not know the area to be repaired is Aquitaine.   Selecting it first tells us the name of the province to find in the backup table.

 

eg_repair_edit01_12.png

 

We open the backup table, called Provinces Table 2.   In the backup table we find the record for Aquitaine (using Edit - Find or simply Ctrl-F).   We right-click into the Geom cell for the Aquitaine record and choose Copy from the context menu.   That copies the geometry for the Aquitaine object onto the Windows clipboard.

 

eg_repair_edit01_13.png

 

Back in the working table for the drawing we are editing, the Provinces Table, we right-click into the Geom cell for the Aquitaine record and choose Paste from the context menu.   That pastes the geometry we copied from the backup table.    This shows another reason to select the object to be repaired:  when the target record is highlighted in red selection color we are much less likely to make a mistake and paste geometry into the wrong record.

 

eg_repair_edit01_14.png

 

After pasting, we do not see a change in the table.

 

eg_repair_edit01_15.png

 

However, in the drawing the object has immediately been redrawn to use the new geometry that we pasted.  Aquitaine has now been restored to its original shape.

 

eg_repair_edit01_16.png

 

To deselect the area so it does not use red selection color, we can Shift-Ctrl-click onto the area to deselect it, or choose Edit - Select None or press Shift-Ctrl-A for select none.

 

Notes

Multiple copies - Experienced Manifold users will often make multiple copies of a drawing's table while editing the drawing.  At any moment they can do a quick Ctrl-C and Ctrl-V to make a copy of the table as it stands at that moment.   Manifold will automatically iterate the name, so that it is easy to create a series of table copies called Provinces Table 2, Provinces Table 3, and so on.  At any point we can restore objects to their geometry as it was in any of those tables.   

 

Copy and Paste from other sessions - This example shows a copy and paste using a backup table that was made in the same project.   Suppose we opened the project and began editing the drawing but we forgot to first make a backup copy of the drawing's table?   No problem!   Suppose the project we opened was called Provinces.   We use File - Save As to save the project using a new name, such as Provinces 01.   Next, we launch another Manifold session and in that second session we open the original Provinces project.  In that second session we open the Provinces Table (which is still the original table, since we have opened the original, unsaved project), and we Copy the geometry for Aquitaine.   We switch to our current working session that is using the Provinces 01 project and we Paste the geometry for Aquitaine just as shown in the example above.     The point is that we can copy and paste geometry between different Manifold sessions using different projects.   We are not limited to only copying and pasting geometry within the same Manifold session and the same project.

 

Provinces vs. Regions - The illustrations in this topic use data from the US government, which show the regions of France as they were before 1 January 2016, when the regions in France were reduced from 22 to 13.  Centre is the same it was with just a change of name.

 

The drawing is called Provinces and not Regions because it was clipped out of a larger data set showing provincial boundaries for the entire world.  Around the world sub-national divisions such as US states or French regions are called many different things, but the word provinces seems to have become a reasonably generic word that militaries and others engaged in mapping often use.   State is rarely used because in many cultures it is a synonym for country and thus does not capture the notion of the administrative sub-units of a given country.

 

See Also

Getting Started

 

User Interface Basics

 

Tables

 

Selection

 

Drawings

 

Coordinates

 

Contents - Transform

 

Example: Editing Records in a Table - How to edit the contents of an existing record using mouse and keyboard.

 

Example: Draw Lines, Areas and Points - Simple example of using basic mouse moves to add points, lines and areas to a drawing.

 

Example: Drawings use Geom Fields in Tables  - An essential discussion on how drawings are created from geom fields in tables, including how the drawing knows which coordinate system to use.

 

Example: Multiple Drawings from the Same Table - Illustrates how easy it is to create multiple drawings that use the same table and same geometry by copying and pasting an existing drawing.  Each new drawing takes no additional storage space in the project, but can be formatted differently.   

 

Example: Two Drawings from the Same Table - Take a table with a geom field that is visualized by a drawing.  Add a second geom field to the table and create an rtree index on that field so it can be visualized by a drawing.   Copy the first drawing, paste it and adjust the pasted copy so it uses the second geom field. Demonstrate how to use the Transform panel to show "live" modifications in the second drawing compared to the first drawing.

 

Example: Create a Drawing from a Geocoded Table - A geocoded table has records with a latitude and longitude for each record.   This example starts with a table containing a list of cities with a latitude and longitude field for the location of each city.   We create a geom from the latitude and longitude fields using a template in the Transform panel and then we create a drawing that shows the cities as points.  This example shows all the infrastructure steps involved.

 

Example: Copy one Column into Another Column with Transform - How to use the Transform panel to copy the contents of one column in a table into another column, but only for selected records.  Uses the Products table from the Nwind example data set.  

 

Example: Transform Field Values using an Expression in the Transform Panel - How the Expressions tab of the Transform panel may be used to change the values of fields.  

 

Example: Construct JSON String using Select and Transform - Use the Select panel and Transform panel to manually construct a JSON string using values from other fields in a table. Shows how we can manipulate text to build desired contents in a field.

 

Example: Edit a Drawing with Transform Templates - In this example we open a drawing and edit objects in the drawing using Transform panel templates.  Includes examples of using the Add Component button and also the Edit Query button.