PostGIS and Map 3D 2010 autoincrement problems

10 messages Options
Embed this post
Permalink
David Anderson

PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

I have been trying to setup Map 3D 2010 to access a PostGIS database that has a feature set to auto increment the primary key.  When trying to create a new feature, Map 3D complains about the gid being invalid because it tries to add it as 0.  Map 3D won’t let me change the value because it is controlling it.  If I check in the feature, close the drawing, reopen the drawing Map 3D shows the feature even though it was saying it couldn’t be added.  I have tried with various combinations of PostgreSQL 8.2 & 8.3 and PostGIS 1.3.4-1.3.6 with the same results.

 

Is anybody successfully using Map 3D with the auto increment setting?  Does this only work with a certain data type?  Any help would be greatly appreciated.

 

QGIS and uDig both access the database properly and can add features so the database is working in that respect.

 

Thanks,

David


_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Mike Toews

Re: PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
David,

Yikes. I've been demoing Map3D 2010 for the past few weeks to see if we
want to upgrade from 2008, and I can reproduce the same behavior you
describe in 2010. This behavior is new to me, since it is not an issue
with 2008 (the serial appears as 0 in the table, as you described, until
it is checked-in and refreshed).

To add details, the error response from 2010 when trying to check-in a
new feature:

<Error code="200" type="5" dispensation="3" sId="2"
occurrence="1">Feature was not saved in the target feature
source.<Parameters>
<Parameter classId="0" position="0">
<Message>2=Invalid property value name 'gid'.
</Message>
<SQL></SQL>
</Parameter>
<Parameter classId="0" position="0">
<Message>1=Failed to execute Fdo command.
</Message>
<SQL></SQL>
</Parameter>
<Parameter classId="0" position="0">
<Message>Failed to insert feature.</Message>
<SQL></SQL>
</Parameter>
<Parameter classId="0" position="0">
<Message>FdoPostGIS:mytable (), Rev# <0></Message>
<SQL></SQL>
</Parameter></Parameters>
<Entry code="1" type="15" sId="3" occurrence="1">Failed to save some
features.</Entry>
<Entry code="1" type="15" sId="4" occurrence="1">Failed to save edit
set.</Entry>
</Error>

In QGIS and other programs, the default value for a serial (integer)
that is shown in the property before insert/commit is
"nextval('mytable_gid_seq'::regclass)", which might explain the error
message "Invalid property value name 'gid'", since it appears as a
string, not an integer in this form.

I tried fixing this with some trigger functions within the database, but
whatever I've tried I can't seem to make a workaround. The best I can do
is raise some exception in a before trigger, which shows up in the error
message in AutoCAD, but making a trigger that sets "NEW.gid :=
nextval('mytable_gid_seq'::regclass);" still throws the error shown above.

Is this an issue with FDO or with AutoCAD Map3D 2010?

-Mike

David Anderson wrote:

>
> I have been trying to setup Map 3D 2010 to access a PostGIS database
> that has a feature set to auto increment the primary key. When trying
> to create a new feature, Map 3D complains about the gid being invalid
> because it tries to add it as 0. Map 3D won’t let me change the value
> because it is controlling it. If I check in the feature, close the
> drawing, reopen the drawing Map 3D shows the feature even though it
> was saying it couldn’t be added. I have tried with various
> combinations of PostgreSQL 8.2 & 8.3 and PostGIS 1.3.4-1.3.6 with the
> same results.
>
> Is anybody successfully using Map 3D with the auto increment setting?
> Does this only work with a certain data type? Any help would be
> greatly appreciated.
>
> QGIS and uDig both access the database properly and can add features
> so the database is working in that respect.
>
> Thanks,
>
> David
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>  

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
David Anderson

RE: PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
Mike:

I finally figured out a workaround.  In a nutshell:

        Create TRIGGER and FUNCTION to set NEW.gid to
nextval('some_sequence'::regclass)
        TRIGGER should be on BEFORE INSERT event.
        Default value of the gid column should be set to 1 (it will be
changed by the TRIGGER).

If you would like more detailed steps, including the SQL statements, let
me know.
Map 3D adds the features appropriately by sending a 1 as the gid.  The
data table will still show a 1 until the layer is refreshed.
I don't know if this is an FDO issue or an AutoCAD issue.  Any comments
from some more knowledgeable users would be appreciated.

Thanks,

David

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Mike Toews
Sent: Monday, June 22, 2009 5:53 PM
To: FDO Users Mail List
Subject: Re: [fdo-users] PostGIS and Map 3D 2010 autoincrement problems

David,

Yikes. I've been demoing Map3D 2010 for the past few weeks to see if we
want to upgrade from 2008, and I can reproduce the same behavior you
describe in 2010. This behavior is new to me, since it is not an issue
with 2008 (the serial appears as 0 in the table, as you described, until

it is checked-in and refreshed).

To add details, the error response from 2010 when trying to check-in a
new feature:

<Error code="200" type="5" dispensation="3" sId="2"
occurrence="1">Feature was not saved in the target feature
source.<Parameters>
<Parameter classId="0" position="0">
<Message>2=Invalid property value name 'gid'.
</Message>
<SQL></SQL>
</Parameter>
<Parameter classId="0" position="0">
<Message>1=Failed to execute Fdo command.
</Message>
<SQL></SQL>
</Parameter>
<Parameter classId="0" position="0">
<Message>Failed to insert feature.</Message>
<SQL></SQL>
</Parameter>
<Parameter classId="0" position="0">
<Message>FdoPostGIS:mytable (), Rev# <0></Message>
<SQL></SQL>
</Parameter></Parameters>
<Entry code="1" type="15" sId="3" occurrence="1">Failed to save some
features.</Entry>
<Entry code="1" type="15" sId="4" occurrence="1">Failed to save edit
set.</Entry>
</Error>

In QGIS and other programs, the default value for a serial (integer)
that is shown in the property before insert/commit is
"nextval('mytable_gid_seq'::regclass)", which might explain the error
message "Invalid property value name 'gid'", since it appears as a
string, not an integer in this form.

I tried fixing this with some trigger functions within the database, but

whatever I've tried I can't seem to make a workaround. The best I can do

is raise some exception in a before trigger, which shows up in the error

message in AutoCAD, but making a trigger that sets "NEW.gid :=
nextval('mytable_gid_seq'::regclass);" still throws the error shown
above.

Is this an issue with FDO or with AutoCAD Map3D 2010?

-Mike

David Anderson wrote:

>
> I have been trying to setup Map 3D 2010 to access a PostGIS database
> that has a feature set to auto increment the primary key. When trying
> to create a new feature, Map 3D complains about the gid being invalid
> because it tries to add it as 0. Map 3D won't let me change the value
> because it is controlling it. If I check in the feature, close the
> drawing, reopen the drawing Map 3D shows the feature even though it
> was saying it couldn't be added. I have tried with various
> combinations of PostgreSQL 8.2 & 8.3 and PostGIS 1.3.4-1.3.6 with the
> same results.
>
> Is anybody successfully using Map 3D with the auto increment setting?
> Does this only work with a certain data type? Any help would be
> greatly appreciated.
>
> QGIS and uDig both access the database properly and can add features
> so the database is working in that respect.
>
> Thanks,
>
> David
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>  

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Astrid Emde (WhereGroup)

RE: PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
Hello list,

I have the same problem like Mike and Dave.

My wish would be to use AutoCAD Map 3D without the use of TRIGGER which
controls my gid.

Is there a discussion about this in the FDO team or the AutoCAD team
already going on?

David:
It would be nice if you could send me more information about your TRIGGER
solution.

best regards astrid

On Tue, June 23, 2009 11:37 pm, David Anderson wrote:

> Mike:
>
> I finally figured out a workaround.  In a nutshell:
>
> Create TRIGGER and FUNCTION to set NEW.gid to
> nextval('some_sequence'::regclass)
> TRIGGER should be on BEFORE INSERT event.
> Default value of the gid column should be set to 1 (it will be
> changed by the TRIGGER).
>
> If you would like more detailed steps, including the SQL statements, let
> me know.
> Map 3D adds the features appropriately by sending a 1 as the gid.  The
> data table will still show a 1 until the layer is refreshed.
> I don't know if this is an FDO issue or an AutoCAD issue.  Any comments
> from some more knowledgeable users would be appreciated.
>
> Thanks,
>
> David
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Mike Toews
> Sent: Monday, June 22, 2009 5:53 PM
> To: FDO Users Mail List
> Subject: Re: [fdo-users] PostGIS and Map 3D 2010 autoincrement problems
>
> David,
>
> Yikes. I've been demoing Map3D 2010 for the past few weeks to see if we
> want to upgrade from 2008, and I can reproduce the same behavior you
> describe in 2010. This behavior is new to me, since it is not an issue
> with 2008 (the serial appears as 0 in the table, as you described, until
>
> it is checked-in and refreshed).
>
> To add details, the error response from 2010 when trying to check-in a
> new feature:
>
> <Error code="200" type="5" dispensation="3" sId="2"
> occurrence="1">Feature was not saved in the target feature
> source.<Parameters>
> <Parameter classId="0" position="0">
> <Message>2=Invalid property value name 'gid'.
> </Message>
> <SQL></SQL>
> </Parameter>
> <Parameter classId="0" position="0">
> <Message>1=Failed to execute Fdo command.
> </Message>
> <SQL></SQL>
> </Parameter>
> <Parameter classId="0" position="0">
> <Message>Failed to insert feature.</Message>
> <SQL></SQL>
> </Parameter>
> <Parameter classId="0" position="0">
> <Message>FdoPostGIS:mytable (), Rev# <0></Message>
> <SQL></SQL>
> </Parameter></Parameters>
> <Entry code="1" type="15" sId="3" occurrence="1">Failed to save some
> features.</Entry>
> <Entry code="1" type="15" sId="4" occurrence="1">Failed to save edit
> set.</Entry>
> </Error>
>
> In QGIS and other programs, the default value for a serial (integer)
> that is shown in the property before insert/commit is
> "nextval('mytable_gid_seq'::regclass)", which might explain the error
> message "Invalid property value name 'gid'", since it appears as a
> string, not an integer in this form.
>
> I tried fixing this with some trigger functions within the database, but
>
> whatever I've tried I can't seem to make a workaround. The best I can do
>
> is raise some exception in a before trigger, which shows up in the error
>
> message in AutoCAD, but making a trigger that sets "NEW.gid :=
> nextval('mytable_gid_seq'::regclass);" still throws the error shown
> above.
>
> Is this an issue with FDO or with AutoCAD Map3D 2010?
>
> -Mike
>
> David Anderson wrote:
>>
>> I have been trying to setup Map 3D 2010 to access a PostGIS database
>> that has a feature set to auto increment the primary key. When trying
>> to create a new feature, Map 3D complains about the gid being invalid
>> because it tries to add it as 0. Map 3D won't let me change the value
>> because it is controlling it. If I check in the feature, close the
>> drawing, reopen the drawing Map 3D shows the feature even though it
>> was saying it couldn't be added. I have tried with various
>> combinations of PostgreSQL 8.2 & 8.3 and PostGIS 1.3.4-1.3.6 with the
>> same results.
>>
>> Is anybody successfully using Map 3D with the auto increment setting?
>> Does this only work with a certain data type? Any help would be
>> greatly appreciated.
>>
>> QGIS and uDig both access the database properly and can add features
>> so the database is working in that respect.
>>
>> Thanks,
>>
>> David
>>
>>
> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> fdo-users mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/fdo-users
>>
>
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>


Mit freundlichen Grüßen

Astrid Emde
----------------------------------

Aufwind durch Wissen!

Qualifizierte OpenSource-Schulungen
bei der www.foss-academy.eu

----------------------------------

 Astrid Emde
 WhereGroup GmbH & Co.KG
 Siemensstraße 8
 53121 Bonn
 Germany

 Fon: +49(0)228 90 90 38 - 19
 Fax: +49(0)228 90 90 38 - 11

 [hidden email]
 www.wheregroup.com

 Amtsgericht Bonn, HRA 6788
 -------------------------------
 Komplementärin:
 WhereGroup Verwaltungs GmbH
 vertreten durch:
 Arnulf Christl, Olaf Knopp, Peter Stamm
 ---------------------------------------

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Orest Halustchak

RE: PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
Hi Astrid,

Bruno Scott has been working recently on the PostGIS provider and has fixed some problems with using it with Map 2010. Bruno, have you hit this problem with autoincrement columns? If you view your table in the Map Schema Editor, does it show the gid column as both auto-generated and read-only?

Thanks,
Orest.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Astrid Emde
Sent: Thursday, July 16, 2009 9:31 AM
To: FDO Users Mail List
Cc: [hidden email]
Subject: RE: [fdo-users] PostGIS and Map 3D 2010 autoincrement problems

Hello list,

I have the same problem like Mike and Dave.

My wish would be to use AutoCAD Map 3D without the use of TRIGGER which
controls my gid.

Is there a discussion about this in the FDO team or the AutoCAD team
already going on?

David:
It would be nice if you could send me more information about your TRIGGER
solution.

best regards astrid

On Tue, June 23, 2009 11:37 pm, David Anderson wrote:

> Mike:
>
> I finally figured out a workaround.  In a nutshell:
>
> Create TRIGGER and FUNCTION to set NEW.gid to
> nextval('some_sequence'::regclass)
> TRIGGER should be on BEFORE INSERT event.
> Default value of the gid column should be set to 1 (it will be
> changed by the TRIGGER).
>
> If you would like more detailed steps, including the SQL statements, let
> me know.
> Map 3D adds the features appropriately by sending a 1 as the gid.  The
> data table will still show a 1 until the layer is refreshed.
> I don't know if this is an FDO issue or an AutoCAD issue.  Any comments
> from some more knowledgeable users would be appreciated.
>
> Thanks,
>
> David
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Mike Toews
> Sent: Monday, June 22, 2009 5:53 PM
> To: FDO Users Mail List
> Subject: Re: [fdo-users] PostGIS and Map 3D 2010 autoincrement problems
>
> David,
>
> Yikes. I've been demoing Map3D 2010 for the past few weeks to see if we
> want to upgrade from 2008, and I can reproduce the same behavior you
> describe in 2010. This behavior is new to me, since it is not an issue
> with 2008 (the serial appears as 0 in the table, as you described, until
>
> it is checked-in and refreshed).
>
> To add details, the error response from 2010 when trying to check-in a
> new feature:
>
> <Error code="200" type="5" dispensation="3" sId="2"
> occurrence="1">Feature was not saved in the target feature
> source.<Parameters>
> <Parameter classId="0" position="0">
> <Message>2=Invalid property value name 'gid'.
> </Message>
> <SQL></SQL>
> </Parameter>
> <Parameter classId="0" position="0">
> <Message>1=Failed to execute Fdo command.
> </Message>
> <SQL></SQL>
> </Parameter>
> <Parameter classId="0" position="0">
> <Message>Failed to insert feature.</Message>
> <SQL></SQL>
> </Parameter>
> <Parameter classId="0" position="0">
> <Message>FdoPostGIS:mytable (), Rev# <0></Message>
> <SQL></SQL>
> </Parameter></Parameters>
> <Entry code="1" type="15" sId="3" occurrence="1">Failed to save some
> features.</Entry>
> <Entry code="1" type="15" sId="4" occurrence="1">Failed to save edit
> set.</Entry>
> </Error>
>
> In QGIS and other programs, the default value for a serial (integer)
> that is shown in the property before insert/commit is
> "nextval('mytable_gid_seq'::regclass)", which might explain the error
> message "Invalid property value name 'gid'", since it appears as a
> string, not an integer in this form.
>
> I tried fixing this with some trigger functions within the database, but
>
> whatever I've tried I can't seem to make a workaround. The best I can do
>
> is raise some exception in a before trigger, which shows up in the error
>
> message in AutoCAD, but making a trigger that sets "NEW.gid :=
> nextval('mytable_gid_seq'::regclass);" still throws the error shown
> above.
>
> Is this an issue with FDO or with AutoCAD Map3D 2010?
>
> -Mike
>
> David Anderson wrote:
>>
>> I have been trying to setup Map 3D 2010 to access a PostGIS database
>> that has a feature set to auto increment the primary key. When trying
>> to create a new feature, Map 3D complains about the gid being invalid
>> because it tries to add it as 0. Map 3D won't let me change the value
>> because it is controlling it. If I check in the feature, close the
>> drawing, reopen the drawing Map 3D shows the feature even though it
>> was saying it couldn't be added. I have tried with various
>> combinations of PostgreSQL 8.2 & 8.3 and PostGIS 1.3.4-1.3.6 with the
>> same results.
>>
>> Is anybody successfully using Map 3D with the auto increment setting?
>> Does this only work with a certain data type? Any help would be
>> greatly appreciated.
>>
>> QGIS and uDig both access the database properly and can add features
>> so the database is working in that respect.
>>
>> Thanks,
>>
>> David
>>
>>
> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> fdo-users mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/fdo-users
>>
>
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>


Mit freundlichen Grüßen

Astrid Emde
----------------------------------

Aufwind durch Wissen!

Qualifizierte OpenSource-Schulungen
bei der www.foss-academy.eu

----------------------------------

 Astrid Emde
 WhereGroup GmbH & Co.KG
 Siemensstraße 8
 53121 Bonn
 Germany

 Fon: +49(0)228 90 90 38 - 19
 Fax: +49(0)228 90 90 38 - 11

 [hidden email]
 www.wheregroup.com

 Amtsgericht Bonn, HRA 6788
 -------------------------------
 Komplementärin:
 WhereGroup Verwaltungs GmbH
 vertreten durch:
 Arnulf Christl, Olaf Knopp, Peter Stamm
 ---------------------------------------

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Bruno Scott

Re: PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
In reply to this post by David Anderson
What version of the PostGIS Provider are you using.
Have you tried this one:
http://www.geomapgis.com/web/geomap-group/fdo/index.html 

I've made a lot of testing with autoincrement and it worked ok.

Bruno
Astrid Emde (WhereGroup)

Re: PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
Hello Bruno,

 I use the Logged FdoPg34L.zip from the link [1] (I downloaded it 2 weeks
ago) with PostgreSQL 8.2.4 and PostGIS 1.3

I use a schema in my table. Does this cause the problem?

Have a look at this mail to see hwo my table looks like:
http://lists.osgeo.org/pipermail/fdo-users/2009-July/001727.html

I will do some more testing.

Best regards astrid

[1]  http://www.geomapgis.com/web/geomap-group/fdo/index.html


On Thu, July 16, 2009 4:12 pm, Bruno Scott wrote:

>
> What version of the PostGIS Provider are you using.
> Have you tried this one:
> http://www.geomapgis.com/web/geomap-group/fdo/index.html
>
> I've made a lot of testing with autoincrement and it worked ok.
>
> Bruno
> --
> View this message in context:
> http://n2.nabble.com/PostGIS-and-Map-3D-2010-autoincrement-problems-tp3139073p3268292.html
> Sent from the FDO Users mailing list archive at Nabble.com.
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>


Mit freundlichen Grüßen

Astrid Emde
----------------------------------

Aufwind durch Wissen!

Qualifizierte OpenSource-Schulungen
bei der www.foss-academy.eu

----------------------------------

 Astrid Emde
 WhereGroup GmbH & Co.KG
 Siemensstraße 8
 53121 Bonn
 Germany

 Fon: +49(0)228 90 90 38 - 19
 Fax: +49(0)228 90 90 38 - 11

 [hidden email]
 www.wheregroup.com

 Amtsgericht Bonn, HRA 6788
 -------------------------------
 Komplementärin:
 WhereGroup Verwaltungs GmbH
 vertreten durch:
 Arnulf Christl, Olaf Knopp, Peter Stamm
 ---------------------------------------

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
David Anderson

RE: PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bruno Scott
Bruno:

> Have you tried this one:
> http://www.geomapgis.com/web/geomap-group/fdo/index.html

I am using this version of the provider and still experiencing the
problems.

Astrid:

I have attached the SQL script I used for creating the tables and
triggers.  If the attachment doesn't come through I can give you a link
to download it.

David


_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

postgistable.sql (2K) Download Attachment
Hermann Karl

PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
In reply to this post by David Anderson
Some javascript/style in this post has been disabled (why?)
PostGIS and Map 3D 2010 autoincrement problems

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


_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
prasadpandit

Re: PostGIS and Map 3D 2010 autoincrement problems

Reply Threaded More More options
Print post
Permalink
In reply to this post by David Anderson
Hi David,

I hope my document will help you surely.
http://cid-d64f8d54dec3ff85.skydrive.live.com/self.aspx/.Public/PostGIS-Map3D2010.pdf

Let me know if you need more help.

Best regards,
Prasad

David Anderson wrote:
I have been trying to setup Map 3D 2010 to access a PostGIS database
that has a feature set to auto increment the primary key.  When trying
to create a new feature, Map 3D complains about the gid being invalid
because it tries to add it as 0.  Map 3D won't let me change the value
because it is controlling it.  If I check in the feature, close the
drawing, reopen the drawing Map 3D shows the feature even though it was
saying it couldn't be added.  I have tried with various combinations of
PostgreSQL 8.2 & 8.3 and PostGIS 1.3.4-1.3.6 with the same results.

 

Is anybody successfully using Map 3D with the auto increment setting?
Does this only work with a certain data type?  Any help would be greatly
appreciated.

 

QGIS and uDig both access the database properly and can add features so
the database is working in that respect.

 

Thanks,

David


_______________________________________________
fdo-users mailing list
fdo-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users