-
-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can not load mod_spatialite extension #520
Comments
Probably the extension was compiled against a different architecture or a different version of SQLite3. |
Any updates on this issue? |
I concur on this issue. I've downloaded 3.35.2 (per instructions on compilation page). Built libspatialite 5.0.1 after building sqlite3. All I get is Segmentation fault (core dumped) when trying to load mod_spatialite. I've tried using the library name specifically, with/without the path to the .so and all produce the segmentation fault. I initially had the same issue with node-sqlite3 but after ensuring that libspatialite was built with the same sqlite3 build, I could load mod_spatialite.so (but only after putting a symlink into /usr/lib64). I figured this was the same reason why better-sqlite3 got the seg fault when loading the extension but the prior path to resolution with node-sqlite3 didn't work for better-sqlite3. |
I can actually load mod_spatialite (either from Ubuntu or compiled from the src).
Then it will get "Segmentation fault" when run 'SELECT InitSpatialMetaData(0)' or 'SELECT InitSpatialMetaData(1)'. It looks like a time out problem, because if I open the db file after the error, I can see the spatial tables initialised. |
@shenzhuxi I encountered the same problem and was able to fix it in #1137. |
Thanks! It seems working now. However with electron.js (28.2.7) it still crashes. after 'SELECT InitSpatialMetaData();' if using ':memory:' like https://github.com/WiseLibs/better-sqlite3/blob/master/.github/workflows/build.yml#L50. If real db file is used, it will crash after "AddGeometryColumn". I tried "node_modules/.bin/electron-rebuild -f -w better-sqlite3" and nothing happened. If I switch to electron 29, I can see the recompiling and error messages. So I suspect a prebuilt dist skipped the rebuilding with node 18 and electron 28. |
Hi guys,
I used loadExtension for add mod_spatialite exntesion. as you said, I add .dll file to my directory and after that i load this extension.
but sometimes it can not find this module and some other says it is 32bit file and can not load in 64bit.
actually I checked it with sqlite3.exe and mod_spatialite.dll in cmd and it works.
this is my code and './spatialite/mod_spatialite' is my path.
Is there any way to load this extension in nodeJS or this library can not do that?
The text was updated successfully, but these errors were encountered: