02-04-2020 05:07 AM
I have a question about the geometry type. Does anyone know how I can create the geometry type in the Postgis database without a Z dimension? When I create a new table that does not contain any data, it is displayed as geometry and not as a polygon as I defined it.
CREATE TABLE public.verpachtung
gemarkungflur character varying(40) COLLATE pg_catalog."default",
flskz character varying(255) COLLATE pg_catalog."default",
paechter character varying(255) COLLATE pg_catalog."default",
groesse_pacht double precision,
pacht_ab timestamp without time zone,
lage character varying(255) COLLATE pg_catalog."default",
namen character varying(255) COLLATE pg_catalog."default",
f10 character varying(255) COLLATE pg_catalog."default",
id1 character varying(36) COLLATE pg_catalog."default" NOT NULL,
dateiname character varying(100) COLLATE pg_catalog."default",
dateityp character varying(100) COLLATE pg_catalog."default",
CONSTRAINT verpachtung_pkey PRIMARY KEY (id1)
OIDS = FALSE
ALTER TABLE public.verpachtung
OWNER to bb;
An error then occurs in the desktop app when creating a new object. Log file is attached.
02-04-2020 06:37 AM
I believe instead you need to consider the database type goemetry to be 'GeometryZ'.
The error is coming from the Postgres dataserver.
For me in my Postgis data I only have 'GeometryZ' and with that I have no issues between the workflow insertion of features and the backend database.
The error is a common Postgis error and of course means there a mismatch between insert feature and geometry column 2D vs 3D. Resolving it on the database is the key and you may find searching the Postgis documentation useful in that regard.
02-10-2020 05:26 AM
thank you for your tip. If I add this to my table it works:
ALTER TABLE public.verpachtung ALTER COLUMN geometrie SET DATA TYPE geometry(POLYGONZ,25832) USING ST_Force_3D(geometrie);
Now I can create an object, but then I cannot edit the geometry of that object. So I get another error message: 'An object has to implement IConvertible'. Log file is attached.
Do you know what that could be?
02-10-2020 10:55 AM
I am not familiar with that new error message and I dont see past reports of the same error.
I wonder if someone else may chime in on this.
Perhaps it would be helpful to monitor the PostGIS database and capture the statements being issued there during the edit.
It suggests a cast is being attempted and I believe it is likely to do with the Geometry type, but I'm not certain given this log file.