QGIS 3 Girona is the most recent version of this powerful free software, with notable improvements in the administration, visualization, and consultation of files. In this opportunity the creation of vectorial files is approached, highlighting the differences with the previous versions.
The old Shapefile is the most widely used geospatial file in the GIS field, however, its replacement by more versatile and complete formats has long been announced, specifically by spatial databases, ESRI has prioritized the use of Geodatabases and now QGIS does the same with SQLite (through the Spatial Lite extension).
In previous versions of QGIS the Shapefile vector file was the protagonist followed by Spatial Lite (SQLite), the new version of QGIS marks a change by elevating the status within its interface to the Geopackage database format (Spatial Lite implementation). It is important to note that we can also create Spatial Lite layers in QGIS 3.
Spatial databases overcome the limitations of Shapefile by allowing tables, Raster and Vector data to be stored and managed in a single file.
Comparing Spatial Lite and Geopackage is a broad topic that we will address later.
How to create Shapefile files in QGIS 3?
There are several alternatives for creating Shapefiles, you can use the menu bar in the following sequence:
Another way is to use the toolbars, in this case the “Layers Manager > New File Layer Shape…”.
The most direct alternative is via the “Data Source Manager” bar.
Defining the characteristics of the Shapefile
Regardless of which mode is selected, a dialog box is displayed in which each of its parameters can be configured.
- File name – Defines the name and path where it is stored in the new shapefile.
- File encoding – By default System or UTF-8 appears, it is recommended to keep it so as not to have problems with incompatibility of characters in the attribute tables.
- Geometry type – This is important because it allows you to define the new vector layer, be it point, line or polygon.
- You have the option to include the third dimension “Z”, with click to this option you can add and edit the height values of the vertexes of the entities.
- There is also the option to add “M” values, useful for geocoding.
- To define the geographic or projected coordinate system, click on the Select SRC button to choose between the recently used systems, or click on it to search and select the system of preference.
- In this same dialog box you can design the table of attributes, i.e. define the fields. By default the table is created with only the default field Id, in case no other field is added.
- It is possible to create four types of fields according to the type of data: text, integers, decimal numbers and date data.
- Click on OK to finish with the creation of the new shapefile.
Differences with the QGIS 2x version
In addition to those already commented, it can be pointed out:
- In QGIS 2.x versions you can create a Shapefile layer by combining the Ctrl+Shift+N keys, in QGIS 3 version the same sequence allows you to create a Geopackage.
- QGIS 3 incorporates the buttons to create Shapefiles and Geopackages in the “Data Source Manager” bar.
- QGIS 3 gives options for assigning Z and M dimensions.