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:
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
|
show 1 more comment
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:
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
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
|
show 1 more comment
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:
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
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:
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
arcgis-desktop
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
|
show 1 more comment
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
|
show 1 more comment
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.
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
add a comment |
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'))
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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'))
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
add a comment |
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'))
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
add a comment |
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'))
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'))
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
add a comment |
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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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