AnsweredAssumed Answered

arcpy.da.SearchCursor spatialReference

Question asked by EscondidoAnalyst on Feb 22, 2017
Latest reply on Feb 23, 2017 by EscondidoAnalyst

I am trying to get XY coordinate ouput in decimal degrees (NAD_1983_StatePlane_California_VI_FIPS_0406_Feet)

but I get the following (6307536.064266056, 1984263.0718122125).

 

From the following script section pertaining to spatial reference search cursor,does anything appear to be the reason why I get my current results ?

 

import csv,os,arcpy
os.chdir(r'S:\abc)
#Set path location of Excel (CSV) file
(r'S:\GIS\Projects\abc)
#Set Excel variables
ofile = open('Coordinates.csv','w')
writer = csv.writer(ofile)

fc = "ESC_MS4structures selection"
desc = arcpy.Describe(fc)
field = ["FACILITYID","SHAPE@XY"]
sr=desc.spatialReference
cursor = arcpy.da.SearchCursor(fc,field,None,sr)

for row in cursor:
    print (u'{0}, {1}'.format(row[0], row[1]))
    writer.writerows(cursor)


#Close Excel (CSV) file          
ofile.close()

os.startfile (r'S:\abc\Coordinates.csv')

Outcomes