How to write from pandas Dataframe to PostgreSQL with a geometry type

Registered Posts: 4 ✭✭✭✭
edited July 2024 in Using Dataiku

Hello,

In my python receipt, I would like to write in my PostreSQL database (with PostGis extension) data with a geometry type. Therefore, I declared a schema and created my table with this specific schema


schema = [{"name": 'id', "type": 'int'}, {"name": 'value', "type": 'string'}, {"name": 'the_geom', "type": 'geometry'}]

test_schema = dataiku.Dataset("test_schema")
test_schema.write_schema(schema, dropAndCreate=True)

with test_schema.get_writer() as writer:
writer.write_dataframe(df_test)

However there's no way "Dataiku" recognizes any geometry type I tried. Is it possible to have the list of types that Dataiku can handle?

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.