Buffering Multiple feature classes in GDB (python)

9583
27
05-08-2015 07:55 AM
EthanHeidtman
New Contributor III

I am having trouble buffering multiple feature classes within a GDB. These feature classes were just created based on a select by attribute and copy features tool run.

I have attached a copy of my script. The buffer analysis begins at the bottom, I have tried various parameters and dont know the variable that will be my input features that are the selected krogers from each county.

Thanks a lot!

Tags (3)
0 Kudos
27 Replies
IanMurray
Frequent Contributor

I was channeling my inner Dan Patterson​ for this topic.  I tend to just answer questions, but as you are a fellow student, I figured this was a good learning opportunity and you'd get more out of it by getting advice and working out most of it yourself. 

I would like to reinforce the value of using model builder to design workflows convert them to python, then using python to augment it and make it much more valuable.  It becomes a much easier way to set-up scripts and saves the time looking up the proper syntax for many of the geoprocessing operations you are likely to use.

Glad you feel you have a better understanding now and good luck on your future work!

EthanHeidtman
New Contributor III

I will definitely look into model builder, we touched on it briefly in class. Sounds like it could be pretty useful for python scripting.

Got the buffer to work. Now I all I have to do is select those addresses within the buffer, pretty easy from here on out.

This was my first time seeking help on the internet, and it really HELPED.

So once again thank you all, I am now able to finish and graduate with my GIS certification lol.

0 Kudos
IanMurray
Frequent Contributor

I got a semester of grad school left then off to find a job for me.

0 Kudos
EthanHeidtman
New Contributor III

im going to be a GIS technician in Cincinnati, so I am sure I will be back

to ask more questions lol .

0 Kudos
DanPatterson_Retired
MVP Emeritus

Ian...next time you are channeling... remember the faculty tries hard to keep ahead of the students who are trying to keep ahead of the faculty.... I covered a few of the examples in several of my blog posts which might be useful for students

https://community.esri.com/blogs/dan_patterson/2015/02/20/lesson-5

https://community.esri.com/blogs/dan_patterson/2014/11/16/you-are-not-allowed-to-use-geoprocessing-r...

https://community.esri.com/blogs/dan_patterson/2014/11/13/you-are-not-allowed-to-use-modelbuilder-wh...

JeffWard
Occasional Contributor III

It looks to me like you are buffering your original feature class (fc).  Don't you want to buffer the selection that you copied into fc + "krogerselection" with your CopyFeatures call?

You could also skip the SelcectByAttributes call by adding your where clause to the MakeFeatureLayer call.

arcpy.MakeFeatureLayer_management(fc, fc_kroger, kroger_selection)
arcpy.Buffer_analysis(fc_kroger, fc + "Buff", "1 Mile")
Jeff Ward
Summit County, Utah
MatthewRusso
New Contributor II

put your buffer in the loop and clean go through your logic

0 Kudos
EthanHeidtman
New Contributor III

what do you mean "and clean go through your logic"Matthew Russo

0 Kudos