When working with spatial data in GIS software, you regularly encounter the problem of files that lack a clearly defined coordinate system.
When a file lacks its coordinate system (CSR), it can lead to misaligned layers, incorrect measurements, and a host of other problems that hinder accurate data visualization and analysis.
In this article we will try to give you the tips and tools available in 2023 to identify file coordinate systems with unknown projections.
Before dealing with the problem, let’s put our cards on the table: you may be partly or fully responsible for the problem. So there will be two chapters in this article: the first one for those who are not used to coordinate systems, the second one for those who have already done the checks in the first chapter by themselves and who can therefore go directly to the second one.
Don’t forget that the solutions suggested here will never solve 100% of the problems…
You are a beginner in coordinate systems
The problem can occur on two occasions:
- You have created a new data layer with QGis spatial processing and the result does not overlap with other data.
- You try to load new data and it does not overlap with the other data in the project at all.
The layer is the result of a processing tool
In this case, your concern is the processing program that did not, or could not, assign the CSR of your project at its output.
To find out the CSR of the project, go to the menu Project -> Properties, and to the tab CSR
The bottom panel shows you the name and parameters of the CSR for your project, but remember the code that appears at the end of the line in the list of recently used systems, in this example EPSG:2154.
To tell QGis that your layer uses this same system, right-click on the layer -> Layer CSR
The first line, No SCR, corresponds to the description state of the SCR known by QGis. To assign the SCR of the project, select the line corresponding to the SCR in the previous window.
If on the other hand the first line is not No SCR as here:
This means that your layer has been assigned the wrong CSR by the processing program. This can happen when your project and the layers it contains are not in the same coordinate system. QGis knows how to handle this, but the processing has various origins and can be buggy.
Look at the CSR of the input layer. If it is not the same as the one of the project, the solution is usually to change the CSR of the problematic layer by the other one.
The layer comes from external data that you do not know.
Check the metadata and accompanying files. In most cases, the files are in shapefile format. A shapefile consists of several mandatory and optional files, namely
- .shp: the main file containing the geometric data. (mandatory)
- .shx: The index file for quick access to geometric data. (mandatory)
- .dbf: The dBASE table containing the attribute data (required)
- .prj: The projection file containing the coordinate system information (if available)
In general, the problem of defining the SCR comes from the absence of the .prj file. If this file is missing or empty, you will have to identify the coordinate system yourself. If the file is present and filled, you can open it with a text editor to display the description of the coordinate system.
Here is an example of a completed .prj file:
If it is missing or empty, you will have to define it in the layer properties. But to do that you will need to find out what the system is: look for optional files, such as . txt or . xml, that might contain metadata or additional information about the data; sometimes shapefiles are accompanied by documentation files, such as a README.txt or a PDF report, that provide information.
If you cannot find the information you need in the metadata or related files, consider contacting the data provider or source. They may be able to provide the necessary information about the coordinate system.
If you find the answer, you will need to tell QGis which CSR to use. Click on the layer, Layer CSR menu ->Layer CSR:
This opens the CSR definition window.
Using the filter field, enter parts of the name of the searched CSR. You will get the list of SCRs containing this part in the Predefined Reference Coordinate Systems list.
If you have not solved your problem by now, you will have to take courage and go to the next chapter.
You know that the CSR of the data is unknown and you are looking to find out.
In 2015 I had posted a document “Determining the unknown projection of a layer for QGis 2.X”, in French, which is still available by clicking here. It is only valid for the current projections of Metropolitan France and is based on the analysis of the XY values of the unknown data. Fortunately QGis and its developers have come a long way since then, as QGis 3.x offers you a tool to find an unknown system, in the processing toolbox -> General tools for vectors -> Find a projection.
The projection search tool in QGIS is designed to create a short list of candidate coordinate reference systems (CRS) for a layer with an unknown projection, based on a specified target area using another reference layer, with a well defined CRS.
For example, if you know or think that your data is somewhere around Arcachon, you load a data layer including the Landes :
- Administrative boundaries (e.g., country, region, department)
- Road networks
- Satellite imagery or aerial photography (e.g., Google Maps, OpenStreetMap)
In this example we have a nbm layer with an unknown CSR, but we know that it is related to the Arcachon Basin.
The Find Projection tool will take the nbm data and iterate through all the known CSRs: For each CSR, it will assign it to the unknown layer, and check if the data thus filled in is inside or near the target area defined by the reference layer. If so, the processing adds the CSR to the list of potential candidates. The processing continues to traverse all CSRs until the complete list of candidates has been created.
The algorithm thus generates a short list of candidate CSRs that, if used for the unknown layer, would place it near the target area. It is up to you to manually test each candidate CSR using QGis, defining the CSR for the layer and comparing it to the reference layer with a known CSR, based on alignment and compatibility with the reference layer.
Note that the algorithm may produce multiple candidates or no candidates, depending on the accuracy of the target area input and the extent of the layer. The larger the extent of the reference layer, the more candidate SCRs there will be. It is also possible that the correct CSR is not among the shortlisted candidates, so it is crucial to verify the results and combine this approach with other methods to ensure a complete evaluation.
To continue our example, we open the Find Projection tool:
You can define the Target Area for the layer by clicking on the icon to the right of the field. In this case the area will be the one displayed on the QGis map window. You can also open the drop-down list that proposes other definition methods. Click on Run and wait because QGis will project your unknown layer into each of the CSRs it knows.
When finished, it will display the short list in the log tab, and it will have added a table in the layers panel with one record per candidate CSR.
To complicate your task, and QGis is not responsible for this, the same coordinate system will have different codes depending on the reference organization. These are the 4 letters at the beginning of each code. EPSG stands for European Petroleum Survey Group, the first organization to standardize coordinate systems worldwide, IGNF stands for IGN France, and ESRI for ESRI of course. For the same system each one has a different code.
If you look at the definitions of all the CSR in this example:
They all correspond to the same Lambert 3 zone projection system, used until the 2000s for the South of France. Whatever the CSR used, the result will be the same:
But it is not always that simple. If you have unprojected data, in geographic coordinates Latitude-Longitude you will have the problem of the choice of DATUM, in less complicated terms, of the choice of the center of the earth of reference. The same Lat/Long coordinates, depending on the DATUM used, can be found in positions 350 meters apart…
In short, if after following all the previous steps you have not succeeded in solving your problem, you have the option to contact me through the contact form. Try to describe your problem as well as possible, it will save us time 😉
Thank you for this