4

Data is reloaded when I reopen the QGIS, however all of the visualizations disappear when I reopen the QGIS. I add the dataset as follows: enter image description here

Visualization looks as follows:

enter image description here

When I reopen the QGIS, it looks like this:

enter image description here

Data is there, here is the attribute table:

enter image description here

I am very new at QGIS and not sure why exactly this occurs and wanted to give as much as clues I can. In the past, when I reopen the QGIS the visualization was done automatically, I wouldn't have to do it all again. But like this, it causes so much waste of time.

0

2 Answers 2

4

The problem

Field delimiters are not correctly recognized, see your last screenshot: all attributes are in one single field. Semicolons should work as delimiters, but are not recognized as such.

The solution

In the import dialog, instead of Regular expression delimiter check the box next to Custom delimiters and select the semicolon ;

Context

As you can see on the 3rd screenshot, the CSV is loaded without geometry, so there is just attribute data. Your 2nd screeshot shows the symbolization icons, whereas in screenshot no 3, there is just the list icon (data only layer).

Check Data Source

If you open the project, in the Layer Properties > General Tab you can see the data's source. See below how it looks in my case and check how it looks in your case - especially the delimiter=; part as well as xField and yField parts. The first part (C:/Users/[username/folder]/temp/) is just the local drive where I stored the data and probably looks different in your case:

soucrce:

file:///C:/Users/[username/folder]/temp/demand_1.csv?type=csv&delimiter=;&quote=&escape=&maxFields=10000&detectTypes=yes&xField=DemandLat&yField=DemandLong&crs=EPSG:4326&spatialIndex=no&subsetIndex=no&watchFile=no

Provider delimitedtext

enter image description here

6
  • Thank you so much for your answer, but unfortunately it did not work out. I have the same issue still.
    – madetolast
    Commented Nov 25, 2022 at 9:31
  • Can you share project+ data files?
    – Babel
    Commented Nov 25, 2022 at 9:49
  • You can find all the relevant files here: easyupload.io/6r49v0
    – madetolast
    Commented Nov 25, 2022 at 10:41
  • Sorry, I can't reproduce this behaviour. I can open the project without problem, it looks like this: i.sstatic.net/QzUSr.png Please add more information about what exactly you're doing, how you open the project, which QGIS version etc.
    – Babel
    Commented Nov 25, 2022 at 14:55
  • I make experiments and have many datasets like the one I uploaded. I have many folders includes datasets and project files. What I do is, I visualize each experiment by updating the dataset and opening the qgis project file. In the past, no matter which experiment folder, as all the data in all folders have the same name, I used to open qgis project file and the qgis would automatically recreate the visualization I have done for previous experiments using the new updated data. But somehow I have lost that. To open the project I directly double click on the project file. QGIS Desktop v.3.22.10
    – madetolast
    Commented Nov 25, 2022 at 15:07
2

Short answer

Avoid special characters for folder and file names. Use only letters, numbers and underscores, then the problem is solved.

Details

I could now finally reproduce the behaviour you describe. The problem is the path you use for the csv file: it contains special characters. Your first screenshot shows the path where you saved the csv. This path contains different special characters like points (.), spaces ( ), commas (,), hash sign (#), hyphens (-) apostrophe ('), equal sign (=) etc. This should be avoided.

Using such characters might work in many settings. However, it might suddenly produce unexpected errors, as in your case. So as a general rule (not just for QGIS), always limit names for folders and files to characters a to z and A to Z, numbers 0 to 9 and underscores (_) and avoid all other characters.

Depending on context (operating system, file system, filetype, application used etc.), rules for allowed/forbidden characters vary - see e.g. naming conventions for web files. In some contexts, filenames are not case sensitive, so you might even consider using only lowercase (or only uppercase) characters or only hyphens instead of underscores. For maximum interoperability, keep file- and foldernames as simple as possible and as complex as necessary. See also entry for Filename on Wikipedia.

Checking data source in Layer Properties > Information reveals the problem: path includes special characters like hash sign, spaces and hyphens, all data are inserted in one field and thus the fields that define the geometry cannot be recognized: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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