Missing points when I import from CSV to QGIS

csvimportqgis

I am trying to import a file from CSV to QGIS (version 3.20.1). However, when I import the data, some values (points) are missing.

I know that this question have been already asked but I have tried the solutions in before posts and it does not work for me. For example, I have unchecking "Detect field types" or eliminating variables that I do not need.

I attach a screenshot of the CSV file that I have it. Any idea about how to solve that issue?

enter image description here

Update: I know it's so few and probably it's not useful but I have found two observations that appears in my original CSV file and when I import to QGIS dissapears. I attach the screenshot. I put four images, the first two correspond to the first observation, the lattest two, to the second one. I am not able to see what can be wrong with that two observations.

enter image description here

enter image description here

enter image description here

enter image description here

Best Answer

Quick solution

When loading the CSV, use Custom delimiters, select Semicolon and be sure to have all others empty. When loading the CSV you provided in your comment, I get 187532 points loaded - that seem to be all.

enter image description here

Identify problematic entries

To find the problematic entries, import the CSV as NO geometry (attribute only table). Check if lat/lon values are correct: in the Layer properties / Source tab / Query builder and filter invalid values for lat/lon using this query (see screenshot below):

latitude is NULL or 
longitude is NULL or 
(not (latitude >= -90 and latitude <=90))  or 
(not (longitude>= -180 and longitude<=180))

Click Test to check if there are any features returned: if so, these are the problematic features. Apply the filter and open the attribute table: it should now contain only the filteres features with values outsite the range of -90/90 for lat and -180/180 for lon. You could also directly use the same expression with Select by expression to directly select these entries (however, in a large dataset, the attribute table will take a while to load).

By the way: you could search in your latitude and longitude fields for any characters that are not numbers or points (commas, spaces etc.). As you have many decimal digits, you might round the values to get rid of potentially problematic characters: round (latitude, 5) - 5 digits should be precise enough. Even try to convert the lat/lon values to integers, creating a new field: to_int (latitude), then try creating points with these values to see if like that all points are created.

enter image description here

The problematic entries, here selected with select by expression: enter image description here

See how to import CSV without creating geometries: enter image description here

Edit

Inspecting the data you provided (the 389 features that produced an error), it becomes clear what went wrong: the latitude field contains names. It seems that the content of the fields was shifted one column to the right:

enter image description here