0

I have been trying to snap points from a shapefile to a line feature from another shapefile. However, each time I do this, I get the following error(s) (depending upon the OS used):

(For OSX El Capitan):

File"/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins/processing/algs/saga/SagaAlgorithm.py", line 341, in processAlgorithm with open(prjFile, 'w') as f: PermissionError: [Errno 13] Permission denied: '.prj'

The above error being common to Mac and Windows as well. Sometimes while running the tool on windows environment is able to pass the permission error stage (somehow and its pretty weird, only sometimes) and generates only '.prj' file but fails stating:

'not able to generate shapefile'

I have tried it on QGIS Versions: 2.18, 3.2, 3.4.3 and 3.4.4.

All the supporting packages (GDAL) and respective python versions have been properly installed (3.6.7 for QGIS 3.0+).

My system specs are as follows:

System: Macbook Pro Mid 2012 i5 El Capitan + Windows 10 Pro (Bootcamp)

How can I fix this error?

  • 1
    Where are you trying to save the output snapped point file? Are you sure you have write permission to the path? – Keagan Allan Jan 22 at 23:55
  • The path is a regular folder on both Mac as well as Windows. I happen to be the sole user of my system with all administrative rights. For both systems, the path happens to be a folder on desktop. – Sumit Shokeen Jan 24 at 1:41
0

UPDATE:

I was doing some testing. And beyond some problem with the installation, as I supposed at the beginning (based on own and distant experiences), I can reproduce your problem now, if the point layer does not have the same CRS as the layer of lines.

Therefore, reproject both layers to the same CRS.


Previous answer (edited):

I have tried it on QGIS Versions: 2.18, 3.2, 3.4.3 and 3.4.4.

That's not good. When you install QGIS from stand-alone installer, it changes some paths of environment variables. To install a version, you need to do a complete uninstall of the previous version, that means removing registry entries and the C:\Users\YourUser\AppData\Roamming and Local\QGIS (version) folders.

If you install from OSGeo4W network installer you will have only two versions of QGIS, one is from the qgis package (current version 3.4.4), and other from the qgis-ltr package (current version 2.18.28). Both versions can run fine on the same machine. (Also, you can run QGIS 3.5 installin the qgis-dev packages.)

Even when many QGIS tools could work well in multiple stand-alone installs, SAGA tools are especially susceptible to errors of this type.

A possible workaround that can save you that issue at this moment, is to choose a file to save the output of the tool (directly from the GUI), instead of creating a temporary file and try to load it in qgis from there. Even reading files from the disk instead of project layers could solve it. (Try both)

Regarding the problem in Mac machines, I don't know. But I suspect that may be something similar.

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.