AutoCAD Map 3D General Discussion

Reply
Distinguished Contributor
Metron4
Posts: 133
Registered: ‎10-09-2003
Message 1 of 7 (255 Views)

Add Geometry to Existing Feature

255 Views, 6 Replies
01-14-2014 09:46 AM

I have an existing table in my SQL database for buildings. This table was already populated with numerous records before GIS was considered. I would now like to add a geometry column so we can store the building footprints. How do you "update" or add geometry to an existing record? I only see the ability to create "new" features for points, lines, and polygons?

Mentor
Robert_Fritz
Posts: 162
Registered: ‎12-08-2011
Message 2 of 7 (233 Views)

Re: Add Geometry to Existing Feature

01-14-2014 11:31 PM in reply to: Metron4

Hi,

 

Map somehow requires a geometry which you can display in Map and modify. If you have records without any geometry it seems you can't add a geometry für a specific record, you can only create new records including an new geometry.

 

If you use Map Industry Models you can create a geometry for an existing record without geometry.

 

But I suppose you don't use IM. The only thing I can think of right now is to create a dummy geometry for all records in SQL Server using plain SQL. You can then connect to the table in Map and modify the shape of the object as desired.

 

Good luck, Rob

 

 

 

http://raumpatrouille3d.blogspot.ch/
Valued Mentor
parkr4st
Posts: 420
Registered: ‎03-24-2004
Message 3 of 7 (221 Views)

Re: Add Geometry to Existing Feature

01-15-2014 03:23 AM in reply to: Metron4

go the other way.  new FDO with geometry and one column in the data table the holds the id for the data in you current table. join the current table to the new one and the result will be geometry with your current data attached. 

 

you may have to do some map import and export and/or bulk storage saves to get the result into the format you want to work with

 

dave

 

 

Distinguished Contributor
Metron4
Posts: 133
Registered: ‎10-09-2003
Message 4 of 7 (210 Views)

Re: Add Geometry to Existing Feature

01-15-2014 09:02 AM in reply to: parkr4st

Thanks for the responses. We do plan to use an industry model in the future but we are not ready to make the move yet.

 

This option to create a temporary FDO table to store the geometry and join it to my existing table sounds intriguing. Can you explain this idea more? After I join then how exactly do you transfer the geometry data from one table to the next?

 

Thanks,

 

Rob

Mentor
Robert_Fritz
Posts: 162
Registered: ‎12-08-2011
Message 5 of 7 (184 Views)

Re: Add Geometry to Existing Feature

01-16-2014 11:50 PM in reply to: Metron4

Hi,

 

I'm not sure about the suggested workflow but if you create a new temporary table in SQL server to capture the geometry you could use plain SQL (update) later on to transfer the geometry from the temporary table to the main table (as long as you have ids to link both).

 

Rob

http://raumpatrouille3d.blogspot.ch/
Rob
Member
Rob
Posts: 4
Registered: ‎11-03-2010
Message 6 of 7 (136 Views)

Re: Add Geometry to Existing Feature

02-05-2014 09:52 AM in reply to: Robert_Fritz

Our SQL DBA is encountering an issue trying to copy the geometry from our temp table into the new table with existing records. The UPDATE function is returning the error: "A .NET Framework error occurred during execution of user defined routine or aggregate 'geometry'." This appears to be because of the way SQL is storing the point geometry data saved from Map, which looks like this: 0x00000000010C6C29E78B25B43841FE23D34D43113B41.

 

I think SQL wants it in the format 'POINT (0 0)'. Has anyone else tested copying geometry from one table to another in SQL Server?

Mentor
Robert_Fritz
Posts: 162
Registered: ‎12-08-2011
Message 7 of 7 (125 Views)

Re: Add Geometry to Existing Feature

02-05-2014 11:17 PM in reply to: Rob

Hi Rob,

 

I'm not familiar with SQLServer but I think you need to use a function to convert the internal format (e.g. 0x00000000010C6C29E78B25B43841FE23D34D43113B41) into a spatial data type. The spatial data type can the be used for updates or inserts.

 

Here is an example which should be similar to your situation:

 

http://stackoverflow.com/questions/15744512/how-to-update-table-with-data-from-same-table

 

Rob

http://raumpatrouille3d.blogspot.ch/

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community