juliepierson / qgis_line_similarity

0 stars 0 forks source link

OGR error: sqlite3_open(layer 1 densify.gpkg) #4

Open jan-bausch opened 1 year ago

jan-bausch commented 1 year ago

Hey! :)

I'm getting this error when trying to compare two layer:

QGIS version: 3.30.2-'s-Hertogenbosch
QGIS code revision: 0992b53397
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.3.2
GEOS version: 3.9.1-CAPI-1.14.2
PROJ version: Rel. 8.1.1, September 1st, 2021
PDAL version: 2.3.0 (git-version: Release)
Algorithm started at: 2023-09-05T11:52:06
Algorithm 'Line similarity' starting…
Input parameters:
{ 'ID_INPUT1' : 'fid', 'ID_INPUT2' : 'fid', 'INPUT1' : '/Users/jan.bausch/Documents/I-Route-Cargobike/QGIS/Berlin_compare_lenght/sp_data_od_anonym_export.gpkg|layername=sp_data_od_anonym_export_berlin', 'INPUT2' : '/Users/jan.bausch/Documents/I-Route-Cargobike/QGIS/Berlin_compare_lenght/sp_data_od_anonym_export.gpkg|layername=sp_data_od_anonym_export_berlin', 'INTERVAL' : 0, 'OUTPUT_FOLDER' : 'TEMPORARY_OUTPUT' }

Could not create layer layer 1 densify.gpkg: Creation of data source failed (OGR error: sqlite3_open(layer 1 densify.gpkg) failed: unable to open database file)
Execution failed after 0.03 seconds

Loading resulting layers
Algorithm 'Line similarity' finished

Do you maybe have an idea, what I can do to fix it?

Thanks a lot, Jan

juliepierson commented 1 year ago

Hi, thanks for your feedback, sorry for this error ;-)

Unfortunately I won't have much time to answer you before friday. But it looks like the plugin can't create the temporary layer "densify.gpkg". Perhaps this post can provide some answers ? Also the interval needs to be set to a value greater than zero (this being still experimental, there isn't any checking on the user input parameters).

If you send me a sample of your data I'll try it on friday !

jan-bausch commented 1 year ago

Thanks a lot for answering :-)

Increasing the interval and choosing different output folders sadly didn't solve the problem for me.

Here are the project files. I want to compare the layers sp_data_od_anonym_export and directions over the FID field.

jan-bausch commented 1 year ago

Could you take a look at the project files? Sorry to bother :D

juliepierson commented 1 year ago

Yes, sorry about the delay ! I just had time for a quick look, but I could get it to work by creating another id field based on the original fid field, for both layers, and then using that new id field in the line similarity tool. It seems that since the fid field is a special field in geopackages, using it causes an error, but I haven't had time to look into it deeper to understand exactly what is the problem and to fix it.

Could you try it and let me know if it works ? Thanks !

Another thing to watch is that your input layers are in different crs, but this doesn't seem to cause a problem.

juliepierson commented 1 year ago

Generally speaking, this tool is a bit buggy, I wrote it for a special use case and I haven't had much time to check it. Feel free to look into the code and make improvements if you feel like it :-)

jan-bausch commented 1 year ago
image

I still get the same issue, even when duplicating the fid field. Did you do something else? I created it using the Layer Properties -> Field Calculator

jan-bausch commented 1 year ago

Still couldn't get it to run :/ Could you take a look again?

juliepierson commented 1 year ago

Sorry, it works for me like this : image

Best practice is that both layers use the same CRS. If not, select a projected CRS for first layer so that the interval unit is meters and not degrees (see the warning sign next to the interval parameter in your previous screenshot).

Also, did you quit editing mode for both layers after adding new id field ?

You can also check that you have write access to the temp folder used by the processing toolbox (Settings menu > Options > Processing > General). But if this wasn't the case you probably would have had problems before using the processing toolbox.

Perhaps you already checked all this, but I can't think of anything else right now...

jan-bausch commented 1 year ago
image

Mhm, I still can't get it to work. 🤔

Here you can find my modified project files. Does it work for you with these files? Also, could you send me your modified files so I can test it locally as well?

Thanks again for all the help!

jan-bausch commented 1 year ago

I didn't change the projection though, but it worked for you anyways, didn't it?

juliepierson commented 1 year ago

Hi, the files are only available with a google account. Thanks !

jan-bausch commented 1 year ago

Oh, just fixed the link, thx

juliepierson commented 1 year ago

Hi, your files work ok for me. Did you try running just the "densify by interval" tool on your layers, in the processing toolbox ?

jan-bausch commented 1 year ago

Just tried, and they work without a problem for both layers 🤔

jan-bausch commented 1 year ago

I'm using QGIS 3.30.2 by the way

jan-bausch commented 1 year ago

The error is "Could not create layer layer 1 densify.gpkg: Creation of data source failed (OGR error: sqlite3_open(layer 1 densify.gpkg) failed: unable to open database file)"

Could it have something to do with the filename? Maybe the spaces are a problem?

jan-bausch commented 1 year ago

My best guess is that the error is caused somewhere here

jan-bausch commented 1 year ago

The "Points Along Geometry" algorithm has also been changed, according to here. So could also be a reason 🤔

juliepierson commented 1 year ago

Yes, good idea, did you try the points along geometry algorithm on both your layers ?

juliepierson commented 1 year ago

But I use QGIS 3.28 and it works ok for me ; the bug you mention seems related to older versions ?

jan-bausch commented 1 year ago

Yes, good idea, did you try the points along geometry algorithm on both your layers ?

Just did, and it works for both layers 🤔

But I use QGIS 3.28 and it works ok for me ; the bug you mention seems related to older versions ?

Ok, good that you are using a newer version too!

jan-bausch commented 1 year ago

Could you maybe send me the resulting csv. That would already help me to unblock another person 👌

juliepierson commented 1 year ago

Hi, sorry about the delay, here are the CSVs : layer1.csv layer2.csv similarity.csv

I used these parameters : image

Hope this helps, keep in mind this is experimental !