Has anyone else noticed that when using arcpy.da.TableToNumPyArray on a joined tabled that has a definition query the resultant imported table did not fully reflect the definitionQuery?
Could you provide an example of some of the results and the field types of the data?
Most da stuff doesn't respect layer definition queries from what I can tell. You can try passing the query to a SearchCursor:
from arcpy.da import SearchCursor from arcpy.mp import Layer lay = Layer() # Replace with actual layer from tool param or ListLayers with SearchCursor('joined_table', ['*'], where_clause=lay.definitionQuery) as cur: np_arr = cur._as_narray()
Note: If you want the full shape (assuming that you have a shape field), you'll need to explicitly pass SHAPE@ as one of the fields, e.g. ['OID@', 'SHAPE@', '*']. Would give you OID@ and SHAPE@ fields that have the ObjectID/FID and full row geometry.
SHAPE@
['OID@', 'SHAPE@', '*']
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.