
How to Add Latitude/Longitude Data to QGIS
What you'll learn
- How to create point data from coordinates such as latitude and longitude
- How to export the imported data as a Shapefile
- How to fix garbled CSV text and what to do when points do not line up with the base map
Recommended for
- Anyone who wants to display tabular data with latitude and longitude values, such as Excel or CSV files, on a QGIS map
- Anyone whose CSV data appears garbled
- Anyone whose CSV data does not appear in the right place
Introduction
When you work with GIS data, you sometimes have a table that includes coordinates such as latitude and longitude, and you want to create point data at those coordinates. In QGIS, you can easily generate point data from coordinate values. This article shows how to create point data from coordinates such as latitude and longitude and export it as a Shapefile. How to import CSV data that contains latitude and longitude
Prepare the CSV data
To create point data from coordinates, you first need to organize the coordinates as CSV data. This article uses the CSV data “List of Childcare Facilities in Osaka Prefecture,” which you can download from the Osaka Prefecture Open Data Catalog Site.
In Excel, the downloaded CSV data has latitude values in column B and longitude values in column C.

Prepare CSV data that has separate columns for coordinates such as latitude and longitude, like this data. If your data is an Excel file with an extension such as .xlsx, convert it to a CSV file first. To do so, choose Save As in Excel and set the file format to CSV UTF-8 (Comma delimited) (.csv).

Import a CSV file into QGIS
Start QGIS and, from the menu bar, choose Layer → Add Layer → Add Delimited Text Layer.

The Data Source Manager opens with the Delimited Text tab selected. It has many settings, but start by clicking the ... button next to File name to select the CSV file to import.

The Choose a Delimited Text File to Open dialog opens. Select the CSV file to import and click Open.

The Sample Data area now shows a preview of the CSV file you selected.

If the sample data looks right, confirm that Point coordinates is selected under Geometry Definition. Then select the 経度 (longitude) column for X field and the 緯度 (latitude) column for Y field.

Next, use Geometry CRS to select the coordinate reference system (CRS) of this data. Click the globe button to open the dialog for selecting a CRS. Enter 4326 in Filter, select WGS 84 (EPSG:4326) under Predefined Coordinate Reference Systems, and click OK.

When the settings are done, click Add.

The point data now appears in the map canvas.

Check the imported data
Once the CSV data appears correctly in QGIS, check that it was added properly.
First, add a base map and check that the points appear in the right place. Here, add GSI Maps, from the Geospatial Information Authority of Japan (GSI). In the Browser panel, double-click GSI Maps under XYZ Tiles.

In the map canvas, the points appear in the Osaka area, which confirms that QGIS imported the CSV data correctly.

Check the attribute table too. Right-click the layer and choose Open Attribute Table.

The attribute table also displays the data correctly.

Export the CSV data as a Shapefile
For simple visualization or light processing, the CSV data you added to QGIS works fine as it is. For spatial analysis or large amounts of data, however, a vector format such as Shapefile is more efficient, so it is important to export the imported CSV data to a vector format.
This section shows how to export to a Shapefile. First, right-click the layer and choose Export → Save Features As.

The Save Vector Layer as dialog opens. Use it to configure the file to export.
First, use the Format field to specify the file format of the output vector data. Select ESRI Shapefile from the drop-down list.
Next, click the ... button next to File name and specify where to save the file and what to name it. When all settings are done, click OK.

QGIS exports the data as a Shapefile to the location you specified and adds it to QGIS under the name you just entered.

Common problems when adding CSV data
What to do when the CSV text is garbled
When you add CSV data, the Sample Data area sometimes shows garbled text.

The cause is the encoding setting. Japanese CSV files are generally created in “Shift_JIS” or “UTF-8,” but QGIS may default to a different encoding, which garbles the text.
If the CSV data is garbled, try switching the Encoding field between “Shift_JIS” and “UTF-8”. This should fix the garbled text.

Note that if you notice garbled text after adding the CSV data to QGIS, you cannot change the Data source encoding in the layer properties, unlike with vector files such as Shapefiles. Add the CSV data again from the Data Source Manager.

Points appear in the wrong place on the map
Even after you add CSV data to QGIS and overlay it on a base map, the points sometimes do not appear where they should.

When you import CSV data, the CRS setting is especially important.
For latitude and longitude data published in Japan, the usual choice is “EPSG:4326 (WGS 84)” or “EPSG:6668 (JGD2011).” If the data uses a different CRS, you must set that CRS correctly. With an incorrect CRS, the points may not appear at the right place on the map, as shown above, so it is important to check the CRS of the data before you import it.

A similar problem occurs when the points appear flipped, as in the figure below, and do not display correctly. This happens when the columns are swapped in the import settings, for example when X field is set to the 緯度 (latitude) column and Y field to the 経度 (longitude) column.

When the points do not appear correctly on the map like this, check the CRS and the other settings, and import the CSV data again.
Conclusion
This article showed how to import CSV data that contains latitude and longitude into QGIS and export it as a Shapefile. Misplaced points and garbled CSV text are easy to run into, so it is important to stay calm and check the CRS and encoding settings.


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.


