Select to view content in your preferred language

Arcpy Help needed!

600
3
05-15-2023 10:45 AM
VithushanLogan
Emerging Contributor

1. Create FGDB and Feature class by using arcpy
2. Export all featureclass into CSV
3. Migrating one featureclass to another feature by using arcpy
4. Field mapping by using arcpy
5. Export all features from feature class to excel using arcpy
6. Import excel sheet into point feature class
7. Export Domains and subtypes into excel sheet using arcpy
8. Copied the feature class into other FGDB using arcpy

Tags (2)
0 Kudos
3 Replies
Brian_Wilson
Honored Contributor

If you don't know where to start, try to build a model that does as much as possible of the process you want to use with arcpy and then use Export to Python and use that as your starting point.

Some of your items are just about impossible in Model Builder. Some are one step like #8. Start with the easy ones. Then add code from other people's examples.

Field mapping is a royal pain. Don't want to talk about it. Avoid. 🙂

How are your data science skills? Some things are easier and faster to do with the arcgis python API using Pandas dataframes. In this case the workflow becomes something like

1. Load the feature layer into a dataframe:   sdf = SpattialDataFrame.from_layer(featurelayer)

2. Write the dataframe as a spreadsheet:   sdf.to_excel("spreadsheet.xlsx")

 

VithushanLogan
Emerging Contributor

Thanks for your reply! and I am learning above mentioned points using ArcPy and other tools. If you don't mind can you suggest any meaningful resources related to this (Can be videos or website links etc)? 

0 Kudos
Brian_Wilson
Honored Contributor

I don't really have any favorites right now.

You could try searching through the dev summit proceedings, year by year, for example 2022 would be at https://devsummit2022.esri.com  Searching there for "arcpy" matched 6 sessions.

Search for 'arcpy' at https://www.esri.com/training/catalog/search/ Some of the videos there are also conference session recordings.  I just enrolled in their "ArcPy Learning Path", almost accidentally! I guess that commits me to learn more.

There are books on ArcPy but the ones I used are so old I can't recommend them. I can't vouch for any that show up on Amazon. I should probably look at a few of the new ones, to get new ideas.

Some of the books are from https://packtpub.com and the quality of their books varies a lot. You can get a 30 free trial subscription though or preview the books for 7 days to see if you think they are worth $. I think Safari (or whatever they call it now) had access to the Packt Pub catalog if you have that. I used to get it through a public library. Sigh. No longer have access to that.