[EN]Importing a CSV file into QGIS: A simple guide to avoiding errors

To import a CSV in QGIS, use “Add Delimited Text Layer”, select the file, and define X/Y coordinates.

Importing a CSV file into QGIS is a very common task when working with geographic data. Coordinates can come from a spreadsheet, a GPS device, a field survey, or even an export from a database.

In most cases, it only takes a few clicks to import a CSV into QGIS and create a point layer from the coordinates. However, certain errors are common: incorrect delimiter, character encoding issues, misinterpreted coordinates, or reversed latitude/longitude order.

In this article, we’ll look at how to correctly import a CSV file into QGIS and how to avoid the most common problems.

This method works in recent versions of QGIS 3 and QGIS 4.



1.Prepare the CSV file

Before importing into QGIS, it is important to check the file structure.

Example of a CSV table:

idnamelatitudelongitude
1Site A-20.348457.5522
2Site B-20.220157.4635

Important points:

  • The first row must contain the field names
  • The coordinates must be in two separate columns
  • The values must be numeric

2. Check the file separator

CSV files typically use:

  • a comma (,) in English-speaking countries
  • a semicolon (;) in many European countries

If the separator is incorrect, QGIS may read the entire line as a single field.

In this case, open the file in a text editor to check the separator being used.

Coordinates must use a period (.) as the decimal separator.

If your spreadsheet uses a comma, the coordinates may be interpreted as text.


3. Check the character encoding

To avoid issues with accents or special characters, it is recommended that you save the CSV file in UTF-8.

In most spreadsheet programs (LibreOffice, Excel), you can select UTF-8 when exporting the file.


4. Import the CSV into QGIS

In QGIS:

  1. Layer Menu
  2. Add Layer
  3. Add Delimited Text Layer

Next, select your CSV file.

In the import window:

  • Select the correct delimiter
  • Geometry type: point
  • Select the longitude (X) and latitude (Y) fields
  • Select the coordinate system (usually WGS84 – EPSG:4326)

Then click Add.

QGIS then creates a point layer based on the coordinates.


5. Check the results

Once the layer is loaded:

  • check that the points appear in the correct locations
  • check the attribute table
  • make sure the coordinates are interpreted correctly.

If the points appear in an unexpected location (for example, off the coast of Africa), this is often due to a projection or coordinate system issue.


FAQ

The CSV file imports, but no points appear

Make sure the latitude and longitude columns contain numbers, not text.

All fields appear in a single column

The file separator is likely not being detected correctly.

Points appear in the wrong location

Check:

  • the coordinate order (latitude / longitude)
  • the selected coordinate system.

Points appear on the equator or off the coast of Africa

This often means that:

  • latitude and longitude are reversed
  • or that the coordinates are interpreted as text.

Conclusion

Importing a CSV file into QGIS is a simple process, but it requires checking a few essential elements: delimiter, encoding, and coordinates.

Once these elements have been verified, it becomes very easy to transform a data table into a usable geographic layer in QGIS.

In a future article, we will see how to append a CSV file to an existing layer in QGIS.


Si cet article vous a intéressé et que vous pensez qu'il pourrait bénéficier à d'autres personnes, n'hésitez pas à le partager sur vos réseaux sociaux en utilisant les boutons ci-dessous. Votre partage est apprécié !

Leave a Reply

Your email address will not be published. Required fields are marked *