Example: Edit Covered Objects

Working with drawings where within the same drawing some areas completely cover smaller areas is a bad idea, but sometimes we have to work with data in that form whether we like it or not.   This topic shows techniques that can help us select and edit objects that are completely hidden by higher objects. tech_angus_sm.png


Important: When objects completely cover other objects that is a situation best handled by using multiple drawings, so that objects which cover other objects can be placed into higher or lower layers as desired.   Layers are the user interface element that allows us to deal with "higher / lower" relationships in a simple, point-and-click way.   If we must keep data in a form where higher and lower objects are stored within the same drawing, that necessarily complicates things.   The techniques below are mostly a collection of practical hacks as an experienced user might apply them.   Some, such as alt-clicking on an object and expecting to choose the lowest object (the object which is drawn first because it was encountered first) might not apply in all cases.  For example, when many threads are generating many different objects to feed to the rendering engine there is no guarantee what will be considered upper or lower.   The techniques described in this topic are still worthwhile hacks to try in most cases, before resorting to more intricate workflow.

When Larger Areas Cover Smaller Areas

When several different objects are located at exactly the same locations with exactly the same shapes it is a good idea to keep them in separate drawings.  For example, if we create three points at exactly the same location within the same drawing when that drawing is opened it will appear that only a single point exists at that location: when all three points are stacked on top of each other at exactly the same location, if they are styled the same way there is no visual indication there are three points at that location.


Within the same drawing Manifold will draw areas first, lines second and points third.  That rule ensures that points will not be hidden by areas above them.   Areas are drawn in whatever order the database engine fetches them.  Since tables are unordered, areas may be drawn in various orders.   Since rendering can be optimized through the use of multiple threads or by other means, there is no guarantee that even if records within a table are displayed in some order that area rendering will match that same order.


Likewise, when larger areas are located and sized so they completely cover smaller areas in the same drawing, there is no visual indication that a smaller area might be underneath the larger area.


Consider the illustration above, showing a drawing as if it were seen in an inclined view, representing a drawing where two smaller triangular areas have been drawing below two larger rectangular areas. The illustration represents a single drawing, where all four area objects are in that same drawing.  It does not show two drawings as layers where one drawing is a layer above the other drawing.




In real life, of course, drawings are not something we can tilt and look into.   In real life, we would see that drawing as above.   If areas use a solid area style we could not see through the upper areas and we would never know there are two triangular areas underneath.    


Given the popular use of solid area styles to format areas in drawings, because we cannot see smaller areas that happen to lie under bigger areas within the same drawing, it is a very bad idea to arrange our data in drawings so that smaller areas are hidden by bigger areas.    When smaller areas are hidden by bigger areas,  a tremendous advantage of GIS, the visual cues a drawing gives us by displaying data visually, turns into a big disadvantage because we cannot trust the visual cues we see.   If something is hidden, then we no longer have the benefit of "what you see is what you get."


Therefore, we should do all possible to clean up our data and to organize it as best as possible to avoid situations where larger areas are drawn to overlap smaller areas.    When that is not possible and we find ourselves having to work with such unclean data, the tips in this topic can help.

Transparent Area Fill Color

The simplest way to show smaller areas that fall below larger areas is to use transparent color for area fill color in the Style panel.


eg_edit_covered_objects01_03.png  eg_edit_covered_objects01_03a.png


We alter settings in the Style panel so the area color used for borders is a thematic format using the above palette based on mfd_id, and we set the area Fill color to transparent.




Right away, the hidden areas appear.   The problem with the above style settings is that we cannot tell what is a figure drawn with lines and what is an area.  




We can fix that by using a hatch pattern style.   We choose the vertical lines hatch pattern in the Symbol button, and then we press the Rotation button to apply a thematic format that varies the angle of the hatch lines.




The hatch pattern is drawn using foreground color, with transparent color used for the area fill.  That allows the lower areas to be seen through the upper areas.

Select and Delete

After using transparent color for area fill and hatch patterns for styles we can see formerly hidden areas.  We can then utilize various mouse moves to select and to otherwise work with whichever area we want.    We begin with selection.




Ctrl-click on the blue hatched area, clicking on a spot safely outside the red hatched area underneath.




The upper area is selected.  




We can press Delete to delete it.

Adjust the Selection and Delete

Suppose we would like to select the lower area?




Ctrl-click within the bounds of the orange hatched area.




Both the orange hatched area and the larger, pale green hatched area are selected, since the click was within both.   We now Shift-Ctrl-click onto the selected larger area to deselect it, choosing a location to click that we know is safely outside the smaller area.  




The result is that the larger area is deselected while the smaller, lower area remains selected.




We can now press Delete to delete the smaller, lower area.

Alt-click to Edit

When multiple objects are stacked on top of each other in the same drawing, what object an Alt-click chooses can depend on happenstance, but usually the first object encountered in the table and thus the lowest object rendered (because it is rendered first) is the one which is chosen.   We can exploit this by Alt-clicking onto the lowest object to choose it.




In the illustration above, we have Alt-clicked onto the red hatched triangle, which has been rendered below the blue hatched rectangle.




That chooses the red hatched triangle, displaying field values in the Record panel.  




To edit the shape of that red hatched triangle we could click the Coordinates tab of the Record panel, or we could have Shift-Alt-clicked the red triangle.




To choose another object we click the Values tab of the Record pane, and Alt-click in a blank spot to clear our choice of the triangle.




Next, we Alt-click on the larger, blue hatched rectangle.




That chooses the larger, blue hatched rectangle


Alt-click Through an Object


We can choose a first-drawn, and thus lower, object even if we cannot see it.




Suppose we use solid area style so we cannot see objects below the larger, upper objects.   We can Alt-click into the middle of the blue rectangle where we know the click falls within the bounds of the unseen red triangle underneath.




Even though it is not seen, the red triangle underneath is chosen.  A blue preview of the outline together with edit handles at the vertices of the area appear.    This is clearly a hack, but sometimes it is a very quick and convenient hack.  

Use a Field to Specify Z Order

We can create a new field in a table and use it to choose higher or lower objects.   Such fields are often called "Z" fields because they specify higher or lower order of rendering.   Since heights in GIS are often called Z values (as in the third dimension, Z, after X and Y dimensions) the lower to higher order in which objects are rendered is called Z ordering.




Suppose we add a field called Size and for the areas in our sample drawing we assign the value of Small, for the smaller triangles, or Big, for the bigger rectangles.




We can provide more systematic visual cues on what is higher or lower by doing thematic formatting based on the Size field.




In the above, all Small objects have been formatted pale green and all Big objects have been formatted orange.




We can use a quick hack to "hide" the Big objects by double-clicking into their color well in the thematic format and changing their color to transparent color.




The result is that the upper, Big objects, those that normally hide the lower, Small objects, seem to disappear.   That gives us a clear view of the lower objects.




Double-clicking onto the color well in the thematic format for the Big objects and choosing orange color, then pressing Update Style, makes them re-appear.




Using the Select Panel

We can exploit the contents of records to select areas based on fields.




To select the smaller areas below the larger ones, we can use the Select panel to select records with Small as the value of the Size field.




We can then Shift-Ctrl-click either of the areas we wish to de-select, if we do not want to select them both.

Copy Lower Objects into a New Layer

It is so easy to copy and paste objects that we can use copy and paste to make copies of areas that might be hidden by other areas.




To copy areas, we right-click the Drawing tab and choose Open Table to open the table for that drawing.   We then press Ctrl-C to Copy the selected records.


Next, in the Project pane we press Ctrl-V to Paste or we click the Paste toolbar button.  That creates a new table.  We right-click the table and choose Create - New Drawing, and we name the new drawing Small, a name we choose to remind us what the drawing contains.




We drag and drop the Small drawing as a layer into our drawing.   It now shows exact copies of the two triangles that were rendered below the larger rectangles.   This is a quick and dirty way of exploiting layers to get access to objects that are hidden in below other objects, or which are otherwise difficult to choose.   If we want to see field values for either of those triangles, we can just Alt-click the one we are interested in.  Because it is an exact copy, with attribute values the same it gives us the same read-out in the Record panel as would the original object that is hidden from view in the Drawing layer.


Use the New Layer as a Guide Layer

Even if we now use a solid style in the Drawing layer, we can still see from the Small layer where the lower triangles are located, by using what we can easily see in the Small layer as a guide.




In the illustration above we have used Style to format the Small drawing areas in yellow color, and then we have used the Layers pane to make the Small drawing partially transparent..   We have clicked the Drawing tab to move the focus onto the Drawing layer.    Now, when we Alt-click that click will apply only to objects in the Drawing layer.   We can use the objects in the Small layer above it as a guide.





The blue preview and vertices are a preview of the lower, unseen triangle that is in the Drawing layer and below the larger, blue rectangle.




In the Record panel we click the Coordinates tab to switch the vertex boxes into edit handles, and then we drag one of them to a new location.  In the Record panel we click Update Record to apply the change.




The result may be visually unexpected:  when we edited the lower, previously-unseen triangle we made the record a "newer" record in the table.  It now is drawn after the larger, blue rectangle so it now appears above the larger, blue rectangle.   What we see in the display above is the red shape of the edited object.  Part of it appears orange because we are seeing that part of the red shape through the partially-transparent yellow triangle in the Small layer above.   The combination of partially-transparent yellow plus red results in an orange color in that region.





Double-clicking the Small layer off, we can see how the Drawing layer now looks.   What used to be a smaller, red triangle that was rendered below the larger, blue rectangle has been reshaped by our editing and is now drawn above the larger, blue rectangle.

Misconception: Query to Order By Z

It is easy to forget that the order in which records appear is not the order in which we can safely assume they will be rendered.



In the table above, we have added a Z field with numbers from 1 to 4 for each object.




We can write a query called z order that generates the same table, but ordered as a results table based on Z value.   We can then create a drawing from that query using the procedure described in the Example: Create a Drawing from a Query topic.




At first glance, the drawing seems to do what we might expect.  It renders objects in their Z order as given in the results table of the query.  Because the orange triangle comes last in the table (with a Z of 4) it is rendered last, above the larger, pale green rectangle.    The red triangle comes first in the results table (with a Z of 1) so it is rendered first, that is, below the larger, blue rectangle.


But this is a case where results using small data and a simple situation are deceiving.   There is no guarantee in what order objects will be rendered regardless of the order in which they appear in a table when there are larger numbers of objects or more threads.   Suppose we have a complex query that runs using many threads, but it generates relatively few records in the results table.   Despite having few objects exactly in what order the different threads contribute to that results table is not predictable, and the order in which records are taken from that table to be drawn is also not predictable.    


Therefore, we can use a field like the example Z field to guide our work with selection if we want to select and then copy and paste, but we cannot force a display, at least not yet, to be rendered in order based upon a field.  It is likely as Manifold evolves that in the future options will be added to use Z order for rendering.  Stay tuned!


See Also





Editing Drawings


Style: Drawings


Style: Thematic Formatting


Contents - Layers


Contents - Record


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


Example: Trace an Area in a Map over an Image Background - In a map with a drawing layer above an image layer, create an area object in the drawing by tracing over the outlines of something seen in the image layer below.


Example: Edit Coordinates While Creating an Object - When creating an object in a map using a tool such as Create Area, right in the middle of the process we can edit coordinates in the Contents - Record panel's Coordinates tab.   This example shows the step by step process.


Example: Edit Attributes and Move a Point - We look at the attributes for a point in a drawing layer and edit one of the attributes using a more expanded Edit dialog.  We then move the point to a new location. Easy!


Example: Create a Multipoint - This topic provides two examples:  First we create a multipoint and then next we create a multipoint having two branches.  The purpose of this topic is to help teach the implementation of geometry in Manifold and other spatial packages using an unusual and rarely met object type, the multipoint, which combines what appear to be many separate points into a single multipoint object.



Manifold Future - Future Tour Part 1 - This video shows how to download and use a portable installation for Manifold Future.  The video also shows the Contents, pane, layers and layer opacity, one click use of data source favorites, using your own archival favorite and getting record values instantly.  If you are using Viewer or Radian Studio, download and use the Future version to get access to all these powerful new features.


Manifold Future - Future Tour Part 2 Editing - The video shows how to create new objects, how to add fields and vertices and move vertices around, how to edit existing objects and how to use simple selection methods to choose vertices to move together, including moving all objects.


Manifold Future - Future Tour Part 3 Editing - The editing tour continues with a look at how to create branched objects, including how to create areas with holes and islands, how to add branches to lines and how to add coordinates between vertices in existing objects.  We finish up by creating an area that traces over a pond in the Luxembourg Gardens in Paris using a Google satellite view, and then we add a hole to that area and two additional islands.


Manifold Future - Future Tour Part 4 Edit Attributes, Move a Point - We use Manifold Future to see how to view attributes of objects in drawings, including use of the new Edit dialog to view long, multi-paragraph text fields.  We edit fields and see how easy it is to preview edits and either accept them or abandon them. We switch to editing the geometry of objects in a drawing, viewing the coordinate locations and using mouse moves to reposition points. We edit the location of a point to correct an error in a drawing, using Google Satellite view to provide context for the correction.  Fast and easy, with previews all the way!