Changing name of geometry column for feature class in file geodatabase?











up vote
3
down vote

favorite












I'm converting geopackages to features in a file geodatabase using Copy Features. For some reason the geometry column is named geom instead of the usual Shape and I want to rename it to Shape:



enter image description here



I have tried:




  • Alter Field but the geometry column is greyed out

  • Make Feature Layer of the geopackage and renaming column then Copy Features but the column is still named geom.

  • I have read this thread How do you change the geometry field name?, but the solution seems to require manual loading of data


How can I rename the geometry column?










share|improve this question
























  • See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
    – vada
    yesterday






  • 1




    @vada I need to rename them, that answer is how to reference them using tokens
    – BERA
    yesterday












  • @BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
    – Pavel Pereverzev
    yesterday










  • Adding new column, copying values and deleting geom_area is not an option?
    – JuniorPythonNewbie
    yesterday






  • 3




    File geodatabase only allows one geometry column per table, so add-copy-delete is not an option. If you want to change the name, you'll need to reload the data.
    – Vince
    yesterday















up vote
3
down vote

favorite












I'm converting geopackages to features in a file geodatabase using Copy Features. For some reason the geometry column is named geom instead of the usual Shape and I want to rename it to Shape:



enter image description here



I have tried:




  • Alter Field but the geometry column is greyed out

  • Make Feature Layer of the geopackage and renaming column then Copy Features but the column is still named geom.

  • I have read this thread How do you change the geometry field name?, but the solution seems to require manual loading of data


How can I rename the geometry column?










share|improve this question
























  • See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
    – vada
    yesterday






  • 1




    @vada I need to rename them, that answer is how to reference them using tokens
    – BERA
    yesterday












  • @BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
    – Pavel Pereverzev
    yesterday










  • Adding new column, copying values and deleting geom_area is not an option?
    – JuniorPythonNewbie
    yesterday






  • 3




    File geodatabase only allows one geometry column per table, so add-copy-delete is not an option. If you want to change the name, you'll need to reload the data.
    – Vince
    yesterday













up vote
3
down vote

favorite









up vote
3
down vote

favorite











I'm converting geopackages to features in a file geodatabase using Copy Features. For some reason the geometry column is named geom instead of the usual Shape and I want to rename it to Shape:



enter image description here



I have tried:




  • Alter Field but the geometry column is greyed out

  • Make Feature Layer of the geopackage and renaming column then Copy Features but the column is still named geom.

  • I have read this thread How do you change the geometry field name?, but the solution seems to require manual loading of data


How can I rename the geometry column?










share|improve this question















I'm converting geopackages to features in a file geodatabase using Copy Features. For some reason the geometry column is named geom instead of the usual Shape and I want to rename it to Shape:



enter image description here



I have tried:




  • Alter Field but the geometry column is greyed out

  • Make Feature Layer of the geopackage and renaming column then Copy Features but the column is still named geom.

  • I have read this thread How do you change the geometry field name?, but the solution seems to require manual loading of data


How can I rename the geometry column?







arcgis-desktop






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 23 hours ago









PolyGeo

52.7k1779236




52.7k1779236










asked yesterday









BERA

13.4k51738




13.4k51738












  • See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
    – vada
    yesterday






  • 1




    @vada I need to rename them, that answer is how to reference them using tokens
    – BERA
    yesterday












  • @BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
    – Pavel Pereverzev
    yesterday










  • Adding new column, copying values and deleting geom_area is not an option?
    – JuniorPythonNewbie
    yesterday






  • 3




    File geodatabase only allows one geometry column per table, so add-copy-delete is not an option. If you want to change the name, you'll need to reload the data.
    – Vince
    yesterday


















  • See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
    – vada
    yesterday






  • 1




    @vada I need to rename them, that answer is how to reference them using tokens
    – BERA
    yesterday












  • @BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
    – Pavel Pereverzev
    yesterday










  • Adding new column, copying values and deleting geom_area is not an option?
    – JuniorPythonNewbie
    yesterday






  • 3




    File geodatabase only allows one geometry column per table, so add-copy-delete is not an option. If you want to change the name, you'll need to reload the data.
    – Vince
    yesterday
















See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
– vada
yesterday




See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
– vada
yesterday




1




1




@vada I need to rename them, that answer is how to reference them using tokens
– BERA
yesterday






@vada I need to rename them, that answer is how to reference them using tokens
– BERA
yesterday














@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
– Pavel Pereverzev
yesterday




@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
– Pavel Pereverzev
yesterday












Adding new column, copying values and deleting geom_area is not an option?
– JuniorPythonNewbie
yesterday




Adding new column, copying values and deleting geom_area is not an option?
– JuniorPythonNewbie
yesterday




3




3




File geodatabase only allows one geometry column per table, so add-copy-delete is not an option. If you want to change the name, you'll need to reload the data.
– Vince
yesterday




File geodatabase only allows one geometry column per table, so add-copy-delete is not an option. If you want to change the name, you'll need to reload the data.
– Vince
yesterday










2 Answers
2






active

oldest

votes

















up vote
6
down vote



accepted










I've come across this irritating problem in the past which has implications for tools that have not been developed robustly enough to deal with the situation when the geometry field is not called SHAPE, a standard that has been in place for many years. My gut feeling is that it is done by people who don't realise the ramifications and are changing it because they can change it, I'm guessing people in the open source community?



ESRI tools like featureclass to featureclass won't allow you to map geometry fields in the field mapping. The only way to resolve this is to create an empty featureclass where the geometry field is called SHAPE, import the field structure from the source dataset and either use the GUI to Load data or you can use the Append tool.



I've also come across situations where the OBJECTID is not called OBJECTID. You would have to follow the same procedure.






share|improve this answer





















  • In this case user wants to convert data from a standard GeoPackage into ESRI FileGDB by using the tools offered by ArcGIS desktop so it feels like open source community is not involved. On the other hand GDAL driver that is using the API from ESRI seems to use SHAPE as the default name for the geometry gdal.org/drv_filegdb.html but user can select another name.
    – user30184
    22 hours ago




















up vote
3
down vote













A workaround is to create an empty feature class, add all fields except OID and geometry and append the data:



import arcpy, os    
geopackage = r'C:foldertestdata.gpkgmain.testdata'
arcpy.MakeFeatureLayer_management(in_features=geopackage, out_layer='templyr')
fields = [f for f in arcpy.ListFields(dataset='templyr') if f.type not in ("Geometry","OID")]
arcpy.CreateFeatureclass_management(out_path=r'C:folderDefault.gdb', out_name='somename',
geometry_type='POLYGON', spatial_reference=arcpy.SpatialReference(3006))
for field in fields:
arcpy.AddField_management(in_table=os.path.join(r'C:folderDefault.gdb','somename'),
field_name=field.name, field_type=field.type, field_length=field.length)
arcpy.Append_management(inputs='templyr', target=os.path.join(r'C:folderDefault.gdb','somename'))


Screenshot






share|improve this answer



















  • 1




    +1 This is the sort of code I think could be packaged up into a nice scripting tool for a useful utility toolbox and distributed on the ESRI code sharing website. A future project when deadlines are not looming!
    – Hornbydd
    yesterday











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f303159%2fchanging-name-of-geometry-column-for-feature-class-in-file-geodatabase%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
6
down vote



accepted










I've come across this irritating problem in the past which has implications for tools that have not been developed robustly enough to deal with the situation when the geometry field is not called SHAPE, a standard that has been in place for many years. My gut feeling is that it is done by people who don't realise the ramifications and are changing it because they can change it, I'm guessing people in the open source community?



ESRI tools like featureclass to featureclass won't allow you to map geometry fields in the field mapping. The only way to resolve this is to create an empty featureclass where the geometry field is called SHAPE, import the field structure from the source dataset and either use the GUI to Load data or you can use the Append tool.



I've also come across situations where the OBJECTID is not called OBJECTID. You would have to follow the same procedure.






share|improve this answer





















  • In this case user wants to convert data from a standard GeoPackage into ESRI FileGDB by using the tools offered by ArcGIS desktop so it feels like open source community is not involved. On the other hand GDAL driver that is using the API from ESRI seems to use SHAPE as the default name for the geometry gdal.org/drv_filegdb.html but user can select another name.
    – user30184
    22 hours ago

















up vote
6
down vote



accepted










I've come across this irritating problem in the past which has implications for tools that have not been developed robustly enough to deal with the situation when the geometry field is not called SHAPE, a standard that has been in place for many years. My gut feeling is that it is done by people who don't realise the ramifications and are changing it because they can change it, I'm guessing people in the open source community?



ESRI tools like featureclass to featureclass won't allow you to map geometry fields in the field mapping. The only way to resolve this is to create an empty featureclass where the geometry field is called SHAPE, import the field structure from the source dataset and either use the GUI to Load data or you can use the Append tool.



I've also come across situations where the OBJECTID is not called OBJECTID. You would have to follow the same procedure.






share|improve this answer





















  • In this case user wants to convert data from a standard GeoPackage into ESRI FileGDB by using the tools offered by ArcGIS desktop so it feels like open source community is not involved. On the other hand GDAL driver that is using the API from ESRI seems to use SHAPE as the default name for the geometry gdal.org/drv_filegdb.html but user can select another name.
    – user30184
    22 hours ago















up vote
6
down vote



accepted







up vote
6
down vote



accepted






I've come across this irritating problem in the past which has implications for tools that have not been developed robustly enough to deal with the situation when the geometry field is not called SHAPE, a standard that has been in place for many years. My gut feeling is that it is done by people who don't realise the ramifications and are changing it because they can change it, I'm guessing people in the open source community?



ESRI tools like featureclass to featureclass won't allow you to map geometry fields in the field mapping. The only way to resolve this is to create an empty featureclass where the geometry field is called SHAPE, import the field structure from the source dataset and either use the GUI to Load data or you can use the Append tool.



I've also come across situations where the OBJECTID is not called OBJECTID. You would have to follow the same procedure.






share|improve this answer












I've come across this irritating problem in the past which has implications for tools that have not been developed robustly enough to deal with the situation when the geometry field is not called SHAPE, a standard that has been in place for many years. My gut feeling is that it is done by people who don't realise the ramifications and are changing it because they can change it, I'm guessing people in the open source community?



ESRI tools like featureclass to featureclass won't allow you to map geometry fields in the field mapping. The only way to resolve this is to create an empty featureclass where the geometry field is called SHAPE, import the field structure from the source dataset and either use the GUI to Load data or you can use the Append tool.



I've also come across situations where the OBJECTID is not called OBJECTID. You would have to follow the same procedure.







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









Hornbydd

25.7k32756




25.7k32756












  • In this case user wants to convert data from a standard GeoPackage into ESRI FileGDB by using the tools offered by ArcGIS desktop so it feels like open source community is not involved. On the other hand GDAL driver that is using the API from ESRI seems to use SHAPE as the default name for the geometry gdal.org/drv_filegdb.html but user can select another name.
    – user30184
    22 hours ago




















  • In this case user wants to convert data from a standard GeoPackage into ESRI FileGDB by using the tools offered by ArcGIS desktop so it feels like open source community is not involved. On the other hand GDAL driver that is using the API from ESRI seems to use SHAPE as the default name for the geometry gdal.org/drv_filegdb.html but user can select another name.
    – user30184
    22 hours ago


















In this case user wants to convert data from a standard GeoPackage into ESRI FileGDB by using the tools offered by ArcGIS desktop so it feels like open source community is not involved. On the other hand GDAL driver that is using the API from ESRI seems to use SHAPE as the default name for the geometry gdal.org/drv_filegdb.html but user can select another name.
– user30184
22 hours ago






In this case user wants to convert data from a standard GeoPackage into ESRI FileGDB by using the tools offered by ArcGIS desktop so it feels like open source community is not involved. On the other hand GDAL driver that is using the API from ESRI seems to use SHAPE as the default name for the geometry gdal.org/drv_filegdb.html but user can select another name.
– user30184
22 hours ago














up vote
3
down vote













A workaround is to create an empty feature class, add all fields except OID and geometry and append the data:



import arcpy, os    
geopackage = r'C:foldertestdata.gpkgmain.testdata'
arcpy.MakeFeatureLayer_management(in_features=geopackage, out_layer='templyr')
fields = [f for f in arcpy.ListFields(dataset='templyr') if f.type not in ("Geometry","OID")]
arcpy.CreateFeatureclass_management(out_path=r'C:folderDefault.gdb', out_name='somename',
geometry_type='POLYGON', spatial_reference=arcpy.SpatialReference(3006))
for field in fields:
arcpy.AddField_management(in_table=os.path.join(r'C:folderDefault.gdb','somename'),
field_name=field.name, field_type=field.type, field_length=field.length)
arcpy.Append_management(inputs='templyr', target=os.path.join(r'C:folderDefault.gdb','somename'))


Screenshot






share|improve this answer



















  • 1




    +1 This is the sort of code I think could be packaged up into a nice scripting tool for a useful utility toolbox and distributed on the ESRI code sharing website. A future project when deadlines are not looming!
    – Hornbydd
    yesterday















up vote
3
down vote













A workaround is to create an empty feature class, add all fields except OID and geometry and append the data:



import arcpy, os    
geopackage = r'C:foldertestdata.gpkgmain.testdata'
arcpy.MakeFeatureLayer_management(in_features=geopackage, out_layer='templyr')
fields = [f for f in arcpy.ListFields(dataset='templyr') if f.type not in ("Geometry","OID")]
arcpy.CreateFeatureclass_management(out_path=r'C:folderDefault.gdb', out_name='somename',
geometry_type='POLYGON', spatial_reference=arcpy.SpatialReference(3006))
for field in fields:
arcpy.AddField_management(in_table=os.path.join(r'C:folderDefault.gdb','somename'),
field_name=field.name, field_type=field.type, field_length=field.length)
arcpy.Append_management(inputs='templyr', target=os.path.join(r'C:folderDefault.gdb','somename'))


Screenshot






share|improve this answer



















  • 1




    +1 This is the sort of code I think could be packaged up into a nice scripting tool for a useful utility toolbox and distributed on the ESRI code sharing website. A future project when deadlines are not looming!
    – Hornbydd
    yesterday













up vote
3
down vote










up vote
3
down vote









A workaround is to create an empty feature class, add all fields except OID and geometry and append the data:



import arcpy, os    
geopackage = r'C:foldertestdata.gpkgmain.testdata'
arcpy.MakeFeatureLayer_management(in_features=geopackage, out_layer='templyr')
fields = [f for f in arcpy.ListFields(dataset='templyr') if f.type not in ("Geometry","OID")]
arcpy.CreateFeatureclass_management(out_path=r'C:folderDefault.gdb', out_name='somename',
geometry_type='POLYGON', spatial_reference=arcpy.SpatialReference(3006))
for field in fields:
arcpy.AddField_management(in_table=os.path.join(r'C:folderDefault.gdb','somename'),
field_name=field.name, field_type=field.type, field_length=field.length)
arcpy.Append_management(inputs='templyr', target=os.path.join(r'C:folderDefault.gdb','somename'))


Screenshot






share|improve this answer














A workaround is to create an empty feature class, add all fields except OID and geometry and append the data:



import arcpy, os    
geopackage = r'C:foldertestdata.gpkgmain.testdata'
arcpy.MakeFeatureLayer_management(in_features=geopackage, out_layer='templyr')
fields = [f for f in arcpy.ListFields(dataset='templyr') if f.type not in ("Geometry","OID")]
arcpy.CreateFeatureclass_management(out_path=r'C:folderDefault.gdb', out_name='somename',
geometry_type='POLYGON', spatial_reference=arcpy.SpatialReference(3006))
for field in fields:
arcpy.AddField_management(in_table=os.path.join(r'C:folderDefault.gdb','somename'),
field_name=field.name, field_type=field.type, field_length=field.length)
arcpy.Append_management(inputs='templyr', target=os.path.join(r'C:folderDefault.gdb','somename'))


Screenshot







share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday









Hornbydd

25.7k32756




25.7k32756










answered yesterday









BERA

13.4k51738




13.4k51738








  • 1




    +1 This is the sort of code I think could be packaged up into a nice scripting tool for a useful utility toolbox and distributed on the ESRI code sharing website. A future project when deadlines are not looming!
    – Hornbydd
    yesterday














  • 1




    +1 This is the sort of code I think could be packaged up into a nice scripting tool for a useful utility toolbox and distributed on the ESRI code sharing website. A future project when deadlines are not looming!
    – Hornbydd
    yesterday








1




1




+1 This is the sort of code I think could be packaged up into a nice scripting tool for a useful utility toolbox and distributed on the ESRI code sharing website. A future project when deadlines are not looming!
– Hornbydd
yesterday




+1 This is the sort of code I think could be packaged up into a nice scripting tool for a useful utility toolbox and distributed on the ESRI code sharing website. A future project when deadlines are not looming!
– Hornbydd
yesterday


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f303159%2fchanging-name-of-geometry-column-for-feature-class-in-file-geodatabase%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

'app-layout' is not a known element: how to share Component with different Modules

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

WPF add header to Image with URL pettitions [duplicate]