La principale raison pour laquelle je vois que je ne souhaite pas créer une classe d'entités est que l'arcpy.CreateFeatureclass_management peut être lent. Vous pouvez également utiliser arcpy.da.NumPyArrayTofeatureClass, qui est plus ou moins instantané pour les classes d'entités in_memory:
In [1]: import arcpy
In [2]: import numpy as np
In [3]: geosr = arcpy.SpatialReference('Geographic Coordinate Systems/Spheroid-based/WGS 1984 Major Auxiliary Sphere')
In [4]: tosr = arcpy.SpatialReference('Projected Coordinate Systems/World/WGS 1984 Web Mercator (auxiliary sphere)')
In [5]: npai=list(enumerate(((-115.12799999956881, 36.11419999969922), (-117, 38.1141))))
In [6]: npai
Out[6]: [(0, (-115.12799999956881, 36.11419999969922)), (1, (-117, 38.1141))]
In [7]: npa=np.array(npai, np.dtype(([('idfield', np.int32), ('XY', np.float, 2)])))
In [8]: npa
Out[8]:
array([(0, [-115.12799999956881, 36.11419999969922]),
(1, [-117.0, 38.1141])],
dtype=[('idfield', '<i4'), ('XY', '<f8', (2,))])
In [9]: fcName = arcpy.CreateScratchName(workspace='in_memory', data_type='FeatureClass')
In [10]: arcpy.da.NumPyArrayToFeatureClass(npa, fcName, ['XY'], geosr)
In [11]: with arcpy.da.SearchCursor(fcName, 'SHAPE@XY', spatial_reference=tosr) as cur:
...: print list(cur)
...:
[((-12815990.336048, 4316346.515041453),), ((-13024380.422813002, 4595556.878958654),)]