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

Options
atimetobesmall
atimetobesmall Registered Posts: 4 ✭✭✭✭

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'}]<BR /><BR />test_schema = dataiku.Dataset("test_schema")<BR />test_schema.write_schema(schema, dropAndCreate=True)<BR /><BR />with test_schema.get_writer() as writer:<BR /> 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…