In my experience, ArcPy seems to perform better with selecting features from very large feature services, compared to making feature queries via the ArcGIS API. With that, I have a script that performs a series of ArcPy feature selections using feature layer URLs and an area of interest feature class, like this:
selection = arcpy.SelectLayerByLocation_management(fl_url, overlap_type="INTERSECT", select_features=aoi_fc)
Problem is, I want to perform these selections using services hosted in an ArcGIS Online Organization that differs from my Licensing Portal Organization. I have an ArcGIS Online account with the desired organization, so I'm able to establish a connection via the ArcGIS API, but ArcPy access seems to be tied to a user's ArcGIS Pro license, not the API connection. Is there a way I can use ArcPy to select features from a service not housed within my Licensing Portal's Organization?
Solved! Go to Solution.
Possibly SignInToPortal—ArcGIS Pro | Documentation which then sets it to the active portal (which allows the content to be used). You may have to first use it to reference your named user license portal, then again to the other org's portal. This is not from experience and just a shot in the dark.
Possibly SignInToPortal—ArcGIS Pro | Documentation which then sets it to the active portal (which allows the content to be used). You may have to first use it to reference your named user license portal, then again to the other org's portal. This is not from experience and just a shot in the dark.
Ahhh, that did it! Thanks!