Project a geometry to another geometry in memory

Discussion created by dk10 on Feb 22, 2012
Latest reply on Mar 28, 2014 by graeme
Is it possible to project a geometry to another geometry in memory using ARCPY.  I am trying to take a XY coordinate and create in memory features to project the coordinate system.  I have used the following code to do so, but the project statement doesn't work.  I get ERROR 000944: Output feature class cannot be in the in_memory workspace.

import string,sys,os,arcpy

point = arcpy.Point(x_coord,y_coord)
Pnt_geom = arcpy.PointGeometry(point, in_coord_system)
Pnt_geom_out = arcpy.Geometry()

mytestlayer = arcpy.Project_management(Pnt_geom, Pnt_geom_out, out_coord_system, "#", in_coord_system)

desc = arcpy.Describe(mytestlayer)
print desc.extent.XMin
print desc.extent.YMin


This code works if i put in a shapefile name in the place to the Pnt_geom_out variable.
My 4 variables (x_coord, y_coord, in_coord_system, out_coord_system) are all valid.

Darryl Klassen
GIS Analyst