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
Nov 19 at 8:51
1
@vada I need to rename them, that answer is how to reference them using tokens
– BERA
Nov 19 at 9:15
@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
– Pavel Pereverzev
Nov 19 at 9:30
Adding new column, copying values and deleting geom_area is not an option?
– JuniorPythonNewbie
Nov 19 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 at 11:42
|
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 Nov 19 at 20:13
PolyGeo♦
52.8k1779236
52.8k1779236
asked Nov 19 at 8:15
BERA
13.4k51738
13.4k51738
See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
– vada
Nov 19 at 8:51
1
@vada I need to rename them, that answer is how to reference them using tokens
– BERA
Nov 19 at 9:15
@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
– Pavel Pereverzev
Nov 19 at 9:30
Adding new column, copying values and deleting geom_area is not an option?
– JuniorPythonNewbie
Nov 19 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 at 11:42
|
show 1 more comment
See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
– vada
Nov 19 at 8:51
1
@vada I need to rename them, that answer is how to reference them using tokens
– BERA
Nov 19 at 9:15
@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
– Pavel Pereverzev
Nov 19 at 9:30
Adding new column, copying values and deleting geom_area is not an option?
– JuniorPythonNewbie
Nov 19 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 at 11:42
See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
– vada
Nov 19 at 8:51
See this answer, maybe it can help you. gis.stackexchange.com/questions/234126/…
– vada
Nov 19 at 8:51
1
1
@vada I need to rename them, that answer is how to reference them using tokens
– BERA
Nov 19 at 9:15
@vada I need to rename them, that answer is how to reference them using tokens
– BERA
Nov 19 at 9:15
@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
– Pavel Pereverzev
Nov 19 at 9:30
@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
– Pavel Pereverzev
Nov 19 at 9:30
Adding new column, copying values and deleting geom_area is not an option?
– JuniorPythonNewbie
Nov 19 at 9:45
Adding new column, copying values and deleting geom_area is not an option?
– JuniorPythonNewbie
Nov 19 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 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 at 11:42
|
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
Nov 19 at 20:44
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
Nov 19 at 14:46
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
Nov 19 at 20:44
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
Nov 19 at 20:44
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 Nov 19 at 12:10
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
Nov 19 at 20:44
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
Nov 19 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 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 at 20:44
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
Nov 19 at 14:46
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
Nov 19 at 14:46
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 Nov 19 at 14:43
Hornbydd
25.7k32756
25.7k32756
answered Nov 19 at 12:40
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
Nov 19 at 14:46
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
Nov 19 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 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 at 14:46
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
Nov 19 at 8:51
1
@vada I need to rename them, that answer is how to reference them using tokens
– BERA
Nov 19 at 9:15
@BERA What about changing just alias? Or making a FeatureClass to FeatureClass conversion?
– Pavel Pereverzev
Nov 19 at 9:30
Adding new column, copying values and deleting geom_area is not an option?
– JuniorPythonNewbie
Nov 19 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 at 11:42