When attempting to use an existing table in a PostGIS database, the PostGIS writer is coercing my 3D geometry objects into 2D. I have not seen this issue with a PostGIS writer that uses automatic table creation and the data type for the geom column is defined as GEOMETRY in both cases.
I have seen 2 different warnings regarding this:
- POSTGIS Writer: PostGIS existing table has a 2D constraint, changing input data into 2D data
- coerced to 2D in table 'cad.cad_geom'
- Why are the objects being coerced?
- Are there writer settings to prevent this from happening?
Here is the table definition:
CREATE TABLE IF NOT EXISTS cad.cad_geom
( id BIGSERIAL PRIMARY KEY
, created TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
, updated TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
, xchg_ts TIMESTAMPTZ DEFAULT NULL
, _refid BIGINT DEFAULT NULL
, autocad_block_name TEXT
, autocad_block_number INTEGER
, autocad_entity_handle TEXT
, autocad_entity TEXT
, autocad_source_filename TEXT
, geom GEOMETRY NOT NULL
);
Furthermore, is there a way to have the writer respect default values when inserting into the table? For example, all timestamp values that are defaulted in the table definition are being written as NULL upon insert.
Thank you in advance!