TransWikia.com

Exception has occurred: Execute Error ERROR 000622: Parameters are not valid ERROR 000628: Cannot set input into parameter Coordinate_System

Geographic Information Systems Asked by Chelsea Lynn on March 5, 2021

Not sure what I am doing wrong. Keep getting this error:

Exception has occurred: Execute Error ERROR 000622: Parameters are not
valid ERROR 000628: Cannot set input into parameter Coordinate_System

Code:

import arcpy
from arcpy import env

env.workspace = r"C:PSPWeeklyWorkWeek10ArcPyAutomationAutomationDataCANADA"

in_features = "lakes.shp"

properties = "PERIMETER_LENGTH_GEODESIC"

length_unit = "KILOMETERS"

coordinate_system = arcpy.SpatialReference("Projected Coordinate 
System/Continental/North America/Canada_Lambert_Conformal_Conic")

arcpy.AddGeometryAttributes_management(in_features, properties, length_unit, "", coordinate_system)

One Answer

I think you are calling the SpatialReference incorrectly. Try doing it either as:

Just the code:

arcpy.SpatialReference(102002)

or just the name:

arcpy.SpatialReference("Canada_Lambert_Conformal_Conic")

or the filepath to a PRJ ensuring you include the extension:

arcpy.SpatialReference("C:My_Coords_FolderCanada_Lambert_Conformal_Conic.prj")

Refs: https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/spatialreference.htm https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/pdf/projected_coordinate_systems.pdf

Answered by JClarkson on March 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP