lutraconsulting / MDAL

Mesh Data Abstraction Library
http://www.mdal.xyz/
MIT License
160 stars 50 forks source link

Problem opening mesh layer in QGIS as user #72

Closed saberraz closed 5 years ago

saberraz commented 5 years ago

Trying to open a mesh layer as user fails in QGIS with the following error: unnamed But when you run QGIS as admin, the same layer can be loaded. Note, this happened for a 2dm file.

saberraz commented 5 years ago

https://twitter.com/AndrewWaltersKS/status/1082747646576451584?s=20

PeterPetrik commented 5 years ago

workaround is to run QGIS as admin user.

saberraz commented 5 years ago

This is not a really workaround for most of users in an enterprise environment. Beside, it might mess up QGIS user's profile.

PeterPetrik commented 5 years ago

it is when creating spatial index for QGIS mesh triangular mesh, somehow this is called https://github.com/libspatialindex/libspatialindex/blob/c303dd6c99e23c2d59d21c1c1357002bfc925308/src/tools/Tools.cc#L995 and it creates the temporary spatial index in the temp files

saberraz commented 5 years ago

The issue is due to spatialindex library is trying to write the index to the disk for large files. For smaller files, it works as the index is done in memory. But for larger files, it will write the index files under the Current Directory. So, if user does not have write access, it will give the error.

saberraz commented 5 years ago

@PeterPetrik isn't it a better to have an option under Properties for users to create the spatial index as a file, similar to Vectors. So:

PeterPetrik commented 5 years ago

WORKAROUND: ok, so to run QGIS as user, one needs to start it from a working directory with the write rights. For example when QGIS is started by shortcut or batch file from some system/unwritable folder the error when loading the mesh can occur

saberraz commented 5 years ago

To expand on @PeterPetrik workaround: 1- Create a shortcut to QGIS.bat on your desktop 2- Write click on the shortcut and open the Properties 3- Set the working directory to a folder you have permission to write to

AGBNE commented 5 years ago

The workaround was applied (as were all other suggestions) as per the above comments. The loading of xmdf (>2GB) still returns a "Bad Allocation". QGIS 3.4.4-Madeira.

saberraz commented 5 years ago

@AGBNE there has been major changes for spatial indexing in QGIS 3.5. Could you try with QGIS weekly/nightly builds?

AGBNE commented 5 years ago

You little ripper ! my XMDF can load without error. Thanks @saberraz Loaded "29 Jan nightly build", altered the "Start In" directory in the desktop short cut.

mademyfriday

saberraz commented 5 years ago

With the latest improvements, our tests show 70-80% improvement in loading 2dm files.

Neeestoor commented 5 years ago

I have the same problem with QGIS 3.6.2 in OSX Can you please help? image After the error QGIS stop rendering any layer.

PeterPetrik commented 5 years ago

@Neeestoor can you please specify:

Neeestoor commented 5 years ago

@PeterPetrik I start QGIS by clicking the dock icon. I tried to do the shortcut thing, but I get the same error. MDAL... I suppose is the Crayfish version? At least I did the mesh as shown in this tutorial (https://www.youtube.com/watch?v=qN_UC0AZhVM) (Just... to load the is through layer menu... QGIS browser doesn't show the file) Is spatial index the crs? WGS 84 UTM 12N.

Captura de Pantalla 2019-05-15 a la(s) 10 24 41 Captura de Pantalla 2019-05-15 a la(s) 10 25 21 Captura de Pantalla 2019-05-15 a la(s) 10 37 57
PeterPetrik commented 5 years ago

do you use official mac package or https://lutraconsulting.github.io/qgis-mac-packager/ ?

Neeestoor commented 5 years ago

I downloaded QGIS from the QGIS's website. ( https://qgis.org/es/site/forusers/download.html) and Python from Python's website.

El mié., 15 may. 2019 a las 12:24, Peter Petrik (notifications@github.com) escribió:

do you use official mac package or https://lutraconsulting.github.io/qgis-mac-packager/ ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lutraconsulting/MDAL/issues/72?email_source=notifications&email_token=AMCKX3ACC6PS4LJLAJQZLZTPVRBNJA5CNFSM4GOX6VD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVPLO2Q#issuecomment-492746602, or mute the thread https://github.com/notifications/unsubscribe-auth/AMCKX3ENIVJ4I7DHIS7BXVLPVRBNJANCNFSM4GOX6VDQ .

saberraz commented 5 years ago

See: https://trac.osgeo.org/osgeo4w/ticket/603#ticket

saberraz commented 5 years ago

Fixed in: https://github.com/qgis/QGIS/commit/a4645f695479b215abbe97acfa34f7adc506fd2c and https://github.com/qgis/QGIS/commit/3c57d28cfabf615f29af51a332db5ef51bd191f0 thanks to @jef-n