AnsweredAssumed Answered

How to use where clause with NumPyArray to Feature?

Question asked by Geoffrey.West on Apr 6, 2015
Latest reply on Apr 7, 2015 by bixb0012

I have a NumPyArray that I would like to use a where clause .  My workflow is if my first NumPyArray to feature fails then run another one with a where clause of data that has come into a json web-service in the past 10 minutes.    I would ideally like to implement a where clause in both scenarios.  Here is what I have:

 

 

arr = np.array(items,dtype=dt)
sr = arcpy.SpatialReference(4326)
NumPyArray = arcpy.da.NumPyArrayToFeatureClass(arr, fc, ['longitudeshape', 'latitudeshape'], sr)
#I would like to use a five minute whereclause here for my Date field.

cursor = arcpy.SearchCursor(fc,"""Date BETWEEN '2014-02-16 16:53:25' AND  '2015-02-17 16:53:25'""" )
for row in cursor:
 print(row.getValue("Date"))




if row.getValue("Date") < datetime.datetime.now():
    print "true"
else:
       "excecute numpy array for a 10 minute window."

Outcomes