AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add Geometry to Existing Feature

6 REPLIES 6
Reply
Message 1 of 7
Metron4
680 Views, 6 Replies

Add Geometry to Existing Feature

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?

6 REPLIES 6
Message 2 of 7
hence_the_name
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/
Message 3 of 7
parkr4st
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

 

 

Message 4 of 7
Metron4
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

Message 5 of 7
hence_the_name
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/
Message 6 of 7
Rob
Explorer
in reply to: hence_the_name

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?

Message 7 of 7
hence_the_name
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/

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost