AnsweredAssumed Answered

How do you project a single pointGeometry object with arcpy?

Question asked by dzestis94 on May 1, 2017
Latest reply on May 2, 2017 by rvburton

Hi everyone,


So I got a task, and I don`t know how to do it. In csv file, i have to create two new columns which shows WGS-84 coordinates. Maybe someone, have solution for this ? I can`t undertstand what is in 29 line... I tried to google it.. And I found the example... but without explanation.


Thanks for any help


import arcpy 
import csv

fc = r"#"
out_csv = r"#"

fields = {
    "Global_ID": "Global_ID",
    "Global_Copy": "Global_Copy",
    "SHAPE@X": "POINT_X",
    "SHAPE@Y": "POINT_Y",
    "SHAPE@X": "LAT",
    "SHAPE@Y": "LONG"

table_fields = []
csv_fields = []
for field in fields:

def tableToCSV(fc, out_csv):
    with open(out_csv, 'wb') as csv_file:
        writer = csv.writer(csv_file, delimiter=';', lineterminator='\n')
        with arcpy.da.SearchCursor(fc, table_fields) as cursor:
            for row in cursor:
                point = Point(row[idxLAT],row[idxLONG])
                #TODO: reproject
                reppoint = point
                row[idxLAT] = reppoint.x
                row[idxLONG] = reppoint.y
        print out_csv 

tableToCSV(fc, out_csv)