[Geoserver-devel] Versioned Postgis, "changesets" violates check constraint "enforce_geotype_bbox"

Hi,

just curious whether anyone has seen this before: I've created a table with "notes" and "comments" (see creation script below), when I try to add the datastore (with version enable all tables), I get the following:

2007-12-04 16:04:57 EST ERROR: new row for relation "changesets" violates check constraint "enforce_geotype_bbox"
2007-12-04 16:04:57 EST STATEMENT: UPDATE "public"."changesets" SET "bbox" = setSRID('000000000100000000000000000000000000000000'::geometry,4326) WHERE revision = 3

I don't quiet understand how it picks that bbox, how this information is used or whether it is caused by my point geometries below. The tables are defined as follows:

dropdb -U postgres notes
createdb -E UTF8 -U postgres notes
createlang -U postgres plpgsql notes
psql -U postgres -d notes -f /usr/share/postgresql-8.2-postgis/lwpostgis.sql
psql -U postgres -d notes -f /usr/share/postgresql-8.2-postgis/spatial_ref_sys.sql
psql -U postgres -d notes -f create_notes.sql
psql -U postgres -d notes -f create_comments.sql

where create_notes.sql is
CREATE TABLE notes (
    gid serial PRIMARY key,
    typeid bigint,
    username character varying(32),
    title character varying(256),
    datetime time default now(),
    content text,
    comments text
);

INSERT INTO notes (typeid,title,username,content,comments) VALUES(0,'title','username','content','comment');
SELECT AddGeometryColumn('public', 'notes', 'the_geom', 4326, 'POINT', 2);
UPDATE notes SET the_geom = GeometryFromText('POINT (0.0 0.0)',4326) WHERE gid = 1;

and create_comments.sql
CREATE TABLE comments (
    gid serial PRIMARY KEY,
    notes_gid int,
    username character varying(32),
    title character varying(256),
    datetime time default now(),
    comment text
);
INSERT INTO comments (notes_gid,title,username,comment) VALUES(1,'title','username','comment');
SELECT AddGeometryColumn('public', 'comments', 'the_fake_geom', 4326, 'POINT', 2);
UPDATE comments SET the_fake_geom = GeometryFromText('POINT (0.0 0.0)',4326) WHERE gid = 1;

Arne Kepp ha scritto:

Hi,

just curious whether anyone has seen this before: I've created a table with "notes" and "comments" (see creation script below), when I try to add the datastore (with version enable all tables), I get the following:

2007-12-04 16:04:57 EST ERROR: new row for relation "changesets" violates check constraint "enforce_geotype_bbox"
2007-12-04 16:04:57 EST STATEMENT: UPDATE "public"."changesets" SET "bbox" = setSRID('000000000100000000000000000000000000000000'::geometry,4326) WHERE revision = 3

I don't quiet understand how it picks that bbox, how this information is used or whether it is caused by my point geometries below.

Well, versioning datastore builds a bbox of each change occurred during
a transaction. The transaction may span multiple tables, so the
bbox is kept in 4326 (the tables touched might be in different crs).

When versioning a new table the bbox of the entire table is used
a the changeset bbox. But in your case, the table is empty,
I probably forgot to handle the case of empty bbox. I'll check.

Cheers
Andrea

Arne Kepp ha scritto:

Hi,

just curious whether anyone has seen this before: I've created a table with "notes" and "comments" (see creation script below), when I try to add the datastore (with version enable all tables), I get the following:

2007-12-04 16:04:57 EST ERROR: new row for relation "changesets" violates check constraint "enforce_geotype_bbox"
2007-12-04 16:04:57 EST STATEMENT: UPDATE "public"."changesets" SET "bbox" = setSRID('000000000100000000000000000000000000000000'::geometry,4326) WHERE revision = 3

Hmm... Arne, you just won a puppet.
The emtpy table case was already taken care for, and in fact you
were inserting a feature into the table (why btw?).
The single point case was taken care of too I believe, but it
did fail when the point was in the origin (I believe, I really
haven't tried with one out of the origin, but the code to try
and expand a point shaped bbox was there, problem is that it
was dependent on the point position for the expansion).

http://jira.codehaus.org/browse/GEOS-1584

I believe this is now fixed. Can you rebuild and check?

Cheers
Andrea

Andrea Aime wrote:

Arne Kepp ha scritto:

Hi,

just curious whether anyone has seen this before: I've created a table with "notes" and "comments" (see creation script below), when I try to add the datastore (with version enable all tables), I get the following:

2007-12-04 16:04:57 EST ERROR: new row for relation "changesets" violates check constraint "enforce_geotype_bbox"
2007-12-04 16:04:57 EST STATEMENT: UPDATE "public"."changesets" SET "bbox" = setSRID('000000000100000000000000000000000000000000'::geometry,4326) WHERE revision = 3

Hmm... Arne, you just won a puppet.

Sweet :slight_smile:

The emtpy table case was already taken care for, and in fact you
were inserting a feature into the table (why btw?).

I think it was required earlier this fall, at the time I wasn't able to tell bug from feature, and so I picked up a bad habit instead.

....

I believe this is now fixed. Can you rebuild and check?

Appears to work great.

Thank you,
-Arne

Arne Kepp ha scritto:

Hmm... Arne, you just won a puppet.

Sweet :slight_smile:

The emtpy table case was already taken care for, and in fact you
were inserting a feature into the table (why btw?).

I think it was required earlier this fall, at the time I wasn't able to tell bug from feature,

Ouch, your career in marketing has ended up today. You won't be able
to make customers believe that something is a feature instead of a bug
anymore like that :slight_smile:

Cheers
Andrea