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












4















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
    Nov 19 '18 at 8:51






  • 1





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

    – BERA
    Nov 19 '18 at 9:15













  • @BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?

    – Pavel Pereverzev
    Nov 19 '18 at 9:30











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

    – JuniorPythonNewbie
    Nov 19 '18 at 9:45






  • 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
    Nov 19 '18 at 11:42
















4















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
    Nov 19 '18 at 8:51






  • 1





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

    – BERA
    Nov 19 '18 at 9:15













  • @BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?

    – Pavel Pereverzev
    Nov 19 '18 at 9:30











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

    – JuniorPythonNewbie
    Nov 19 '18 at 9:45






  • 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
    Nov 19 '18 at 11:42














4












4








4








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 Nov 19 '18 at 20:13









PolyGeo

53.5k1780240




53.5k1780240










asked Nov 19 '18 at 8:15









BERABERA

15.9k52042




15.9k52042













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

    – vada
    Nov 19 '18 at 8:51






  • 1





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

    – BERA
    Nov 19 '18 at 9:15













  • @BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?

    – Pavel Pereverzev
    Nov 19 '18 at 9:30











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

    – JuniorPythonNewbie
    Nov 19 '18 at 9:45






  • 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
    Nov 19 '18 at 11:42



















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

    – vada
    Nov 19 '18 at 8:51






  • 1





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

    – BERA
    Nov 19 '18 at 9:15













  • @BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?

    – Pavel Pereverzev
    Nov 19 '18 at 9:30











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

    – JuniorPythonNewbie
    Nov 19 '18 at 9:45






  • 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
    Nov 19 '18 at 11:42

















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

– vada
Nov 19 '18 at 8:51





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

– vada
Nov 19 '18 at 8:51




1




1





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

– BERA
Nov 19 '18 at 9:15







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

– BERA
Nov 19 '18 at 9:15















@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?

– Pavel Pereverzev
Nov 19 '18 at 9:30





@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?

– Pavel Pereverzev
Nov 19 '18 at 9:30













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

– JuniorPythonNewbie
Nov 19 '18 at 9:45





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

– JuniorPythonNewbie
Nov 19 '18 at 9:45




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
Nov 19 '18 at 11:42





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
Nov 19 '18 at 11:42










2 Answers
2






active

oldest

votes


















7














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
    Nov 19 '18 at 20:44





















4














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
    Nov 19 '18 at 14:46











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',
autoActivateHeartbeat: false,
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









7














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
    Nov 19 '18 at 20:44


















7














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
    Nov 19 '18 at 20:44
















7












7








7







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 Nov 19 '18 at 12:10









HornbyddHornbydd

26.4k32757




26.4k32757













  • 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
    Nov 19 '18 at 20:44





















  • 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
    Nov 19 '18 at 20:44



















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
Nov 19 '18 at 20:44







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
Nov 19 '18 at 20:44















4














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
    Nov 19 '18 at 14:46
















4














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
    Nov 19 '18 at 14:46














4












4








4







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 Nov 19 '18 at 14:43









Hornbydd

26.4k32757




26.4k32757










answered Nov 19 '18 at 12:40









BERABERA

15.9k52042




15.9k52042








  • 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
    Nov 19 '18 at 14:46














  • 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
    Nov 19 '18 at 14:46








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
Nov 19 '18 at 14:46





+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
Nov 19 '18 at 14:46


















draft saved

draft discarded




















































Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




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







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()