Skip to main content

Hello,

The shape_area and Shape_length fields are missing when I write data to a file geodatabase. I've experimented by including these fields from a reader that is at the beginning of the workbench. That seems to work, but shouldnt the writer create these fields for me? Also, the objectid field is written, but at the bottom of the table. Shouldnt I be able to control this to be at the top?

Hello @pfrankinc,

 

Are you writing to a pre-existing Geodatabase that contains the Shape_length and shape_area fields or trying to add the Shape_length and Shape_area fields to a pre-existing table? If the former, the first step I would take is to look at the case of your attributes. If the latter, I suspect you will either have to Drop and Re-create the table this time the fields should be added, although you could use Arcpy in a PythonCaller if you wish not to Drop your database.

 

The ObjectID is created by default within the Geodatabase as such It will append the incoming ObjectID to ObjectID_1(your existing ObjectID attribute will be relocated to the end of the attributes). If you want your ObjectID to be the first attribute, if you rename it and move it up in the User Attributes section(using the arrow toggles in the User Attributes pane) the new-named ObjectID should be first.

I hope that helps.


Thanks @trentatsafe,

I am writing to an existing geodatabase, but it is creating a new feature class that does not exist. So there are no existing fields, just those that I am bringing in from other features that are getting processed. I didn't think a feature class could exist without standard shape fields. Do I have to explicitly create these fields? Thanks


Hello @pfrankinc,

 

Are you writing to a pre-existing Geodatabase that contains the Shape_length and shape_area fields or trying to add the Shape_length and Shape_area fields to a pre-existing table? If the former, the first step I would take is to look at the case of your attributes. If the latter, I suspect you will either have to Drop and Re-create the table this time the fields should be added, although you could use Arcpy in a PythonCaller if you wish not to Drop your database.

 

The ObjectID is created by default within the Geodatabase as such It will append the incoming ObjectID to ObjectID_1(your existing ObjectID attribute will be relocated to the end of the attributes). If you want your ObjectID to be the first attribute, if you rename it and move it up in the User Attributes section(using the arrow toggles in the User Attributes pane) the new-named ObjectID should be first.

I hope that helps.

I ended up adding a shape_area and shape_length field and calculating these to their respective geometries using the attributemanager. Thanks!

 


Hello @pfrankinc,

 

Are you writing to a pre-existing Geodatabase that contains the Shape_length and shape_area fields or trying to add the Shape_length and Shape_area fields to a pre-existing table? If the former, the first step I would take is to look at the case of your attributes. If the latter, I suspect you will either have to Drop and Re-create the table this time the fields should be added, although you could use Arcpy in a PythonCaller if you wish not to Drop your database.

 

The ObjectID is created by default within the Geodatabase as such It will append the incoming ObjectID to ObjectID_1(your existing ObjectID attribute will be relocated to the end of the attributes). If you want your ObjectID to be the first attribute, if you rename it and move it up in the User Attributes section(using the arrow toggles in the User Attributes pane) the new-named ObjectID should be first.

I hope that helps.

@trentatsafe. Without using a template, is there any way to put OBJECTID and SHAPE columns at the first and second place? (Esri Geodatabase API, not ArcObjects)
@trentatsafe. Without using a template, is there any way to put OBJECTID and SHAPE columns at the first and second place? (Esri Geodatabase API, not ArcObjects)
Hello @kuanglee,

 

 

I believe you can reposition the order of attributes on the Writer Feature Type(using the little arrow toggles for up and down). Of note, if you have OBJECTID and SHAPE that you are writing, an additional OBJECTID_1 and SHAPE_1 will be written and populated by default via the Geodatabase. I hope that helps.

Hello @pfrankinc,

 

Are you writing to a pre-existing Geodatabase that contains the Shape_length and shape_area fields or trying to add the Shape_length and Shape_area fields to a pre-existing table? If the former, the first step I would take is to look at the case of your attributes. If the latter, I suspect you will either have to Drop and Re-create the table this time the fields should be added, although you could use Arcpy in a PythonCaller if you wish not to Drop your database.

 

The ObjectID is created by default within the Geodatabase as such It will append the incoming ObjectID to ObjectID_1(your existing ObjectID attribute will be relocated to the end of the attributes). If you want your ObjectID to be the first attribute, if you rename it and move it up in the User Attributes section(using the arrow toggles in the User Attributes pane) the new-named ObjectID should be first.

I hope that helps.

@trentatsafe The column of SHAPE contains internal geometry information, which can not manually be created in the writer; and furthermore, what field type for SHAPE should be assigned? It does not seem to have an option of field type for it in the writer.

 


The Answer to this possibly needs to be updated.

Had the same issue in that the ArcGIS system managed "SHAPE_Length" field was not being created by either the FME File Geodatabase Writer nor by ArcGIS. It seems that SHAPE_Length is kind of an optional field for ArcGIS, it will happily work with Feature Classes that don't have it, and it needs whatever is the Feature Class creator to make a field for it if the user wants to have this specially managed field.

Following a variation of @pfrankinc solution of just manually creating an Attribute called "SHAPE_Length" I found that you don't actually need to set a calculated length value to this in the Workspace as originally posted. All you need to do is use AttributeCreator or AttributeManager to create an Attribute called "SHAPE_Length" and set the value to Null and make sure it writes out as a Double field.

When ArcGIS opens the the resulting geodatabase, it will recognise "SHAPE_Length" as a system managed field and autopopulate it with the ArcGIS calculated length of the line features, and this will dynamically update its value as you edit the features in ArcMap, as per usual behaviour for Feature Classes created in ArcCatalog.


Reply