Example: Draw Lines, Areas and Points

In this example we create points, lines and areas in a drawing.   Choose File - Create - New Drawing to create a new, blank drawing.   That creates a table called Table which has two fields, an mfd_id field to use in a spatial index and a Geom field to host any geom data.   As we add objects to the drawing a new record will be added to this table for each new object where the geom contains the geometric data defining the object.

 

eg_draw_objs01_01.png

 

A drawing that visualizes the data in the table is also created, with a name of Table Drawing, which is intended to indicate it is the drawing that visualizes the content of Table but ends up sounding inelegant.    We will refer to it as "the drawing."   Open the drawing by double-clicking on Table Drawing.

 

il_default_mouse_nav.png

 

The cross cursor icon buttons in the toolbar control basic mouse mode.  The button to the left is Default mode where clicking the mouse has no effect and other mouse moves (clicking and dragging, mouse wheel, right click and drag) have the expected navigation effects.  See the User Interface Basics topic.

 

With the focus on a writable, open drawing window, either as a drawing window or with the focus on a drawing tab in a map window,  the other buttons will be enabled to allow us to add objects.

 

Creating Points in a Drawing

il_create_point.png

 

Click on the Create Point button to start adding points.  

 

eg_draw_objs01_02.png

 

Each time we Click a new previewed point appears, marked with a small, blue box icon to indicate what we see is just a preview until we commit the edits.   In this example we will create four new points.

 

 

eg_draw_objs01_03.png

When we are ready to commit the edits, that is, to actually add points to the table and thus to the drawing, we right-click anywhere in the drawing.

 

eg_draw_objs01_04.png

In the popup menu we choose Save Changes.   If we change our minds about adding the points that are previewed with blue boxes we can choose Undo Changes.

 

eg_draw_objs01_05.png

The four new points are created in the drawing.

 

eg_draw_objs01_06.png

 

What that means in reality is that four new records have been added to the table; the drawing just visualizes those records.  The geom value for each record defines the location of the point.

 

If we wanted to create additional points in the drawing we could continue to do so by clicking in the drawing so long as the Create Point button in the toolbar is active.   When creating points in a drawing, users will strike a balance between how many points they want to click before they decide to right-click and either Save Changes or Undo Changes.   It is not efficient to right-click after every point, but at the same time we probably wouldn't want to click hundreds of points before we right-click to commit changes.

Creating Lines in a Drawing

il_create_line.png

 

Click on the Create Line button to start adding lines.  We will create one new line in the drawing.

 

eg_draw_objs01_07.png

As we begin clicking into the drawing to create a line, each time we click a blue box appears to show the coordinate of the line that is created.   A blue line extends between the coordinate locations and to the mouse cursor to preview the shape of the line.

 

eg_draw_objs01_08.png

 

As we continue clicking the line grows.   What we see is just a preview until we commit the edits.

eg_draw_objs01_09.png

To commit the edits, that is, to create the line, we right-click anywhere in the drawing.   The blue line extending to the cursor will be ignored when we right-click.

 

 

eg_draw_objs01_10.png

In the popup menu we choose Save Changes.   If we change our minds about adding the line that is previewed in blue color we can choose Undo Changes.  tech_tina_sm.png

 

Tech tip:  When creating more complex objects such as long lines made up of many coordinates we often will want to have better control over corrections than to simply have a choice between saving the line as drawn or abandoning it.   To do that we can use the New Object Dialog.  See the New Object Dialog topic as well as the various example topics recommended in the See Also section at the bottom of this topic.

 

 

eg_draw_objs01_11.png

The new line is created in the drawing.

 

eg_draw_objs01_12.png

 

As with the creation of points, what that really means is that a new record has been added to the table.  The new record contains a geom that encodes the line.  

 

If we wanted to create additional lines in the drawing we could continue to do so by clicking in the drawing so long as the Create Line button in the toolbar is active.    Note that the creation of lines is slightly different than the creation of points in that we can create many points by clicking many times and then pressing right-click just once to create all of the previewed points at once.   In contrast, we must right-click to create each line.  

 

The difference arises from the different levels of effort required to indicate the spot where a point should go, just one click, as compared to the effort required to indicate the many spots where the coordinates of a line should go.   At times we may want to create only straight lines where two clicks are all that are required to mark the beginning and the end of the line, but usually with spatial data lines are more complex and require many more coordinates to give them the shape we want.   After clicking many times to specify the shape of a line it makes sense to then right-click to either commit the line or to abandon it.

 

Creating Areas in a Drawing

il_create_area.png

 

Click on the Create Area button to begin adding areas.    We will create one new area in the drawing.

 

eg_draw_objs01_13.png

As we begin clicking into the drawing to create an area, each time we click a blue box appears to show the coordinate for the area that is created.   A blue line extends between the coordinate locations and from the first location clicked to the mouse cursor to preview the shape of the area.

 

 

eg_draw_objs01_14.png

 

As we continue clicking the area grows.   What we see is just a preview until we commit the edits.

 

 

eg_draw_objs01_15.png

 

We click one more time to indicate the last coordinate that will define our area.

 

eg_draw_objs01_16.png

 

To commit the edits, that is, to create the area, we right-click anywhere in the drawing.   The blue line extending to the cursor will be ignored when we right-click.

 

eg_draw_objs01_17.png

In the popup menu we choose Save Changes.   If we change our minds about adding the line that is previewed in blue color we can choose Undo Changes.  

 

As with the creation of complex lines, we can also use the New Object Dialog to assist in creating areas.  Using the dialog will give us options to move, add or delete the coordinates which define the area in addition to simply saving changes or abandoning the area.

 

eg_draw_objs01_18.png

 

The new area is created in the drawing.

 

eg_draw_objs01_19.png

 

As with the creation of lines and points, what that really means is that a new record has been added to the table.  The new record contains a geom that encodes the area.  

 

To add areas which contain "holes" or "islands" see the Example: Create an Area with Holes and Islands topic.

 

Notes

Drawings must be writable -  To create objects in a drawing that drawing cannot be read-only.   That means:

 

 

The first requirement may seem painfully obvious, but it is easy to forget we might have added a data source in read-only mode.   Read-only data sources will have a small black lock as part of their icons.  

 

Also to consider are more sophisticated data sources, such as databases, where the individual drawings and other data within them might be subject to various access controls where different users have different permissions for different items, with some drawings or tables being read-only and others not.

 

The second requirement is easy to take for granted because Manifold will automatically create spatial indices on drawings that have been imported from various GIS formats or that we create using a New Drawing menu.  But if we have created a drawing using a query we might have forgotten to create it with a spatial index.   That is easy to fix.

 

See Also

Example: Add a Spatial Index to a Table - How to create a spatial index in a table.

 

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.

 

New Object Dialog

 

Example: Create a Line using the New Object Dialog - Step by step creation of a line in a drawing using the New Object Dialog.

 

Example: Create a Line using Curved Segments - Creating a line made up from curvilinear geometry using the New Object Dialog.

 

Example: Create an Area with a Hole - Using the New Object Dialog, create an area in a drawing where the area includes one or more holes.  This is similar to how we create areas that have islands as part of the area.   

 

Example: Create an Area with Holes and Islands - Using the New Object Dialog, create an area in a drawing where the area includes holes and also islands.

 

Example: Create a Multipoint - How to create multipoints using the New Object Dialog.