I am trying to use ST_Difference in OmniSci SQL editor to build a spatial object by taking the difference of two polygons. However, I am getting the following error: “Failed to load GEOS library: libgeos_c.so: cannot open shared object file: No such file or directory”. Please let me know how can I get around this!
If you look in our docs we don’t support natively overlay functions such ST_DIFFERENCE, and we support them thru libegeos.so library, so you need to install that library into the system to use such geometry functions.
to install on ubuntu, as an example, you have to run
sudo apt install libgeos++-dev libgeos-3.8.0 libgeos-c1v5 libgeos-dev libgeos-doc
With libegeos installed, everything should work.
If you are having difficulties installing that library or finding it, I can assist you, so feel free to ask.
Thanks for your reply!
I tried various methods provided over the web to download and install the library but none of them worked. It would be great if you can brief me about the process to download and install the library on ubuntu.
on Ubuntu 20.04, I used the command I wrote in the message. the command is the following and you would get this output
candido@zion-legion:/opt/mapd/omnisci-ee-5.9.0-20211118-75d225cb93-Linux-x86_64-render$ sudo apt install libgeos-3.8.0 libgeos-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
The following NEW packages will be installed:
libgeos-3.8.0 libgeos-c1v5 libgeos-dev
0 upgraded, 3 newly installed, 0 to remove and 15 not upgraded.
Need to get 697 kB of archives.
After this operation, 3.218 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://it.archive.ubuntu.com/ubuntu focal/universe amd64 libgeos-3.8.0 amd64 3.8.0-1build1 [535 kB]
Get:2 http://it.archive.ubuntu.com/ubuntu focal/universe amd64 libgeos-c1v5 amd64 3.8.0-1build1 [69,9 kB]
Get:3 http://it.archive.ubuntu.com/ubuntu focal/universe amd64 libgeos-dev amd64 3.8.0-1build1 [92,3 kB]
Fetched 697 kB in 0s (3.023 kB/s)
Selecting previously unselected package libgeos-3.8.0:amd64.
(Reading database ... 243560 files and directories currently installed.)
Preparing to unpack .../libgeos-3.8.0_3.8.0-1build1_amd64.deb ...
Unpacking libgeos-3.8.0:amd64 (3.8.0-1build1) ...
Selecting previously unselected package libgeos-c1v5:amd64.
Preparing to unpack .../libgeos-c1v5_3.8.0-1build1_amd64.deb ...
Unpacking libgeos-c1v5:amd64 (3.8.0-1build1) ...
Selecting previously unselected package libgeos-dev.
Preparing to unpack .../libgeos-dev_3.8.0-1build1_amd64.deb ...
Unpacking libgeos-dev (3.8.0-1build1) ...
Setting up libgeos-3.8.0:amd64 (3.8.0-1build1) ...
Setting up libgeos-c1v5:amd64 (3.8.0-1build1) ...
Setting up libgeos-dev (3.8.0-1build1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
If you are having trouble getting libraries from the ubuntu repository, you can download them at these links
you should copy the files into /usr/lib/x86_64-linux-gnu/
and do a softlink with this command
sudo ln -sf /usr/lib/x86_64-linux-gnu/libgeos_c.so.1.13.3 /usr/lib/x86_64-linux-gnu/libgeos_c.so
If you have trouble, please give me feedback, specifying the environment and the kind of installation (tarball, apt, or docker) you have to provide you with better directions.
Thanks for your reply and for sending out the links to library files!
I tried executing the commands after placing the files in the mentioned directory. Though I am able to run the soft link command without any error, I am getting some errors while installing the library files.
Request you to please let me know how to overcome this!
Some details regarding the environment I am using -
I am working on Ubuntu 18.04.6 and am using apt to install the library files
The error message I am getting -
Unable to locate package libgeos-3.8.1
Couldn’t find any package by glob ‘libgeos-3.8.1’
Couldn’t find any package by regex ‘libgeos-3.8.1’
Below is the error screenshot for your reference:-
Hi @abhi0208 ,
so installing directly the libraries I supplied isn’t working?
for Ubuntu 18.04 the libegeos available would be 3.6.2, so
sudo apt install libgeos-3.6.2 libgeos++-dev libgeos-c1v5 libgeos-dev libgeos-doc
Let me know if it’s worked