Fully managed cloud. 30-day FREE full featured trial. Start Now
cancel
Showing results for 
Search instead for 
Did you mean: 

Using Shapely to simplify geometry data

ugamarkj
Xpert

I'm attempting to simplify some geometry data I have in Exasol, but I'm running into an issue with importing the Shapely package. I have the package installed, but the wkt module depends on geos, which is a compiled C\C++ library. I'm not really sure how to approach getting this to work.

CREATE OR REPLACE PYTHON3 SCALAR SCRIPT DEV_MAJ."UDF_SimplifyGeometry"("Geometry" VARCHAR(2000000) UTF8) RETURNS VARCHAR(2000000) UTF8 AS
import sys
import glob
sys.path.extend(glob.glob('/buckets/bucketfs1/pythonbucket/Shapely-1.8.0/*'))
import shapely.wkt

def run(ctx):
s = shapely.wkt.loads(ctx.Geometry)
return(s)
/

ugamarkj_0-1642191493579.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

ugamarkj
Xpert
It does and I ended up sorting it out that way. There was a lot of trial and error along the way, so I'm hoping to respond back with a more detailed walkthrough of what I did.

View solution in original post

2 REPLIES 2

wunderdata
SQL-Fighter

Hi,

shouldn't adding the libs to the script-language-container account for all the dependencies?

https://docs.exasol.com/database_concepts/udf_scripts/adding_new_packages_script_languages.htm

https://github.com/exasol/script-languages-release

ugamarkj
Xpert
It does and I ended up sorting it out that way. There was a lot of trial and error along the way, so I'm hoping to respond back with a more detailed walkthrough of what I did.