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

Options
atimetobesmall
atimetobesmall Registered Posts: 4 ✭✭✭✭
edited July 16 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?

Answers

Setup Info
    Tags
      Help me…