|
POST
|
At some point, you'll also have to change your fields list to include strings, not unspecified variables: fields = ['Apple','Grape','Pear'] Also, you need to call the following to actually update the row: cursor.updateRow(row)
... View more
04-26-2017
02:57 PM
|
0
|
0
|
1663
|
|
POST
|
I don't think there is an easy way to do this with a definition query. The way you would think this would work would be something like: EXTRACT(DOW FROM CURRENT_TIMESTAMP) >= "FIRSTDAYOPEN" AND EXTRACT(DOW FROM CURRENT_TIMESTAMP) <= "LASTDAYOPEN" ...which relies on a column populated for first and last open (Monday = 1 and Friday = 5) and compares the current DOW (day of week) to those values. However, ArcGIS's flavour of SQL only supports YEAR, MONTH, DAY, HOUR, MINUTE, or SECOND (not DOW).
... View more
04-20-2017
02:33 PM
|
0
|
0
|
1954
|
|
POST
|
Also, once you get to it, the final line should be: GUCalcCursor.updateRow(subrow)
... View more
04-12-2017
03:31 PM
|
0
|
1
|
1796
|
|
POST
|
You can do this with an annotation feature class, using the ESRI North font. What is annotation?—Help | ArcGIS Desktop Aligned to north. Top is annotation, bottom is static text element (text is north font equivalent of "Text"). Reprojected, so north is no longer straight up. Note annotation rotates to point to original north.
... View more
04-12-2017
03:27 PM
|
1
|
1
|
2317
|
|
POST
|
Dan's solution is correct, and what I use myself, but I just want to point out that degrees, whether lat/long or the same old degrees you remember from sixth grade math class (e.g. the angle in a wedge-shaped object) they are the same thing. The formula to convert radians to degrees, no matter what language you write, is: radians * 180/pi
... View more
04-12-2017
02:59 PM
|
3
|
1
|
3730
|
|
POST
|
Quick and dirty, you can compare Extent objects returned by Describe. More detailed, you'd have to run an intersect or selection and check if it returned anything. Of course, the easy answer is to find the grid layer and use that.
... View more
04-11-2017
04:03 PM
|
0
|
0
|
525
|
|
POST
|
Use the += operator to accumulate values: >>> input_list = [3,5,2,3]
... output_list = []
... value = 0
... for i in my_list: # do similar inside your cursor
... value += i # same as value = value + i
... output_list.append(value)
... print output_list
...
[3, 8, 10, 13]
... View more
03-31-2017
01:22 PM
|
1
|
1
|
2543
|
|
POST
|
Do you mean how to do something like (raster1/raster2)/raster3? See help here. You just turn them into raster objects and divide: outRaster = (Raster(raster1)/Raster(raster2))/Raster(raster3)
... View more
03-31-2017
01:09 PM
|
1
|
2
|
1187
|
|
POST
|
You need to store the value in a variable, and use that variable name as the expression: Expression: result Code block: If [GRIDCODE] = 0 Then
result = "Não há diferença"
ELSEIF [GRIDCODE] = 1 Then
result = "Área de uso consolidado cadastrada como nativa"
ELSEIF [GRIDCODE] = 2 Then
result = "Área de vegetação nativa cadastrada como uso consolidado"
End If Note: you should always return something with an ELSE.
... View more
03-20-2017
08:49 AM
|
1
|
1
|
1810
|
|
POST
|
You can just update the geometry within an UpdateCursor.
... View more
03-14-2017
01:05 PM
|
0
|
0
|
3323
|
|
POST
|
It's hard to tell where your indentation is, but I think you need to indent the line where you create the polygon object by one level (i.e. make one polygon for each row in your cursor). Add that polygon to a new array, and write that with CopyFeatures. Are you trying to make the same number of multipart features you had originally, or one huge multipart feature containing all parts?
... View more
03-14-2017
11:46 AM
|
1
|
1
|
3323
|
|
POST
|
Technically, you could just convert your raster to polygon and use that as the clip shape, however, you'll get one polygon per separate pixel value blob (connected pixels with same value), so it could get quite complicated. A more reasonable method would be to Create Constant Raster, with exactly same cell size, snap raster, processing extent, and coordinate reference system as the DEM. This will make one rectangular pixel value blob exactly the size of your DEM. Then, convert the constant raster to polygon.
... View more
03-13-2017
04:00 PM
|
1
|
0
|
1132
|
|
POST
|
I suppose you'd want something like this. I'm not exactly sure how blank parameters are passed back through GetParameterAsText(): if Roads <> '': # if Roads isn't blank
arcpy.Buffer_analysis(Roads,...) # run buffer on Roads You could also wrap your tool calls in try/except blocks. If the tool can't be run because the parameters are invalid within the try block, it will quietly move on to the except block: try:
arcpy.Buffer_analysis(Roads,...) # try to run buffer
except:
pass # if buffer can't complete, do nothing and move on
... View more
03-13-2017
01:43 PM
|
0
|
1
|
7291
|
|
POST
|
You'll have to shuffle around the logic a bit to test which parameters have a value and only call the appropriate tools. For example, if Roads is blank, then don't run Buffer on Roads. If Tracts is blank, then don't run the Clip.
... View more
03-13-2017
01:27 PM
|
0
|
0
|
7291
|
|
POST
|
You're not providing default values for the blank parameters, you're just setting them back to the original blank value.
... View more
03-13-2017
01:19 PM
|
0
|
0
|
7291
|
| 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
|