eyecatch

How to Create a New Shapefile in QGIS

Published: Last updated:
This article uses QGIS 3.34. The current LTR is 3.44.

What you'll learn


  • How to create a new Shapefile
  • How to create vector data

Recommended for


  • Anyone new to QGIS
  • Anyone who wants to create their own GIS data
  • Anyone who wants to create a new Shapefile

Introduction

The first thing you need when you create map data is a new vector layer. In QGIS, you can easily draw points, lines, and polygons with a Shapefile and build map data of your own. This article explains the steps for creating a new Shapefile.

For more details about Shapefiles, see the article below.

Points to note about Shapefiles

Many programs now support the Shapefile GIS data format, but there are a few points to keep in mind when you use it.

  • It is made up of multiple files
  • The file size limit is 2 GB
  • Attribute field names are limited to 10 bytes (up to 10 single-byte characters)

QGIS also supports other file formats such as GeoPackage and GeoJSON, so choose the data format that suits your needs.

Related article

Create a new Shapefile

First, create a new layer to hold points, lines, or polygons.

From the menu bar, choose Layer → Create Layer → New Shapefile Layer.

Choose New Shapefile Layer
Choose New Shapefile Layer

The New Shapefile Layer dialog opens.

At the top of the dialog, you set basic items such as the save location, the geometry type, and the coordinate reference system (CRS) of the data. This example creates a point layer. For the CRS of the layer, choose the latitude and longitude CRS EPSG:4326 - WGS 84.

  1. Click the ... button and specify the save location and file name for the data.
  2. Set the File encoding. This example uses UTF-8.
  3. Select the Geometry type. This example uses Point.
  4. Select the CRS of the layer. Click the globe button (Select CRS) at the far right and choose the CRS.
The settings for the save location and geometry type, shown here for a point layer
The settings for the save location and geometry type, shown here for a point layer

This example creates a point layer. To create a line layer, select LineString. To create a polygon layer, select Polygon.

With No Geometry, you can create a layer that has no shapes such as points, lines, or polygons, only a table (attribute information).

Choosing the geometry type. Select the geometry type you want to create
Choosing the geometry type. Select the geometry type you want to create

Next, set up the attribute fields under New Field. You can add fields later, but if you already know which fields you need, it is best to set them up now. This example adds a text field named name.

  1. Enter the field name in Name. Note that Shapefile field names are limited to 10 single-byte characters.
  2. Choose the data type that fits the values you will enter, from the options below.
    • Text (string): Enter text strings.
    • Integer (32 bit): Enter integer values.
    • Decimal (double): Enter numbers with decimal places.
    • Date: Enter dates.
  3. Use Length to set the number of characters the field can hold (the number of digits for a number), and Precision to set the number of digits after the decimal point.
    • For example, to enter a 6-digit number with three decimal places, such as 135.245, set Length to 6 and Precision to 3.
  4. Click Add to Fields List.
  5. The field appears in Fields List with the settings you entered.
    • To delete a field, select it and click Remove Field at the bottom right.
Set up the new field to add
Set up the new field to add

When all the settings are done, click OK.

When the settings are done, click OK
When the settings are done, click OK

The new layer appears in the Layers panel. However, the layer has no features yet, so nothing appears on the map.

The new layer is added
The new layer is added

Open the attribute table of the new layer. It contains the columns for the fields you set up during creation.

The attribute table has the columns you set up in advance
The attribute table has the columns you set up in advance

Once you have created a new Shapefile, the next step is to add features to the layer. Another article covers how to add features.

Conclusion

This article showed how to create a new Shapefile. When you create your own point, line, or polygon data, start by preparing a new layer as in these steps.

Also, as mentioned at the beginning, Shapefiles have some limitations. Use other data formats as needed.

About the author
QGIS LAB Editorial Team
QGIS LAB Editorial Team

QGIS LAB is a comprehensive information hub for QGIS, the open-source GIS software. Under the concept of “Geospatial for Greater Good,” we share the knowledge and skills to open up the world through location data.