Defining the Projection of a Vector Dataset

This tutorial covers assigning coordinate reference system information to a shapefile that is missing this information.

Included in this tutorial:

  • Datasets missing their projection/CRS information

  • Three approaches to defining or assigning a projection: Assign Projection tool, Define Projection tool, and directly assigned to the layer within the map project

Software version in examples: QGIS-LTR 3.40.5-Bratislava

Tutorial Data: The tutorial uses the 1:10m Admin 0 - Countries shapefile downloaded from Natural Earth.

Credits: Sally Kaye and L. Meisterlin (2025)

The tutorial uses a shapefile downloaded from Natural Earth (citation below). In our example, the .prj file (which contains the projection and coordinate system information) associated with the shapefile has been deleted. As a result, the example shapefile is missing its CRS information.

Natural Earth. “Admin 0 - Countries.” [shapefile]. 1:10m Cultural Vectors, version 5.1.1. 12 May 2022. Accessed 17 June 2025 from https://www.naturalearthdata.com/downloads/10m-cultural-vectors/ 

IMPORTANT NOTE: Repairing a dataset by assigning or defining a CRS is not equivalent to reprojecting the layer. None of the methods or tools listed here reproject features. Instead they repair incorrect CRS information and/or replace missing CRS information. These tools require that you know, beforehand, the correct CRS of the dataset (presumably listed in its metadata).

 

Datasets Missing Projection/CRS Information

When data missing its spatial reference is added to a project, a ? icon will appear next to the layer name in the Layers Panel. When you hover over this icon, QGIS displays a warning message.

warning generated by QGIS when a dataset missing spatial information is added


Defining a Projection

There are a few ways to assign a projection to a layer missing this information, which will result in different dataset outcomes. 

Option 1: Assign Projection

The Assign Projection processing tool creates a new layer with the new CRS and keeps the current layer. In other words, it does not alter the original dataset. (The new layer can be temporary within the current project or saved as a new dataset.) As a result, this tool can be used to assign CRS information to a layer that is missing such information and/or to repair a layer with an incorrect CRS. 

To access the tool, navigate through Vector general > Assign Projection in the Processing Toolbox. Alternatively, you can find the tool by searching with the Processing Toolbox’s search bar. The location of the tool is included in the image below.

Briefly, the primary parameters for the Assign Projection tool include

  • Input Layer: Using dropdown menu  to select the layer that is missing a CRS. You can also browse for the layer by clicking the three-dot menu button.

  • Assigned CRS: Specify the CRS to assign to the input layer. You can choose from the drop-down list of recent CRSs or browse using the button to the right of the options.

  • Output options: (In the image below, this option is mislabeled.) By default, the tool generates a temporary layer and opens (or adds) it to the current project. You can also choose to create a new dataset file by clicking the three-dot button to the right and specifying a name and location for saving the new file.

viewing the Assign Projection tool

Additionally, you may notice that the tool includes the option to assign a CRS to selected features only, thus subsetting the dataset while applying the new CRS to that particular group of features. 

Option 2: Define Shapefile Projection

The Define Shapefile Projection tool sets a CRS for the current layer, adding projection information to the original vector dataset; it will alter the original dataset and not create a new layer. 

To access the tool, navigate through Vector general > Define Shapefile Projection in the Processing Toolbox. Alternatively, you can find the tool by searching with the Processing Toolbox’s search bar. The location of the tool is included in the image below.

The tool’s parameters are simple:

  • Input Shapefile: Using the dropdown menu or the browse button, select the input shapefile that is missing its .prj file.

  • CRS: Specify the CRS to assign to the input shapefile.

viewing the Define Shapefile Projection tool

Option 3: from the layer, within the current project

You can assign a CRS to a layer without one specified within the current project. 

IMPORTANT NOTE: Setting the projection/CRS in this way adds new information to an existing feature layer within your project, but it won’t change the original, underlying dataset. To save the layer and its added CRS for future use, right-click the layer name and navigate through Export > Save Features As.

To access these options, click the warning icon next to the layer name (in the Layers panel) to pull up a dialogue box and define the CRS. 

The dialogue box’s options should be familiar. Here, you can choose the coordinate system to be applied to the layer: use the Filter search box to search preset CRSs, pick from Recently Used Coordinate Reference Systems, or search with the organized list of Predefined Coordinate Reference Systems. 

Our example data’s original CRS was unprojected WGS84, so we replace the missing information by selecting this CRS and click OK to save the CRS information. 

selecting a CRS for a layer missing its projection information

The warning icon will disappear when CRS information has been successfully added to a layer.

 
Previous
Previous

Spatial Joins

Next
Next

Finding the (Average) Center of Features