|
POST
|
What is on line 9192 of C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py?
... View more
11-02-2010
02:19 PM
|
0
|
0
|
2883
|
|
POST
|
"I saw it on the internet, so it must be true!" - 99.9% of internet users
... View more
11-02-2010
01:45 PM
|
0
|
0
|
1449
|
|
POST
|
Does it work when you do it manually? There seems to be a lot of bugs in v10 SP0, so it wouldn't suprise me if was ArcGIS itself. Per the error and warning, are there "invalid" values? Are you sure DefaultSdeGDB points to a .sde file, and are you sure that .sde file exists?
... View more
11-02-2010
01:18 PM
|
0
|
0
|
2883
|
|
POST
|
Or even: if int(gp.GetCount_management(featureLayer).getoutput(0)) > 0:
do this
else:
do that Sometimes it's usefull to compare the selection count with the total count:
if int(gp.GetCount_management(gp.describe(featureLayer).catalogpath).getoutput(0)) > int(gp.GetCount_management(featureLayer).getoutput(0)):
do this
else:
do that And then its sometimes usefull to get the OBJECTIDs of the selected features (BTW there has to be a selection in the featurelayer not just a SQL definition): selectedOidList = [int(oid) for oid in gp.describe(featureLayer).fidset.split(";")]
... View more
11-02-2010
11:43 AM
|
0
|
0
|
556
|
|
POST
|
Also: Here's the object model cheat sheet for the geoprocessing methods like gp.listfields() or gp.describe() - not for the tools though like gp.Clip_managment(). The help has more details, but it's nice to just have a single page reference. http://webhelp.esri.com/arcgisdesktop/9.3/pdf/Geoprocessor_93.pdf Too bad ESRI didn't (yet!) make one of these bad boys for v10...
... View more
11-02-2010
11:22 AM
|
0
|
0
|
2707
|
|
POST
|
I usually debug my scripts in PythonWin using hardcoded gp.getparameterastext() values. For example: ##inputFC = gp.GetParameterAsText(0) inputFC = r"C:\temp\test.shp" Once it's working well I "un-hard code" the parameters and attach it to a toolbox.
... View more
11-02-2010
10:30 AM
|
0
|
0
|
2707
|
|
POST
|
It would probably take less time and be more useful in the long run to learn the basics of Python scripting. You've already got the code, so read some of the tutorials and the ArcGIS Help to learn how to tidy it up and even turn it into a script tool (usable from ArcToolbox and in ModelBuilder) if you so desired. I second Logan's advice. The sooner you ditch MB, the better. You will be glad you did! The grass is much greener on the other side...
... View more
11-02-2010
10:20 AM
|
0
|
0
|
894
|
|
POST
|
Sorry, but as far as I know there is no "Python Script to Model Builder" utility. Also, I think you mean Model Builder as apposed to AML (Arc Macro Language), which is the good ole' (and personally still loved) scripting language for ArcInfo Workstation command line, right?
... View more
11-02-2010
09:55 AM
|
0
|
0
|
894
|
|
POST
|
Another possibility I have been trying to mess with a bit (with no success BTW): Use the Telnet (or similar) protocol to in effect run commands on a different box... Seems like most of the Python commands for this sort of thing were written for Unix platforms, but they say they are supported on Windows too. Hmm... Anyone ever try to do this (Telnet, SSH, or use the "host" parameter with the subproccess module)? The potential is pretty cool. You could write "grid computing" geoprocessing scripts.
... View more
11-02-2010
09:43 AM
|
0
|
0
|
1895
|
|
POST
|
@ R.D.: Ya, that's pretty much how I do my debugging too in PythonWin. Kind of a pain! In that way, I have a love/hate with PythonWin... @Niklas:I will check that out... I actually have used emacs for (Unix) AML quite a while back! So there is a Python interpreter "built in" then?
... View more
11-02-2010
09:35 AM
|
0
|
0
|
3973
|
|
POST
|
As of right now, this post (the 33rd) is a bit of a milestone in that there is now more "banter" about the poll than actual votes! I should have made a sensational commercial with menacing music, slight half truths, scowling faces, and edited soundbites. That would have rile up the electorate for sure. For those that voted and commented (either way) - Thank You. Really, I see two general types of questions being put on a potential "Python" forum topic: 1) I know little to nothing about Python: How do I accomplish task x? 2) I know some Python and I need help with a syntax. Here's my code, what am I doing wrong? In my opinion, I see these questions as very separate from the other topics that they might also concern. For example, a question about the correct Python syntax for the SingleOutputMapAlgebra tool. Yes, of course the question concerns a Spatial Analyst function, but has a clear Python focus. Therefore it belongs in a Python forum. I agree with Dan on one thing: I too would like to see the "ArcGIS Desktop - General" forum killed. Just an observation, but the quality of the answers I see there sometimes leave a lot to be desired. I believe one of the issues is that a "General" forum is that it is simply not engaging to "power users" that have the experience/knowledge to offer quality responses. There is no "focus" there, and therefore offers little to interest many of us that relatively few (but good) specific areas of expertise. There are a ton of questions that clearly fit into one of the "Function" forum topics... Why aren't people putting them there? I see three big reasons: 1) They don't know about the Function topic forums (maybe a "sticky" would be helpful to redirect traffic?) 2) The ArcGIS Desktop - General forum is at the top of the Forum page, and is the 1st forum topic that "sounds like it would work". 3) There is a lot of thread volume in the General forum. As I have noted here, many people want to draw the link between thread volume and higher volume of (assuming correct/quality) responses, although I don't see that as the case at all - in fact quite the opposite! An interesting stat to consider is a forum's post/thread ratio. It could be interpreted in different ways, but as I see it, the larger the number the more interest/replies to a thread. It's illustrative to note that: - General forum (11392 / 3768 = ~3.02) - Geoprocessing Forum (3306 / 971) = ~ 3.4 The Geoprocessing forum (a more focused topic) clearly has more replies per thread (a bit more than 10% actually which is seemingly small, but significant I think). Assuming in a focused forum topic, more replies = better replies. To Jim: It is fitting that today being election day that maybe a decision could be made at the end of the week per the proposed Python forum. Seems like, sadly, it won't take long to tally the votes on this one.
... View more
11-02-2010
09:14 AM
|
0
|
0
|
1449
|
|
POST
|
The v10 arcpy "site-package" and associated functionality is not backwards compatible. There is no "hack" as the code/functionality in arcpy simply does not exist in the v9.3 libraries. Generally however, the v9.x gp object created with these three different methods IS forward compatible: gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1") #valid for v9.0, v9.1, v9.2, v9.3, and v10.0 gp = arcgisscripting.create() #valid for v9.2, v9.3, and v10.0 gp = arcgisscripting.create(9.3) #valid for v9.3 and v10.0
... View more
11-01-2010
04:02 PM
|
0
|
0
|
1895
|
|
POST
|
Haven't tried it, but maybe 'Esc'? Seems like this would be a pretty critical item to include...
... View more
11-01-2010
02:26 PM
|
0
|
0
|
2277
|
|
POST
|
Wouldn't the standard "Identity" tool do what you need?
... View more
11-01-2010
01:47 PM
|
0
|
0
|
1080
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-25-2014 12:57 PM | |
| 1 | 08-29-2024 08:23 AM | |
| 1 | 08-29-2024 08:21 AM | |
| 1 | 02-13-2012 09:06 AM | |
| 2 | 10-05-2010 07:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-30-2024
12:25 AM
|