|
POST
|
I don't know about the answer to your question, but I will caution you that cropping anything from Google Maps and serving yourself is almost definitely against their terms of service. You are much safer using their services than hacking something together.
... View more
06-22-2015
10:46 AM
|
2
|
0
|
1901
|
|
POST
|
What exactly does the syntax error say? AFAIK, by the time updateRow is called, it shouldn't care that the value was obtained from a function. edit: I'll add that the following works perfectly fine, indicating that there is something else wrong with your script (possibly wrong data type?). Also, you should either use 'del cursor' or, better, "with arcpy.da.UpdateCursor" to ensure your cursor is deleted. >>> myVal = 10
... def myFunc(val):
... return val + 1
... cursor = arcpy.da.UpdateCursor("points","Id")
... for row in cursor:
... row[0] = myFunc(myVal)
... cursor.updateRow(row)
... View more
06-22-2015
10:25 AM
|
1
|
1
|
3611
|
|
POST
|
Do you mean you want to loop through names, rather than numbers? If so, you can iterate through a list: >>> list = ['Bob','Dave','Henry']
... for name in list:
... print name
Bob
Dave
Henry ...or a dictionary: >>> dict = {1:'a', 2:'b', 3:'c'}
... for item in dict:
... print item
... print dict[item]
...
1
a
2
b
3
c ...or a tuple: >>> tuple = (1, 2, 3)
... for item in tuple:
... print item
...
1
2
3 You can loop through unexpected things, too: >>> string = "Hello"
... for letter in string:
... print letter
...
H
e
l
l
o
... View more
06-18-2015
12:54 PM
|
2
|
2
|
2440
|
|
POST
|
Have you already started drawing? If not, I've found it easier to start with a large polygon covering your entire area, and cutting it into smaller contiguous pieces than to draw new polygons. Aside from that, you may be interested in topology editing.
... View more
06-17-2015
01:16 PM
|
2
|
1
|
4596
|
|
POST
|
This points to a string 'attFolder': arcpy.env.workspace = 'attFolder' but you want the variable attfolder: arcpy.env.workspace = attFolder
... View more
06-16-2015
02:26 PM
|
1
|
4
|
7401
|
|
POST
|
You can place everything in a loop, counting from 1 - 5. Then, it's a matter of substituting the value into your expressions. This is untested, and I almost promise I got something wrong, but it should be a start: # Calculate Region
for i in range(1,6):
# Set local variables
inTable = nodeFeatures
inField = "Region" + i
expression = "Reclass (!NodeID" + i +"!, !Region" + i + "!)"
codeBlock = """def Reclass (NodeID" + i + ", Region" + i + "):
if NodeID" + i + "!= None:
return region #variable is declared earlier in the script
else:
return None"""
# Execute CalculateField
arcpy.CalculateField_management(inTable, inField, expression, "PYTHON_9.3", codeBlock)
... View more
06-16-2015
01:42 PM
|
2
|
5
|
2440
|
|
POST
|
Since these are all constants, not variables from your table, you may as well just type in the number. Also, you do not have enough mathematical operators in the first part of the equation. (6.5 minus -0.6) ______ 2 times 0.5
... View more
06-15-2015
03:13 PM
|
0
|
4
|
3777
|
|
POST
|
From the beginning, this equation has been missing an operator before the 2 in: (((6.5-(-0.6))2*1.5))
... View more
06-15-2015
03:01 PM
|
1
|
1
|
3777
|
|
POST
|
No, this still isn't in language I, or the field calculator, will understand. The field calculator works like: for each row in the attribute table, take some value(s) in another column(s), manipulate it somehow, and return some new value into the calculated column for that row. Is "phw" the name of the column we are getting values from or calculating to? What does your notation phw[0,6.24] mean - something like if phw is between 0 and 6.24, apply this part of the formula?
... View more
06-15-2015
02:53 PM
|
1
|
1
|
6678
|
|
POST
|
This doesn't appear to be either VB Script or Python, your only two options in the field calculator. As I'm not familiar with your subject matter whatsoever, can you please explain, in words, what that formula is supposed to do?
... View more
06-15-2015
02:42 PM
|
1
|
3
|
6678
|
|
POST
|
^ the image doesn't seem to work. Just copy/paste the expression into your post.
... View more
06-15-2015
02:30 PM
|
0
|
10
|
6678
|
|
POST
|
Check the help for InsertCursor. You don't generally (ever?) use it with 'with', which is tricky, because you do so with SearchCursors and UpdateCursors.
... View more
06-15-2015
09:44 AM
|
2
|
1
|
2596
|
|
POST
|
Since you've already made a list of tables (the input tables argument for Append can be a list), you can use that in Append. No loop required. tables = arcpy.ListTables("res*")
res_summ = os.path.join(output_workspace, str("res_summ"))
arcpy.Append_management(tables, res_summ, "NO_TEST", "", "")
... View more
06-15-2015
09:33 AM
|
1
|
0
|
3384
|
|
POST
|
The first argument is a raster, not a condition. You can use a where clause as the third parameter, though. SetNull("cov_fdg_ct","cov_fdg_ct","Value <=0")
... View more
06-12-2015
06:24 PM
|
1
|
3
|
5380
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|