0

I am designing a workflow for my company which would include connecting to a PostGIS database from AutoCAD Map3D. This is done via the FDO API, included in Map3D.

A key functionality I want to use is the New Feature from Geometry command of the Map3D, which takes an existing drawing object (a closed polyline for example) as input, and creates a new PostGIS feature with its geometry. This essentially allows users to utilize all AutoCAD drawing functions and commands for PostGIS geometry creation.

However, when attempting to Check-in (commit) such a feature to the database, it fails with the following error message: Feature was not saved in the target feature source

2=Shape type mismatch on geometric property 'geom' of the feature class 'work_area'.
1=Failed to execute Fdo command.
Failed to insert feature.
postgis:munkater (), Rev# <0>
Message code: 200.
Message #0: Failed to save edit set.
Message code: 1.
Message #1: Failed to insert feature.
Message code: 1.
Message #2: Failed to execute Fdo command.
Message code: 1.
Message #3: Shape type mismatch on geometric property 'geom' of the feature class 'work_area'.
Message code: 1.
Message #4: Failed to save edit set.
Message code: 1

Researching the issue led me to this Autodesk help article, which includes a hotfix that supposedly fixes the problem, at least for the 2022 version of AutoCAD Map3D. I executed the hotfix according to the instructions (replace a certain file), but the issue persists.

Additionally, I ran a search on my system drive to see if there are copies of the problematic file in other locations than the one specified in the hotfix. I found 2 more occurences, and replaced these as well, but this didn't solve the problem either.

I also contacted Autodesk support regarding the same issue in the 2024 version, for which not even a hotfix exist; but I only received a generic reply like "… we'll look into it, maybe even fix it, but can't say when …"

I spent quite some time googling, looking through Autodesk articles and GIS.SE, to no avail. Does anyone know more about this issue, how to fix or work around it, or if it can be fixed at all?


I did some further testing after J.R's comment, and it seems that there is indeed a geometry type mismatch. Apparently, Map3D or FDO handles GIS geometry types in a way that makes Polygon and MultiPolygon types 100% incompatible, and if a feature is created with Polygon geometry type, then it cannot be saved to a MultiPolygon table. The question still stands though, because New Feature from Geometry should create geometries matching the type of the selected table; especially when called from table context menu.

4
  • Just to be sure this is related to a AutoCAD Map3D bug and not an actual case of trying to save the wrong geometry type (like trying to save a polyline in a polygon feature class) ?
    – J.R
    Commented Mar 6 at 10:49
  • No, the "New feaure from geometry" command doesn't simply try to save whatever I select to the database, it creates a new entity based on the vector layer (=DB table) selected; and even asks whether to delete the original drawing entity. So it should make the proper conversion internally and automatically, and apparently it does, the new, yet-uncommitted feature appears on the map with the proper vector layer style. But I'll do some more testing and update the Q as neccessary. Commented Mar 6 at 11:49
  • 1
    If postgres has no geometry defined it should accept all types gis.stackexchange.com/questions/89200/… (we tend to use FME to do this ETL load from dwg to postgres/postgis)
    – Mapperz
    Commented Mar 6 at 13:44
  • 1
    @Mapperz The postgres table in question has a defined MultiPolygon geometry type. The problem, however, is not postgres not accepting the feature; but Map3D not producing a feature which postgres could accept. Commented Mar 6 at 13:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.