|
POST
|
Version 3.x is highly unlikely. Its possible for a move to 2.7.3, but thats not for sure just yet. Thanks for the info, Kevin.
... View more
03-06-2013
07:15 AM
|
0
|
0
|
1030
|
|
POST
|
Anyone have the inside scoop on plans for Python in 10.2? Standing pat at 2.7 or taking the jump to 3.3? Seems like a good chance to catch up with the current release schedule since numpy and matplotlib both support 3.3. ArcGIS can't stagnate in Python 2 land forever, but I'm not sure what all would be involved behind the scenes, hopefully someone can give us a peek behind the curtain.
... View more
03-05-2013
07:40 AM
|
0
|
4
|
4036
|
|
POST
|
It is part of the geometry object and is definitely documented. http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000070000000
... View more
03-05-2013
06:19 AM
|
0
|
0
|
2365
|
|
POST
|
If you want to get as much information as possible about an output or variable you can use the following commands. type(variable)
repr(variable) Which shows the value returned by GetCount is an object. >>> result = arcpy.GetCount_management(fc)
>>> type(result)
<class 'arcpy.arcobjects.arcobjects.Result'>
>>> repr(result)
"<Result '60'>" Which you must then get the results property from. But we're still not done yet. >>> result = arcpy.GetCount_management(fc).getOutput(0)
>>> type(result)
<type 'unicode'>
>>> repr(result)
"u'60'"
The getOutput parameter returns a unicode string, not an int. But once we are here it is a simple step to convert it to a numeric value. >>> result = int(arcpy.GetCount_management(fc).getOutput(0))
>>> type(result)
<type 'int'>
>>> repr(result)
'60' Hope that helps.
... View more
03-05-2013
04:13 AM
|
0
|
0
|
2238
|
|
POST
|
Result is not an integer you can compare how you are. You need this. result = int(arcpy.GetCount_management(Variable1).getOutput(0)) Also don't forget to add this at the end of your script. del addRow
... View more
03-04-2013
01:39 PM
|
0
|
0
|
2238
|
|
POST
|
Does the empty table have the fields you are trying to populate?
... View more
03-04-2013
12:25 PM
|
0
|
0
|
2238
|
|
POST
|
Yes you are right of course, I was just speculating on possible scenarios where this wouldn't be a bug/error but it definitely seems like it is. I tested on a sample feature class over 65,535 rows of GUIDs and it is still assigned a type of SmallInteger which has to be a bug no matter what the field holds. Not sure if this helps your situation, but are you aware of the describe properties for GUIDs? desc.globalIDFieldName
desc.hasGlobalID
... View more
03-04-2013
10:54 AM
|
0
|
0
|
3038
|
|
POST
|
Yes but the string is registered with the geodatabase, it does not necessarily have to be the value stored in the field.
... View more
03-04-2013
10:04 AM
|
0
|
0
|
3038
|
|
POST
|
Edit: Sorry read GlobalID as OID. I'm not sure exactly how GUIDs work but I'm assuming the actual field value is just a reference to a value stored in the geodatabase, similar to a domain.
... View more
03-04-2013
09:12 AM
|
0
|
0
|
3038
|
|
POST
|
Could you use focal statistics with 5m map units and then just con to your 5m raster?
... View more
03-04-2013
07:58 AM
|
0
|
0
|
750
|
|
POST
|
This is the behaviour that troubles me because all correspondence between errors and the original script is lost, and that is a bad thing because it's very hard to count lines in your original script editor. Any solutions? Debug in your script editor and not ArcGIS?
... View more
03-04-2013
05:23 AM
|
0
|
0
|
2834
|
|
POST
|
This code works fine for me. import arcpy
def main(layer):
spatialdesc = arcpy.Describe(layer)
sr = spatialdesc.SpatialReference
newspatial = sr.Name
arcpy.AddMessage(newspatial)
if __name__ == '__main__':
layer = arcpy.GetParameterAsText(0)
main(layer)
The only other issue I can think of it being is something wonky with your 2.7 install and arcpy not playing nicely.
... View more
02-27-2013
01:02 PM
|
0
|
0
|
2987
|
|
POST
|
How are you passing this parameter to your tool? Object, string, something else? newlayer = arcpy.GetParameterAsText(0)
... View more
02-27-2013
12:30 PM
|
0
|
0
|
2987
|
|
POST
|
How are you generating the oldspatial variable? Can you print out all the names you are passing to your word writing function in the interpreter before you attempt to call the function?
... View more
02-27-2013
11:54 AM
|
0
|
0
|
2987
|
|
POST
|
You are getting an index error because you never reset your index back to 0 for the next row. This example should get you a little further. with arcpy.da.UpdateCursor(FC, fields) as rows: for row in rows: i = 0 while i < len(fields): #for field in fields: row = row[i + 1] i += 2 rows.updateRow(row)
... View more
02-27-2013
11:34 AM
|
0
|
0
|
1686
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|