[fdo-users] FDO PostGIS Provider -

Michael Toews mwtoews at sfu.ca
Tue Feb 10 00:03:48 EST 2009


I'm not sure exactly what the issue that you describe is, but if it is any help, I have noticed that Map3D 2008 does not always honour single-part or multi-part feature types too well. E.g., attempting to add a new single-part polygon to a MULTIPOLYGON feature seems to violate PG database constraints by adding a POLYGON feature and not a 1-element MULTIPOLYGON feature. You might have a related issue where the client app (Map3D in my case) is trying to store the wrong geometry type. Try using a BEFORE PG trigger.

Here is what I have to work around my issue:

-- An example table with MULTIPOLYGON features
CREATE TABLE poly_feature
(
  gid serial NOT NULL,
  CONSTRAINT poly_feature_pkey PRIMARY KEY (gid)
)
WITH (OIDS=FALSE);
SELECT AddGeometryColumn('','poly_feature','geometry',-1,'MULTIPOLYGON',2);

-- A trigger function that forces POLYGON features into MULTIPOLYGON features
-- also useful for MULTILINESTRING features which have the same issue
CREATE OR REPLACE FUNCTION make_multifeature_fn()
  RETURNS trigger AS
$BODY$BEGIN
  IF GeometryType(NEW.geometry) IN('POLYGON','LINESTRING') THEN
    NEW.geometry := Multi(NEW.geometry);
  END IF;
  RETURN NEW;
END;$BODY$
  LANGUAGE 'plpgsql' IMMUTABLE
  COST 100;
ALTER FUNCTION make_multifeature_fn() OWNER TO postgres;
COMMENT ON FUNCTION make_multifeature_fn() IS 'a workaround for issue with AutoCAD Map 3D 2008';

CREATE TRIGGER make_multipolygon_tg
  BEFORE INSERT OR UPDATE
  ON poly_feature
  FOR EACH ROW
  EXECUTE PROCEDURE make_multifeature_fn();


Hope this can help!

-Mike

----- Original Message -----
From: "Greg Boone" <greg.boone at autodesk.com>
To: "astrid emde" <astrid.emde at wheregroup.com>, "FDO Users Mail List" <fdo-users at lists.osgeo.org>
Sent: Monday, 9 February, 2009 07:22:15 GMT -08:00 US/Canada Pacific
Subject: RE: [fdo-users] FDO PostGIS Provider - 

This issue may better be solved through the Autodesk support network.

Greg

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Astrid Emde (WhereGroup)
Sent: Thursday, February 05, 2009 9:41 AM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] FDO PostGIS Provider -

Hello list,

I am testing the FDO PostGIS Provider at the moment.

I want to change existing geometries - insert a basepoint, move a point of
a geometry.

This action works fine with simple geometries like LINESTING or POLYGON (I
use _pedit, then I choose the geometry and choose the action afterwords).

But with MULTIPOLYGON or MULTILINESTRING I can't choose the geometry.
After running the _pedit-function, AutoCAd asks me to choose a Polygon,
but it does not react on my selection.

The question is whether the selection does not work on MULTIPOLYGONs or
MULTILINESTRINGs or whether there is a trick that I don't now?

Best regards

Astrid Emde



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


More information about the fdo-users mailing list