markieta

Working with Numpy Arrays

Discussion created by markieta on Dec 26, 2012
Latest reply on Dec 27, 2012 by carlsunderman
I have a numpy array like so:

import numpy as np

np.array([('1', [[0.0, 0.0], [1.0, 0.0], [0.30901699437494745, 0.95105651629515353], [-0.80901699437494734, 0.58778525229247325], [-0.80901699437494756, -0.58778525229247303], [0.0, 0.0]]),
       ('2', [[0.0, 0.0], [-0.80901699437494756, -0.58778525229247303], [0.30901699437494723, -0.95105651629515364], [1.0, -2.4492935982947064e-16], [1.0, 0.0], [0.0, 0.0]])], 
       dtype=[('UniqueID', 'S4'), ('XY', '<f8', (6, 2))])


I want to convert this array into a feature class using the 10.1 arcpy.da.NumPyArrayToFeatureClass function. However, feeding this array into the arcpy function gives me two points at (0,0), representing the first coordinate pairs in UniqueID 1 and 2.

Any thoughts on what might be the problem? Each UniqueID relates to a tuple of coordinate pairs that should be connected to form a closed polygon (last point is the same as the first point).

Outcomes