Adding a second Geometry column to a Feature Class

719
5
12-28-2017 07:41 AM
EdwardBlair
Occasional Contributor

Am trying to add a second Geometry column to a feature class.  I know Arc applications won't know about this field -- and I would not want them to -- but the field would be added to support custom functionality.   The basic process of creating a field of Field Type Geometry and adding it to the feature class just fails.   Have tried adding a blob field and storing a Geometry into it errors as well, though I haven't gone very far down this path.

I realize I could create another feature class with a relationship to the first, but want to avoid this if possible.

Any pointers on a preferred method that's been found to work would be much appreciated.

Thanks,

Ed

0 Kudos
5 Replies
TedKowal
Occasional Contributor III

What about using a text field and store "WKT"  Well Known Text to describe the geometry?  Many other medium to large format database can read and interpret WKT.   I use this in SQL server for custom geometry analysis/manipulation.  

Just the first thought that came to me when I read your post.

EdwardBlair
Occasional Contributor

Ted -

Thanks much for the suggestion. As I looked back further into the code I

was using to add the geometry field I realized I wasn't setting a geometry

definition for the new geometry field I was trying to add. Once I created

a new geometry def and assigned it to the new geometry field I was able to

add the field without error. (code below)

Thanks again for your suggestion. I'm sure that would work as well.

Ed

0 Kudos
BartPittari
New Contributor III

Ed,

Hi - I was looking to do something similar and found this topic, but didn't see the code you mentioned.  Any chance you still have it or could send it?  I'm trying to update an FC from an older geometry to ST and was trying to add a second shape field.

0 Kudos
EdwardBlair
Occasional Contributor

Ted -

Have to add an additional point to this thread. What I had hoped to do

was add a line geometry field to what was otherwise a point feature class.

I find when I do this the class shape type also gets changed from point to

line... which is not what I hoped.

Anyway, am reverting to your method of the text WKT field, which seems to

be working OK so far.

Thanks much!

Ed

0 Kudos
TedKowal
Occasional Contributor III

I am glad you are making progress! 

No workaround is perfect (each comes with its own set problems).  WKT allows you to mix geometries and can handle most of the basic types spatial queries; however, doing any real complex types of spatial queries will eventually mean you will have to develop your own spatial programs to perform them with WKT especially if you are using mix geometries.

0 Kudos