I am trying to batch project feature classes from one GDB to another in a stand alone script. This script also includes field mapping from a csv file to a new GDB but that portion of the script works fine. I have ArcMap 10.6.1 installed with Python 2.7.14. I started with with ESRI sample for BatchProject stand alone example.
import csv
import sys
import os
import arcpy
from arcpy import env
import BatchProject.py
arcpy.env.workspace = "C:\Data\Pennsylvania\Washington County\MCPExport.gdb" # Set workspace environment
out_workspace = "C:\\Data\\Pennsylvania\\NG911_TEST.gdb" # Output workspace
input_features = arcpy.ListFeatureClasses()
template = "C:\Data\Pennsylvania\NG911_TEST.gdb\ESZ_EMS"
out_cs = '' transformation = 'NAD_1983_To_WGS_1984_5' # Geographic transformation, if needed
res = arcpy.BatchProject(input_features, out_workspace, out_cs, template, transformation)
Error I get:
Traceback (most recent call last):
File "C:\Data\Pennsylvania\ETL_Bat_November2020\ETL\washington\etl3.py", line 6, in <module>
import BatchProject.py
File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcToolBox\Scripts\BatchProject.py", line 54, in <module>
raise ConversionUtils.GPError(msgCoordinateSystem)
GPError: Must Enter a Spatial Reference or Template Feature Class.
I have tried various templates and out_cs values but nothing works. I've added. Any help would be appreciated!!
Thanks!!!