[fdo-users] PostGIS and Map 3D 2010 autoincrement problems

Hermann Karl Karl.Hermann at dornbirn.at
Fri Jul 17 09:52:00 EDT 2009


Hi List,

I have tested AutoCAD Map 3D 2010, FDO PostGIS 3.4, PostGIS 8.2.13
with sample data "towns" from

http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgis_tut01

In the testcases the error messages are caused by the constraints
(geometrytype, serial Primary Key) on the table "towns" in PostGIS.
These constraints will be created by default by an import of data with
the tool "shp2pgsql".
There is no way to set the splitting rules for "gid" in AutoCAD Map to
NULL because there is a "NOT NULL" constraint by the serial primary key
property.
For all it is important that before importing the shp-files in PostGIS
they have to be saved with codeset utf-8 instead of default win1252.
With QGIS this is no problem.

############  Case 1  #######################

if the table "towns" is created like below:

CREATE TABLE "towns" (gid serial PRIMARY KEY,........);
SELECT
AddGeometryColumn('','towns','the_geom','26986','MULTIPOLYGON',2);
INSERT INTO "towns" ("objectid",".....

I tried to check in 2 Polyons merged with the function "GIS-Object
manipulation" "Object merge"

i got these message

-FdoPostGIS:towns (220), Rev# <-1>
-object could not be updatet
1=FDO-Command could not be executed.
2=The execution of SQL statement failed with PostgreSQL error code:
PGRES_FATAL_ERROR, FEHLER: new row for Relation >>towns<< violates
Check-Constraint >>enforce_geotype_the_geom<<
some objects could not be stored
manipulated row could not be stored.

ceck in of a splitted polygon causes also an error message


############  Case 2  #######################

if the table "towns" is created like below:

CREATE TABLE "towns" (gid serial PRIMARY KEY,........);
SELECT AddGeometryColumn('','towns','the_geom','26986','GEOMETRY',2);
INSERT INTO "towns" ("objectid","....


check in of merged objects will work

check in fo splittet objects caused an error message

- FdoPostGIS:towns_serial[],Rev#<0>
- object could not be inserted
- 1=FDO-command could not be executed
- 2=invalid propertyname
some objects could not be stored

despite of this error message one part of the polygon which was splittet
is stored in the postgis with gid = max(gid) + 1 and one part has an
updated geometry (with splitting option "use existing ids")
in this case manually updating the value of gid is not possible
the provider does not evaluate the next possible unique value of gid


######## Case 3 #################

if the table "towns" is created like below:

CREATE TABLE "towns" (gid int4,.....);
SELECT AddGeometryColumn('','towns','the_geom','26986','GEOMETRY',2);
INSERT INTO "towns" ("objectid","..........
UPDATE "public"."towns" set gid = objectid;
ALTER TABLE "public"."towns" ADD PRIMARY KEY (gid);

check in of merged objects will work

check in of splittet polygon

if you choosed splitting with option use existing ids you have to update
the gid for one part of the splitted polygon manually to a unique value
if you choosed splitting with option new ids you have to update the gid
for all checked out polygons manually to a unique value
so before the manipulation you should look for max (gid) by sorting the
table

For me it would be important, what type of tables in PostGIS have to be
created to allow correct gis-object manipulation in AutoCAD Map 3D.
It would be also nice to have a demo data-set in a sample-table to
verify the correct installation of the provider.

greetings

Karl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20090717/8ff9a698/attachment.html


More information about the fdo-users mailing list