[fdo-users] FDOPostGIS 3.4L Check In of New generated PointFeature causes ErrorMessage

Orest Halustchak orest.halustchak at autodesk.com
Tue Aug 11 09:22:29 EDT 2009


Hi Hermann,

The problem with the insert using Map3D seems to be not with the actual insert, but with the retrieval of the generated gid value after the insert. Reading the generated gid value from the feature reader returned by the provider for the insert command is failing.

Orest.

From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Hermann Karl
Sent: Tuesday, August 11, 2009 3:53 AM
To: FDO Users Mail List
Subject: [fdo-users] FDOPostGIS 3.4L Check In of New generated PointFeature causes ErrorMessage


Dear List,

I tested FDO-Insert on the data from the previous message (gid PRIMARY KEY SERIAL) with FDO Toolbox http://fdotoolbox.googlecode.com from Jackie Ng and the Providers FDOPostGIS 3.4L from geomapgis and FDOPostGIS 3.4.0 from OSGEO.

!!!!!   I did not have any problems to insert a new feature.  !!!!!

!!!!!   It seems that there is a serious problem of AutoCAD Map 3d 2010 with the FDOPostGIS Provider 3.4  !!!!!.

I have tested the proposed "workaround" from David Anderson http://lists.osgeo.org/pipermail/fdo-users/attachments/20090716/a22481f5/postgistable.obj with FDO Toolbox and it works too.

-- create sequence --

CREATE SEQUENCE public.blocktest5_gid_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;
ALTER TABLE public.blocktest5_gid_seq OWNER TO postgres;

-- create function --

CREATE OR REPLACE FUNCTION public.autoinc_blocktest5_gid_trig()
  RETURNS trigger AS
$BODY$
declare
begin
select nextval('public.blocktest5_gid_seq') into new.gid;
return new;
end;
$BODY$ LANGUAGE plpgsql VOLATILE;
-- COST 100;
ALTER FUNCTION public.autoinc_blocktest5_gid_trig() OWNER TO postgres;

-- create table --

CREATE TABLE "blocktest5" ("gid" int PRIMARY KEY DEFAULT 1,
"blockname" varchar(255),
"layer" varchar(255),
"rotation" numeric,
"s" varchar(255),
"u" varchar(255));
SELECT AddGeometryColumn('','blocktest5','the_geom','-1','POINT',2);

-- create trigger --

CREATE TRIGGER autoinc_blocktest5_gid
  BEFORE INSERT
  ON public.blocktest5
  FOR EACH ROW
  EXECUTE PROCEDURE public.autoinc_blocktest5_gid_trig();

-- insert points --

INSERT INTO "blocktest5" ("blockname","layer","rotation","s","u",the_geom) VALUES ('GN1','GN','0.000000000000000','789',NULL,'0101000000FDA08A2C9FB3E3C0B9770762A8FA0E41');

INSERT INTO "blocktest5" ("blockname","layer","rotation","s","u",the_geom) VALUES ('GN2','GN','0.000000000000000','2345','6','0101000000E54B15C275B3E3C053379F6D81F90E41');

Any comments from autodesk ?

Karl



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20090811/43bb506e/attachment.html


More information about the fdo-users mailing list