Select to view content in your preferred language

Pulling feature layer into python (Jupyter notebook) and manipulating

300
1
05-24-2024 10:56 AM
Labels (3)
Jades1
by
New Contributor III

Hi all,

The one course I audited on ArcGIS incorporated AGOL with python. Because of personal health information and HIPPA, I need to do a lot of the network analysis from ArcGIS Pro. I work for UC San Diego Health, so we have the licenses for Network Analyst, etc. I work primarily from Python/Jupyter notebook and have found AGOL to be more accommodating to that workflow (unless I'm missing something). 

My code works, and I get the resulting feature layers and can map them; however, I can't seem to find a way pull them into Jupyter to then manipulate these feature layers, convert to SEDFs and ultimately convert to work with in pandas.

For instance, when I use the ListFeatureClasses command, I can view the feature layers and can use Describe to see that it is a feature layer; however, when I try to convert it to an SDF, it seems that I am merely dealing with a string (that is pointing to the feature layer.

This is both a call for help with that specific issue as well as further resources people have with incorporating python and ArcGIS Pro. I'm reading through the book "Python Scripting for ArcGIS Pro" but to be honest, I find it a bit long-winded and hard to find specific information and lacking on examples. Not sure if there are better resources out there. A lot I find with ESRI info points to solving these issues with the ArcGIS API.

Thanks for the help!

James

0 Kudos
1 Reply
Brian_Wilson
Regular Contributor II

(In my mind's eye I see the arcpy people are not just down the hall from the arcgis api people, they are in different time zones and never talk to each other.)

I found it extremely easy to load data from Portal into a SEDF using the ArcGIS API and the tools available then are great for data manipulation (but you know that already if you want to use Pandas).

I don't believe there is ANY support for SEDF through ArcPy. They install Pandas as part of ArcPy but you are on your own there. The ArcPy people are probably afraid they'd all be out of work if people embraced Pandas. (or GeoPandas) They'd have to go do web pages for Google at 3x the pay! Ugh!

You can mix them together, you can publish data to a feature service that's in Portal, update the data in ArcPy and Network Analyst, then load the new data into a SEDF using ArcGIS. Then it's in a dataframe and all the Pandas tools work on it.

Learning Pandas was the hardest part for me but once I got over the initial grief, I heard the angels sing. It sounds like you are already at that stage though. If you can understand Pandas, then the rest is not that hard.

 

0 Kudos