Welcome to Mappy’s documentation!¶
Contents:
Indices and tables¶
Geological mapping with GIS tools¶
If your are not interested in the theory behind mappy you can skip to the `mappy <mappy.md>`_ tutorial
This document delineates some useful guidelines and highligths some common problems encountered by mappers when approaching a mapping project, with a special attention to planetary sciences. Although the disciplice is well established the tools used to generate new maps have been progressivly digitized thanks to Geographic information Systems (GIS) software.
There are many GIS software available both commercially and open-source. Open source tools are now extremely mature and can compete with commercial products under many point of views. This guide is based on QGIS but in large part the same concepts can be ported to your preferred GIS environment.
Note
Some common open-source GISs are QGIS, GRASS, OpenJump, uDig, SAGA, GVSIG
Geological mapping¶
Depending on the scope of the geological survey the cartography can depict different types of content: whether lithostratigrapy, chronostratigrapy, morphology, or other criteria are considered, the building blocks of a geological map is the geological unit, as the base element used to subdivide a region into geologically homogeneous patches of terrain.

The basic building blocks of a map are the units, which are represented with different colors on the map. Each unit is separated from the surrounding ones by lines (contacts). Some key points to keep in mind when realizing a geological map are:
Completeness: no area within the region subject to the mapping can be left unassigned.
Limited: the map should be limited to a specific region, which is defined by an exterior boundary.
Any number of additional properties can be added on top of the geological map, in the form of linear elements or polygonal shapes (which can exploit either transparency or pattern infilling)
Note
There are quite a number of predefine infilling patterns and symbology available for geological mapping. The main reference is the SGS FGDC Standard.
Geological mapping by polygons¶
Digitized maps are normally represented within GIS software as polygonal layers. Of course polygonal layers are indeed needed to visualize the mapping, making it possible to assign different colors to different units. For this reason many mappers might start a new map by creating a new polygonal layer that she/he will then populate with the different polygons representing the units.
Although this approach seems to perfectly make sense (indeed the final product should be a polygonal layer) it inherently has several drawbacks:
the mapper ends up tracing each contacts two times (one for each confining polygon)
whenever it comes to editing the map the same edits must be exactly replicated two times
the boundary of the polygons, which represent the contacts, should be stylable (e.g. to represent how much certain we are about a contact). This is not possible when a polygonal representation. The only solution would be to replicate (again!) the contacts as a new line layer that now must be also edited whenever the map is updated.
the mapper moves much of her/his attention in the polygons generation, rather than in the identification of the contacts. Furthermore, the mapper is forced to define the boundary of each polygon at once, which require to define the contacts between that unit and (potentially) many others surrounding units.
polygonal layers render impossible the application of any automated algorithm for map simplification (e.g. to smooth the contacts or even the node distances)
Note
Polygons-based mapping has a long tradition, and many GIS software offer dedicated editing tools that can alleviate many of these problems, but their correct use is demanded to the user, and not enforced by the data types.
Geological mapping by contacts and points¶
The solution to these issues might appear rather counterintuitive and require to adopt a different perspective: although the polygonal-layer map is the final product that must be generated it might not be the best format to work on. Indeed, the best solution is to avoid completely the data duplication that is inherent in any polygonal representation.
To this aim we can treat each geological element for what they really are:
Contacts are lines and not the (duplicated) boundary between two polygons
These lines must intersect each other to define valid regions
The polygons are just the infilling in between the contacts
Starting from these observations it is possible to establish a different methodology for creating a consistent map that does not suffer from all the issues detailed above:
Contacts are traced as lines. This also has the benefit to allowing the user to append additional attributes to the lines themselves (i.e. if a contact is more or less certain). To uniquely define a region in the plane the lines just need to intersect each-other. There is no need for precision snapping of the start and end points of the lines.
These contacts can be readily transformed into a polygonal layer by polygonizing them. All GISs provide adequate tools for this operation.
Attributes for the polygons can then be assigned either manually or using a point layer that labels each defined region. The latter approach allows for a complete and predictable reproducibility of the final product.
Any number of different segments can be used to define a single contact (provided they intersect somehow), making it possible to assign different attributes to different portions of the same contact (i.e. if the contact is certain in some parts and uncertain in others). This is especially important for styling the contacts in the final layout.
This approach is also more similar to the geological reasoning that is performed when mapping, especially when remotely sensed imagery is used (as in planetary mapping): the operator tries to identify the boundaries between different terrains rather than directly defining the area covered by the units themselves. This approach has several advantages:
No need to employ additional tools to grant the geometric consistency, which is automatically enforced by the data types. Indeed, errors (e.g. not intersecting lines) are readily visible because a polygon would be either missing or aggregated.
Easy editing. Any time a contact is edited the changes will automatically propagate to all affected polygons.
Reusable contacts. Contacts can be reused in map layout and styled to represent different types of contacts.
The mapper can solve the contacts working on just two units at a time, rather than having to completely define the boundary of a polygon (which might be in contact with many units).
The mapping can be performed at progressively finer level of details with no significant efforts: the mapper identify the most relevant units first and then proceed to refine the interpretation just by adding new intersecting lines.
Note
This approach leads to defining the contacts and label-points layer as the sources of a geological map, which can then be transformed to different types (the polygons) for display purposes. Such transformation is predictable and reproducible. This idea suggests that a good and reusable map should indeed also provide these layers to the public rather than just the polygonal ones. Making the map truly upgradable by third parties.
These ideas can be easily implemented in any GIS of choice by performing a polygonization
of the contacts and a spatial join
of the points to assign the attributes. If the contacts layer shall be used in the final layout imperfect intersections would leave dangling segments at the end of the lines, which require additional editing.
Mappy tutorial¶
Mappy is a QGIS plugin that simplify some useful operations needed to create geological maps by the point-and-contacts principle.
Initial setup¶
Two different layers should be created:
A line layer (either Line or MultiLine). The associated fields are not mandatory, but you might want to consider adding a couple of fields like
certainty
and/ortype
to represent the type of contact you are tracing. Keep in mind that more information you add to your vector data, more easy will be to style them later or to reuse them for other purposes.A point layer. Here we need at least one field that will be used as unique identifier for each geological unit that will be mapped. Choose for example
geo_units
.
Note
Take your time to establish the naming of your fields to be meaningful and readily understandable. The same apply for the layers. It will not influence mappy in any way, but it will help you creating a clean dataset.
The type of fields can be freely chosen, but it is highly suggested you try to define beforehand the entries that will be used when populating your map. For example a string/char
field can be used as type for the geo-units
field, but it might be difficult to be consistent when entering those long strings by hand (they could be easily misspelled), thus short names or a code for each unit might be preferable.
Note
To avoid mistakes when typing in the name of the geological unit in a string field, you could define them beforehand customizing the attribute form used to enter the field’s values. An Unique Values
or a Value Map
widget might be used for this task.
The layers can be created in any format supported by QGIS (e.g. ESRI Shapefiles), but we suggest organizing your work within a geopackage file. This open format make it possible to store within a single and portable file any number of different vector layers. To create a new geopackage use Layer> Create Layer> New Geopackage Layer
or CTRL+SHIFT+N
.

Drawing the contacts¶
Assuming you have already loaded your basemaps you can now start tracing your contacts. Just enable the editing (use Toggle Editing
from right-clicking on the layer) for your newly created layer and add new lines. Something very important that you should keep in mind is that you should not be focusing on the outline of each unit, but rather determine the contacts between the different units.

Defining indicator points¶
The next step consist in labelling each region we have identified with the contacts. To do so a point layer will be used: a new point will be placed anywhere within the given unit and its fields will be populated accordingly.
We will use the following unit’s shortcuts:
and populate the points layer. If you want you can setup dedicated field widget to ease this work (Right Click on Layer >Properties> Attributes Forms>
).

After enabling the point layer for editing we add new points by left-clicking with the mouse in the location of interest. You must activate the adequate tool for adding new points (look for Add Point Feature
button or use CTRL+.
). For each unit you will need to enter the corresponding unit. If you set up a dedicated Attribute form
the dialog will look something like this:

After adding all the needed points the results should be something like this:

Remember to save the layers by using the Save Layer Edit
in the Digitizing
toolbar.
Map generation¶
We can now use Mappy to generate a new polygonal layer that can be used for printing the map. The mappy tools can be found within the Toolbox
under Mappy
. We are especially interested into the Map Construction
processing tool where we need to select the layers that will be used as contacts and the one that represent the points.

There are not many options here but at the present implementation we have:
Extend Line Distance. Is the distance in map-units that will be used to extend each end segment of the lines. This might be useful if some of your lines do not intersect by a minimum distance. Of course is better to fix the problem by modifying the contacts layer itself.
Drop unassigned polygons. If selected, mappy will not produce polygons that were not assigned with the point layer.
Constructed Map. Is where the output will be placed.
After the map is generated it will look like this:

Mappy generated the polygonal layer for you and added the properties defined within the point layer. You can verify this by opening the attribute table for the polygonal layer:

The map can then be styled with Right-click on Layer> Properties> Symbology
. A Categorized
symbology might be used, like so (you can use the Classify
button to automatically add all your unit’s definitions, also remember to modify the Legend
items if you want a full description of the map in the printing layout):

Note
The default value for Constructed Map
option is to create a temporary layer every time the algorithm is run. During the mapping you might want to run the algorithm many times to have a peek at how your final map will look like. To avoid having to restyle everytime the newly generated map you could just set this option to overwrite a file on disk (e.g. a layer within your geopackage). In this way mappy can be run and QGIS will automatically find out that the layer was changed, and it will reload it (you can force the reloading by pressing F5
if needed).
Alternatively you can use the tool Map Automatic Styling
, privided by mappy to quick-style your newly created map.
your map might look like this:

Note
To enable this kind of transparency find the Blending Mode
option under the layer’s Symbology> Layer Rendering
dialog, and set it to Overlay
Optional: style the contacts¶
This is an experimental feature
Sometimes it might be useful to also style the contacts depending on their meaning or other qualities.
For this task mappy provides the Remove Dangles
tool which can remove any dangling line end or start to produce a new contacts layers, free of any imprecision that the operator used during mapping. The original attributes are retained and can be used to style the contacts:

Note
The same considerations for the styling apply to the contacts, if you need to regenerate them many times it is better to just overwrite the same layer on disk. In this way QGIS will remember the style settings for that layer. If needed use F5
to reload the layer