New answers tagged

1

First, use a da cursor to make your code 10 times faster. Replace the list with a dictionary where the keys are the streetnames and the value is the sum of all lengths. Then you can write it all back in a single pass of an update cursor. At the same time you can get the OID list and do a single SelectLayerbyAttribute to Copy all the features at once to ...


0

The problem is that you aren't iterating over RoadList: you're essentially doing this each time: >>> "OID = " + str([1,2,3,4]) 'OID = [1, 2, 3, 4]' To change this, you could use a for loop instead: for road in RoadList: query = "STREETNAME = '{}'".format(road) As an alternative approach, there is a GP tool that does this for you very simply: ...


0

Couldn't you just chain 3 functions in your model? Have each function create one of the rasters you want. To my knowledge there isn't a way to make a Con tool create multiple outputs.


0

If you want to use model builder probably the simplest approach would be to expose some of your inputs as parameters and turn your whole model into a tool. If it were me: I would expose the the whereclause of a select by attribute tool which allows you to enter the code for a county. Apply this selection process on feature class A and B. You now have two ...


0

If you are going to repeat this 1,000 times in ModelBuilder you will need to be using an Iterator. The Iterator to investigate will be For which: Iterates over a starting and ending value by a given value. It works exactly like For in any scripting/programming language, executing through a set number of items. However, I think you will find this ...



Top 50 recent answers are included