gvSIG bugs #1997
Error al editar capa de multipoligonos en PostGIS
Status: | Closed | % Done: | 0% | |
---|---|---|---|---|
Priority: | Normal | Spent time: | - | |
Assignee: | ||||
Category: | Database | |||
Target version: | 2.1.0-2217-devel | |||
Severity: | Add-on version: | |||
gvSIG version: | 2.0.0 | Add-on build: | ||
gvSIG build: | Add-on resolve version: | |||
Operative System: | Add-on resolve build: | |||
Keywords: | Proyecto: | |||
Has patch: | No | Hito: | ||
Add-on name: | Unknown |
Description
Al editar un campo alfanumérico de una capa postGIS definida como Multipolígono aparece la siguiente excepción:
Caused by: org.postgresql.util.PSQLException: ERROR: Geometry type (Polygon) does not match column type (MultiPolygon) at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
Parece ser que gvSIG actualiza todos los campos del registro modificado (incluida la geometría). El problema viene cuando en la sentencia UPDATE en vez de crear un WKB correspondiente a Mulipoligon crea una geometría de tipo Polígono y PostGIS lanza un error porque se viola una de las restricciones (no se puede añadir una geometría que no sea Multipolígono).
Además, si se carga la tabla desde el tipo de documento Tabla, sigue lanzando el mismo error a pesar de no seleccionar el campo geometría
History
#1
Updated by José Vicente Higón about 11 years ago
- File problema_editar_tabla.png added
- Description updated (diff)
#2
Updated by Juan Lucas Domínguez almost 11 years ago
- Assignee set to Juan Lucas Domínguez
#3
Updated by Juan Lucas Domínguez almost 11 years ago
- Status changed from New to Fixed
- Target version set to 2.1.0-2223-rc1
This problem does not happen in current workspace.
Probably solved with previous bugfixes, perhaps gvsig-desktop:r40722
It has been tested with this table:
CREATE TABLE gv_muni
(
"OBJECTID" integer NOT NULL DEFAULT 0,
gidd bigserial NOT NULL,
geometry geometry,
CONSTRAINT gv_muni_pkey PRIMARY KEY (gidd ),
CONSTRAINT enforce_dims_geometry CHECK (st_ndims(geometry) = 2),
CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(geometry) = 'MULTIPOLYGON'::text OR geometry IS NULL),
CONSTRAINT enforce_srid_geometry CHECK (st_srid(geometry) = 4326)
)
WITH (
OIDS=FALSE
);
ALTER TABLE gv_muni
OWNER TO osm;
#4
Updated by Joaquín del Cerro Murciano over 10 years ago
- Target version changed from 2.1.0-2223-rc1 to 2.1.0-2217-devel
#5
Updated by Álvaro Anguix over 10 years ago
- Status changed from Fixed to Closed