POST
|
Hi Everyone, I am trying to write a query that selects by attribute, looping through different files, but have run into a snag because the variable is numeric and I wish to select values less than that number. If I convert the number to string, it is not a valid query. Code below: while row: FromVar = str(row.Fromage) Fromcommand = "'" + "FROMAGE" + "<" + "FromVar" + "'" print Fromcommand row = rows.next() arcpy.SelectLayerByAttribute_management("Multipoint Yellowstone plus a little Shatsky", "SUBSET_SELECTION", Fromcommand)
... View more
04-18-2017
09:45 PM
|
0
|
1
|
888
|
BLOG
|
Hi Richard, Thanks for posting this tool. I am using it, and I am able to use it easily on a on-time basis but when I try to use it in a python loop I am having trouble. My loop works (calling variables from a list) as I have used it on various other tools. I Receive an error: " Runtime error Traceback (most recent call last): File "<string>", line 9, in <module> File "Y:\Desktop\ARCGIS\Toolboxes\ConcaveHullByCase\ConcaveHullByCase.tbx", line 82, in ConcaveHull Z17xTbqLuWUQybYfJO0bSqn5JMZYbcN3yTjgg05tS0LTUVdnpln4gm8Hauuo2W6SymYfaLYg4cH+ ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Points: Dataset "Amsterdam.shp" does not exist or is not supported Failed to execute (ConcaveHull). I have changed the script to remove the .shp. extension and have the same result. I have run the tool on the shape file in arc, without a script and it works fine. I am running my loop script by copying it into a python window in arc, and executing it there, with all of the relevant shape files open in the workspace.... I have many datasets on which I am trying to run your tool and the loop would make things easy.... Thanks Michael Hi Richard, Thanks for your reply. I worked it out this morning - In previous uses of my Loop with other toolboxes, the way to call the variable was slightly different, and I had not made that change so it works fine now. The previous use (select data) was ' plume = "NAME = '" + var + "'" but to loop your file I just needed 'plume = var' so the resulting call line was: arcpy.ImportToolbox("Y:\Desktop\ARCGIS\Toolboxes\ConcaveHullByCase\ConcaveHullByCase.tbx") list = ['Amsterdam', 'Bowie']; for var in list: plume = var outpath = outpathbase + var + 'Conc' arcpy.ConcaveHull(plume,"10",outpath,"#","#") my full list has 81 variables, and I need to run this on several different datasets, and then repeat several times so your script has saved me a huge amount of time....... Thanks..
... View more
12-22-2016
11:59 AM
|
0
|
0
|
4851
|
POST
|
I am using the 'ConcaveHull' custom toolbox, and it works when I run it on an individual shape file but I am trying to run it in a loop, that references a list. I have run the loop with other tools and the loop works, and I have ensured that the name and label of the toolbox are identical in order to remove that confusion. I am receiving an error: Failed to execute. Parameters are not valid. ERROR 000732: Input Points: Dataset "Bowie.shp" does not exist or is not supported Failed to execute (ConcaveHull). I have tried running the loop without the '.shp' extension but that makes no difference. Here is my code: outpathbase = "Y:/Desktop/ARCGIS/Muller_etal_2016_AREPS/Muller_etal_AREPS_Supplement/MFCat2/Collide_Notpython/ConcaveHull/" arcpy.ImportToolbox("Y:\Desktop\ARCGIS\Toolboxes\ConcaveHullByCase\ConcaveHullByCase.tbx") list = ['Amsterdam', 'Bowie']; for var in list: print var plume = '"' + var + '.shp' + '"' print plume outpath = '"' + outpathbase + var + 'Concave2' +'"' arcpy.ConcaveHull(plume,"10",outpath,"#","#") print outpath print "complete" Also, here is the link to the Toolbox written by Richard Fairhurst: ConcaveHullByCase.zip Thanks! Michael
... View more
12-22-2016
11:46 AM
|
0
|
1
|
1106
|
POST
|
Thanks Jake, it turned out to be just one step that made all the difference. After completing an action once, I just went to pull-down list of: geoprocessing\results and then right-click on the process that I had just completed, and copied as python script, then pasted that command line into a python script that I had written to batch process layers. Given that I had seven different steps using 40 layers, with some steps seeking intersections between layers, this saved me a few days work.
... View more
03-03-2016
11:07 PM
|
1
|
0
|
289
|
POST
|
Hi, I am a python user to the level of having completed a few courses but have not yet taken the step of using it with an actual program. Can anyone recommend a site where I could learn the steps required to use python with arc?
... View more
12-01-2014
08:19 AM
|
0
|
2
|
4099
|
Title | Kudos | Posted |
---|---|---|
1 | 03-03-2016 11:07 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|