#import, environment etc.. is omitted for brevity prjString = "PROJCS['World_Mercator',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],UNIT['Meter',1.0]];-20037700 -30198300 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision" #Create a layer based only on rows with 'src' attribute equal to 'YVR' arcpy.MakeFeatureLayer_management("FlightPaths", "YVR_layer", "\"src\" = 'YVR'") #Project the layer data arcpy.Project_management("YVR_layer", "YVR_Proj", prjString)
The problem I'm encountering is that Project is selecting the full source data set rather than the layer selection. The arcpy.MakeFeatureLayer_management operation has created the layer 'YVR_layer' from 'FlightPaths' successfully and selected the desired rows. When I pass 'YVR_layer' to arcpy.Project_management it projects all the rows from 'FlightPaths' rather than those from 'FlightPaths' as selected.
Any idea why this may be happening. Data is included below.