1

I've got an issue importing CSV files to QGIS 3.12 Bucuresti and/or 3.4 Madeira.

Months ago I created a point distribution map for several species with several CSV files containing geographical data. I created the CSV files using Excel. The coordinates were determined with Google Earth or taken from literature or other sources. I made sure all coordinates had the same format. It worked all fine.

Now I wanted to work on those maps again, using the same data. When opening QGIS (it doesn't matter which of the two versions) it appeared a window, that some layers were not available. I simply imported them again using the Data source manager, which solved the problem for all but one layer. Below a picture of the Data source manager for the not working file. The respective CSV file could only be imported as an attributes table. Hence the coordinates given in that file were not shown on the map. Some time later the same thing happened to a second layer, which worked fine just two days before.

Data Source manager import options for the not working file

I tried several things aside from checking the coordinates format. I copied the respective coordinates manually into a new file and imported it. It still was only an attributes table. I copied the respective coordinates into a working file and imported it to QGIS. Now the whole, formerly working file was imported as an attributes table, not assigning the coordinates to the map. I had a look on the CSV file itself and compared it to working CSV files. I couldn't spot a difference. I looked in several forums, but couldn't find a solution for this problem.

My understanding of QGIS has come to an end. What can I do to make this work?

Here an excerpt of the not working csv file ([...] indicate elisions):

ID;Justification;Country;Province;Locality;Year;y;x;Literature
1;locality approximated;Argentinia;Chaco;Valle del Parana;2002;31°S;60°5' W;"Arzamendia, Vanesa; Giraudo, Alejandro Raúl [...] sequence=1."
2;giant area;Brazil;Rio Grande do Sul;Central Depression;;29°80' S;51°50' W;"Aguiar, [...]5774806205."
  • 6
    Hard to help without a peek at your data, or a detailed description (maybe with screenshots) of how you are loading them, because there's a few ways to do this. If you could show a few lines of your datafiles or put them somewhere public we'd be better placed to help you. – Spacedman Apr 21 at 11:37
  • 3
    If you can't share your data then just write a few lines of csv that has exactly the same structure than your real data. – user30184 Apr 21 at 11:40
  • Thanks for your comments, you're entirely right. I hope I added all necessary information now. – Yannis Apr 24 at 8:38
  • 1
    There are a couple of problems: 1. The first entry in your sample does not contain information on the minutes. Change 31°S to 31°0'S. 2. The second entry has an invalid value for the minutes (they can only be between 0 and 59). Change 29°80' S to 29°48' S. 3. You need to select the "DMS coordinates" checkbox. – Jake Apr 24 at 9:17
  • Use space instead of quote (") it is also used for seconds. I changed your angles space separated D MM SS e.g. 31°S 7 => 31 00 00 S and 60°5' W => 60 05 00 W, this format was accepted by QGIS 3.12 after checking DMS coordinates. – Zoltan Apr 24 at 11:15
0

Some things I feel will help make working with csv files easier (not absolutely necessary,though):

  1. Open the files in Excel to see and delete the empty rows and columns which might have inadvertently crept into the data, which might through a 'Badly formatted row' error.
  2. Its better to use negative latitude and longitude values for South and West.
  3. Give 'latitude' and 'longitude' as column names instead of 'y' and 'x'.
| improve this answer | |
  • Hi Indranil, welcome to the site! Would you mind adding some more detail regarding your points 2. and 3.? QGIS can handle S/s/W/w for negative coordinates, both at the start and at the end of the coordinate specification, so changing the format shouldn't be necessary. Also, why is latitude and longitude better than y and x? – Jake Apr 24 at 11:30
  • Hi Jake, you are correct for both the things. Qgis can handle S and W and the lat/long is also for Qgis to automatically fill the x/y fields because many a times it fails to do so. As I wrote in the beginning,. its not absolutely necessary, its just how I like to keep it. – Indranil Apr 25 at 10:37
  • 1
    @Indranil shouldn't you use 'latitude' and 'longitude' for geographic coordinate and X, Y for projected one ? – J.R Apr 27 at 10:32
0

For future users with a similar problem I want to post the solution for my problem.

The reason for QGIS not to import my coordinates was that I forgot to check the DMS coordinates box.

Thanks to all who helped with this pretty simple issue.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.