<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Convert Coordinate Notation tool creates OID field, need OBJECTID in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/convert-coordinate-notation-tool-creates-oid-field/m-p/657683#M21916</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Python I am running a script as a tool that takes a CSV file of coordinates and creates a feature class of points from the coordinates. I use the Convert Coordinate Notation tool. Script below for context but I am mainly taking issue with lines 43-45.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import os
import re
arcpy.env.overwriteOutput=True

# Get the datasets and folder locations
oldFC = arcpy.GetParameterAsText(0)
fallout = arcpy.GetParameterAsText(1)
newFC = arcpy.GetParameterAsText(2)
# set columns where longitude and latitude are, and the format (two columns assumed)
lonAtt=arcpy.GetParameterAsText(3)
latAtt=arcpy.GetParameterAsText(4)

# Get layer spatial reference
coo = arcpy.Describe(oldFC)
coo = coo.spatialReference
inCoo = arcpy.SpatialReference(4269)

# Sanity check
arcpy.AddMessage("Old met file: " + oldFC)
arcpy.AddMessage("Backup location: " + fallout)
arcpy.AddMessage("CSV data file: " + newFC)

# This splits out the FC name from the Database Connection path
sdeFC = os.path.split(oldFC)[1]
arcpy.AddMessage("SDE file name: " + sdeFC)

# This splits out the Database Connection path
sde = os.path.split(oldFC)[0]
arcpy.AddMessage("SDE: " + sde)

# Also escape out the parentheses ...I don't remember why I did this
sdeI = re.sub('\(.*\)', '', sde)
sdeFCI = re.sub('\(.*\)', '', sdeFC)

# replace special period character with underscores in FC name
backItUp = re.sub('\.', '_', sdeFCI )
arcpy.AddMessage("backup name: " + backItUp)

arcpy.CopyFeatures_management(oldFC, os.path.join(fallout, backItUp + ".shp"))

# set output name the same as the original, so it will get overwritten with updated table
arcpy.ConvertCoordinateNotation_management(in_table=newFC, out_featureclass=oldFC,x_field=lonAtt, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; y_field=latAtt, input_coordinate_format="DD_2", output_coordinate_format="DD_2",
&amp;nbsp;&amp;nbsp;&amp;nbsp; in_coor_system=inCoo, spatial_reference=coo)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why does this tool create an OID field instead of an OBJECTID field? I assume it has something to do with the input being a table...but it doesn't make sense because it creates a feature class. Per this &lt;A href="http://support.esri.com/technical-article/000010834" title="http://support.esri.com/technical-article/000010834" rel="nofollow noopener noreferrer" target="_blank"&gt;FAQ: What are the differences in the behavior of the OBJECTID, FID, and OID fields?&lt;/A&gt;&amp;nbsp; "&lt;SPAN style="color: #595959; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15.9375px;"&gt;In a standalone dBase table, the 'OID' field contains the ObjectID, and the values start at zero".&lt;/SPAN&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script overwrites an old feature class which has an OBJECTID field since it is in a geodatabase. This tool outputs the OID field and then my map services break because of the change in field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get back an OBJECTID field and get rid of the OID? Right now my workaround is to not use this tool, and instead make an XY event layer from the table and then copy that into the GDB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 03:50:37 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T03:50:37Z</dc:date>
    <item>
      <title>Convert Coordinate Notation tool creates OID field, need OBJECTID</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-coordinate-notation-tool-creates-oid-field/m-p/657683#M21916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Python I am running a script as a tool that takes a CSV file of coordinates and creates a feature class of points from the coordinates. I use the Convert Coordinate Notation tool. Script below for context but I am mainly taking issue with lines 43-45.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import os
import re
arcpy.env.overwriteOutput=True

# Get the datasets and folder locations
oldFC = arcpy.GetParameterAsText(0)
fallout = arcpy.GetParameterAsText(1)
newFC = arcpy.GetParameterAsText(2)
# set columns where longitude and latitude are, and the format (two columns assumed)
lonAtt=arcpy.GetParameterAsText(3)
latAtt=arcpy.GetParameterAsText(4)

# Get layer spatial reference
coo = arcpy.Describe(oldFC)
coo = coo.spatialReference
inCoo = arcpy.SpatialReference(4269)

# Sanity check
arcpy.AddMessage("Old met file: " + oldFC)
arcpy.AddMessage("Backup location: " + fallout)
arcpy.AddMessage("CSV data file: " + newFC)

# This splits out the FC name from the Database Connection path
sdeFC = os.path.split(oldFC)[1]
arcpy.AddMessage("SDE file name: " + sdeFC)

# This splits out the Database Connection path
sde = os.path.split(oldFC)[0]
arcpy.AddMessage("SDE: " + sde)

# Also escape out the parentheses ...I don't remember why I did this
sdeI = re.sub('\(.*\)', '', sde)
sdeFCI = re.sub('\(.*\)', '', sdeFC)

# replace special period character with underscores in FC name
backItUp = re.sub('\.', '_', sdeFCI )
arcpy.AddMessage("backup name: " + backItUp)

arcpy.CopyFeatures_management(oldFC, os.path.join(fallout, backItUp + ".shp"))

# set output name the same as the original, so it will get overwritten with updated table
arcpy.ConvertCoordinateNotation_management(in_table=newFC, out_featureclass=oldFC,x_field=lonAtt, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; y_field=latAtt, input_coordinate_format="DD_2", output_coordinate_format="DD_2",
&amp;nbsp;&amp;nbsp;&amp;nbsp; in_coor_system=inCoo, spatial_reference=coo)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why does this tool create an OID field instead of an OBJECTID field? I assume it has something to do with the input being a table...but it doesn't make sense because it creates a feature class. Per this &lt;A href="http://support.esri.com/technical-article/000010834" title="http://support.esri.com/technical-article/000010834" rel="nofollow noopener noreferrer" target="_blank"&gt;FAQ: What are the differences in the behavior of the OBJECTID, FID, and OID fields?&lt;/A&gt;&amp;nbsp; "&lt;SPAN style="color: #595959; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15.9375px;"&gt;In a standalone dBase table, the 'OID' field contains the ObjectID, and the values start at zero".&lt;/SPAN&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script overwrites an old feature class which has an OBJECTID field since it is in a geodatabase. This tool outputs the OID field and then my map services break because of the change in field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get back an OBJECTID field and get rid of the OID? Right now my workaround is to not use this tool, and instead make an XY event layer from the table and then copy that into the GDB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:50:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-coordinate-notation-tool-creates-oid-field/m-p/657683#M21916</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T03:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Coordinate Notation tool creates OID field, need OBJECTID</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-coordinate-notation-tool-creates-oid-field/m-p/657684#M21917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you try to save it to a geodatabase rather than a shapefile.&amp;nbsp; objectid is the equivalent to a shapefiles fid&lt;/P&gt;&lt;P&gt;OID is normally created in shapefiles since shapefiles now require a minimum of 3 fields, FID, Shape, OID are the minimum&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 22:59:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-coordinate-notation-tool-creates-oid-field/m-p/657684#M21917</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-07-21T22:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Coordinate Notation tool creates OID field, need OBJECTID</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-coordinate-notation-tool-creates-oid-field/m-p/657685#M21918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I tested it in a File Geodatabase, Shapefile and Enterprise Geodatabase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 23:03:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-coordinate-notation-tool-creates-oid-field/m-p/657685#M21918</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-07-21T23:03:44Z</dc:date>
    </item>
  </channel>
</rss>

