0

I would like to write a script in Python which takes data and does some things with it.

So far, I have written the following code :

import arcpy
arcpy.env.workspace = "C:\wody.gdb"
arcpy.env.overwriteOutput = True
fcList = arcpy.ListFeatureClasses()
bufferList = []
for fc in fcList:
 if fc == "RZEKI":
 arcpy.Buffer_analysis(fc, fc + "Buffer", "200 meters")
 bufferList.append(fc + "Buffer")

Now, I would like to take RIVERS (RZEKI) only if river is longer than SOMETHING (they do not give data in meters but in units, so I just want to see an example seems like river_long > WHATEVER)

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jan 24, 2013 at 22:53
0

1 Answer 1

6

This is a pretty basic Select By Attribute query. I would suggest reading up on the documentation.

This is taken right from the example in the online help:

# Within selected features, further select only those cities which have a population > 10,000 
arcpy.SelectLayerByAttribute_management("lyr", "SUBSET_SELECTION", ' "population" > 10000 ')

As far as calculating length, the help article A quick tour of Python will give you the code to calculate the length of the feature in the source units of the layer. Take a look at:

!shape.length!
answered Jan 25, 2013 at 0:24

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.