|
POST
|
pythonaddins.GPToolDialog: http://resources.arcgis.com/en/help/main/10.1/index.html#//014p00000021000000
... View more
05-08-2014
05:21 PM
|
0
|
0
|
442
|
|
POST
|
The wall reference is all of them, pulled directly from the help. Any other objects you'd run into in arcpy at runtime are either imported from other Python modules or for private use. The help is the gold standard for understanding what's in arcpy.
... View more
05-07-2014
12:38 PM
|
0
|
0
|
418
|
|
POST
|
You could either do a Spatial Join on a specified search radius distance, or more destructively, use the Snap tool to move the points to the polylines.
... View more
05-01-2014
01:52 PM
|
0
|
0
|
937
|
|
POST
|
The .next() method raises an error by design: it follows to the letter the Python Iterator Protocol, which requires the .next() method on an object to raise a StopIteration exception when it is exhausted. I very strongly recommend you refactor your script to read as such instead (using itertools😞 import itertools import arcpy fc = "C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcGlobeData\continent.shp" fields = ["CONTINENT"] where = "CONTINENT = 'Asia'" with arcpy.da.SearchCursor(fc, fields, where) as cursor: for row in itertools.islice(cursor, 5): print row
... View more
04-30-2014
04:44 PM
|
0
|
0
|
2260
|
|
POST
|
This sounds like the job for a geoprocessing tool. You could just associate the button's onClick with a GPToolDialog call.
... View more
04-28-2014
02:18 PM
|
0
|
0
|
622
|
|
POST
|
GPBoolean is indeed the correct data type to use. Did you remember to add the boolean parameter object to the list returned in getParameters?
... View more
04-24-2014
11:09 AM
|
0
|
0
|
2788
|
|
POST
|
You'd probably get a faster/better response to general Python questions like this on a dedicated forum like Stack Overflow.
... View more
04-23-2014
04:08 PM
|
0
|
0
|
1129
|
|
POST
|
From inside a validator __file__ will be set to the full path of the TBX file (plus some extra information, it'll look like C:\pth\to\mytools.tbx#MyScriptTool.updateParameters). There isn't a way to get to the path of the script tool it wraps, though.
... View more
04-12-2014
01:25 PM
|
0
|
0
|
1594
|
|
POST
|
Ah, yes, because the output of the ApplySymbologyFromLayer tool is a layer it adds it to the TOC once it's executed, then you were manually adding it again.
... View more
04-03-2014
07:57 AM
|
0
|
0
|
1133
|
|
POST
|
You can't change a parameter's datatype, period. What you want to accomplish is best done by having two parameters, one a SQL Expression and one a String, and enabling/disabling one or the other in the validation code based on the first parameter's value.
... View more
04-02-2014
02:09 PM
|
0
|
0
|
922
|
|
POST
|
Also, arcpy geometry objects have the __geo_interface__ attribute which does GeoJSON in most cases. It was unreliable with Polygons with rings until 10.2.1.
... View more
04-01-2014
03:58 PM
|
0
|
0
|
9155
|
|
POST
|
The Python list reflects the state of an underlying list on a C++ object at the time it was requested. It does not alter the state of that C++ list when you manipulate the Python list, the filter.list setter implementation does.
... View more
04-01-2014
03:55 PM
|
0
|
0
|
1594
|
|
POST
|
Each time you request filter.list, it gives you a new copy of the list. You need to do this: self.params[0].filter.list = ['fee'] self.params[0].filter.list += ['foo'] or self.params[0].filter.list = ['fee'] fl = self.params[0].filter.list = ['fee'] fl += ['foo'] self.params[0].filter.list = fl
... View more
03-31-2014
02:51 PM
|
0
|
0
|
1594
|
|
POST
|
The AsShape() takes exactly 1 argument (2 given) and AttributeError: 'PointGeometry' object has no attribute 'JSON' errors imply that you're on an version of ArcGIS before the JSON stuff was added. I thought I got all of that in at 10.1 SP1, maybe your install is messed up? Try replacing geometries.py and arcobjects.py in arcpy from a fresh install of 10.1 SP1 and see if that helps. You can try the esri2open toolbox or the geojson-madness toolbox and see if either of those work for you. If you're willing to experiment in the browser or on your local computer with node.js then Terraformer is also an option. If you go the geojson-madness route, there are two simple functions you could lift for your own purposes. One will reliably convert an arcpy geometry into GeoJSON and the other will turn GeoJSON into an arcpy geometry (via WKT).
... View more
03-31-2014
07:42 AM
|
0
|
0
|
9155
|
|
POST
|
We did a Blog post on this some time ago. Are you only accessing a single column? In your example, that appears to be the case. If you know you're just grabbing a certain set of column values, you can specify them when you open the cursor and then you know what index they'll be at. So you'd be best off doing this:
with arcpy.da.SearchCursor(fc, 'SITE_ID') as cur:
for row in rows:
print row[0] or
with arcpy.da.SearchCursor(fc, ['SITE_ID', 'OTHER_FIELD']) as cur:
for row in rows:
print row[0], row[1] etc.
... View more
03-27-2014
12:56 PM
|
0
|
0
|
1269
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-26-2012 02:46 AM | |
| 2 | 01-06-2011 08:22 AM | |
| 1 | 03-25-2014 12:18 PM | |
| 1 | 08-12-2014 09:36 AM | |
| 1 | 03-31-2010 08:56 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|