02. Basic Principles - millsapjohn/qgis_civiltools GitHub Wiki

Default Layers

In order to ease the use of CivilTools in a GIS context, the plugin requires that the user create a default GeoPackage (created from a template, saved in the plugin folder) that contains a number of default layers. This is known as "initializing the project" and must be completed before the various tools can be used.

Initializing a Project

An open QGIS project can be initialized by opening the Plugins -> CivilTools menu and clicking the "Initialize Project" button. This will launch a popup dialog where the user can select a name and location to save the default layers GeoPackage, which contains layers for the following feature types:

  • points
  • lines/polylines
  • polygons
  • TIN points
  • TIN triangles
  • grading points
  • grading breaklines
  • grading polygons
  • Grading Region lines/polylines
  • Grading Region polygons
  • pipes
  • pipe structures
  • dimension points
  • dimension lines

Once a file name and location have been specified, click OK to initialize the project. The GeoPackage will be added to the QGIS Browser panel, and the default layers for lines, points, and polygons will be added to the project's layers in a group labeled "CivilTools."

Running Commands

In the nomenclature of QGIS, CivilTools is a "map tool," in the same way that Pan, Zoom, and Select Features are map tools. Like the other map tools, it can be activated by either clicking the associated button (labeled "Drafting Mode") or by entering a keyboard shortcut. The default keyboard shortcut to enter Drafting Mode is CRTL+ENTER, but this can be changed in the Settings -> Options menu. When drafting mode is active, a colored border (red by default) will appear around the edges of the map canvas, and the cursor will change to a pick box with crosshairs.

CivilTools commands can be run in one of two ways: by navigating the CivilTools submenus under the main Plugins menu, or by using a keyboard shortcut. When in drafting mode, any of CivilTools' commands can be run by entering their 1 to 3 letter shortcut and pressing Enter. Commands can be exited early by pressing Escape. When in drafting mode, pressing Enter when no command is active will re-run the previous command.

Many commands have sub-commands available, each with their own keyboard shortcut - for example, options to create a circle based on a centerpoint and radius or a centerpoint and diameter. When a command is activated, any available sub-commands will be listed in a tooltip next to the cursor.

Snaps

One of the most useful tools when creating objects is the ability to snap to the geometry of another object - for example, being able to draw a line exactly perpendicular to another line. CivilTools comes with the following snapping options:

  • endpoint
  • midpoint
  • center
  • node (i.e., a point object)
  • intersection
  • perpendicular
  • tangent (to a circle or arc)
  • nearest (snaps to any geometry within the cursor search radius)

Each snap has a unique glyph that appears when a snap of that type is available within the cursor search radius, and the cursor itself will be automatically moved (thus the term "snap") to that location. Snaps can be turned on or off via the expandable Snaps toolbar, or in the right-click menu. Additionally, any layers in the drawing can be added to an "exclude list," meaning they will not be available for snapping. The "exclude list" is available in the Options menu. Finally, the cursor search radius (the distance from the cursor where snaps can appear) can be configured in the Options menu as well.

Grips

Grips are specific areas on a feature that can be selected and manipulated. For example, a feature vertex can be moved by hovering over, then clicking, on a vertex grip; a polygon can be moved with the center grip; etc. Each grip type has its own glyph, much like a snap; right-clicking on a grip will bring up a context menu allowing the user to select the desired operation.

Right Click Menu

The right click menu is highly context-dependent; many different options will be available depending on the type of feature selected, or whether a feature is selected at all.