Select to view content in your preferred language

arcgis.join_features returns "The number of features in <layer> is zero."

1396
2
04-09-2020 04:30 PM
JimLugosi
Occasional Contributor

Hey folks,

I have been banging my head on this for the past several days.  Here is my scenario, I would like to join our taxlot hosted feature layer with our assessors table.  Both data sets reside in our ArcGIS Managed DataStore (PostgreSQL).

Using Jupyter Notebook I am able to access both hosted feature layer and hosted feature table.  I verify the records by performing a simple query.  In addition, I am able to display each service graphically.

However, when I try to perform a simple table join (assessor table to taxlots) I receive the following error message:

{"messageCode": "AO_100032", "message": "The number of features in tax_genparcels is zero.", "params": {"analysisLayer": "tax_genparcels"}} {"messageCode": "AO_100215", "message": "JoinFeatures failed."} Failed to execute (JoinFeatures). Failed.

I don't get it.  I validated that parcels have features:

# Properties of a Feature Layer
feature_layer = taxlot_layer[0]

feature_results = feature_layer.query(where='objectid>0', return_count_only=True)
feature_results
158933

Below is the code I'm using to perform the join:

output = analysis.join_features(target_layer='<string_to_hosted_feature_layer>',
  join_layer='<string_to_hosted_table_layer>',
 spatial_relationship=None,
 spatial_relationship_distance=None,
 spatial_relationship_distance_units=None,
 attribute_relationship=[{"targetField":"maptaxlot","operator":"equal","joinField":"tlno"}],
 join_operation='JoinOneToOne',
 output_name='TaxlotAssessmentTest',
 context={"extent":{"xmin":-44785405.742,"ymin":18653826.208,"xmax":-44778081.523,"ymax":18660282.372,"spatialReference":{"wkid":102100,"latestWkid":3857},"outSR":{"wkid":102100}}},
 )

I have tried setting the spatial relationship to 'identicalto' and it still errors out.  Any help would be greatly appreciated.

Thanks and stay safe
0 Kudos
2 Replies
by Anonymous User
Not applicable

I'm having the same problem, but with the web map join feature. Did you ever figure it out?

0 Kudos
MYoung33
New Contributor

I was experiencing the same error running the "Summarize Within" tool and had no idea what the issue was. I realized I had one small polyline selected. I cleared the selection and ran the tool again, which finished successfully. I'm new to ArcGIS so I'm not sure if this is intended, perhaps you can also run this tool using the current selection to achieve various results. 

0 Kudos