|
POST
|
Blake T, sorry to harp on this, but I'm not seeing the reference to the update cursor returning rows as a tuple. There are a few places that may take a tuple as input (e.g. fields), and outputs some properties as tuples (e.g. SHAPE@XY), but not rows. Perhaps you're thinking of the tuple row returned by next(), but this is hardly ever used anymore.
... View more
03-17-2015
09:42 AM
|
0
|
2
|
5173
|
|
POST
|
Just a small note that update cursors return rows in a list not tuple (search cursors return rows in a tuple), so you can skip that step.
... View more
03-16-2015
06:19 PM
|
1
|
4
|
5173
|
|
POST
|
Agreed, mostly. What's this about spaces? AFAIK, they are irrelevant.
... View more
03-16-2015
11:49 AM
|
1
|
0
|
2726
|
|
POST
|
There are lots of arcpy examples using Con here - scroll to the bottom.
... View more
03-16-2015
11:08 AM
|
1
|
7
|
2726
|
|
POST
|
Is your colleague editing in a data frame with a different coordinate system than the data? See here for how this can cause alignment issues.
... View more
03-16-2015
09:46 AM
|
0
|
0
|
1208
|
|
POST
|
What exactly are you trying to achieve? Eliminate the overlaps?
... View more
03-16-2015
09:36 AM
|
0
|
0
|
1538
|
|
POST
|
This discussion is so unnecessarily long. Hardcoded values are directly written in the code, rather than obtained from user input or existing data.
... View more
03-16-2015
09:30 AM
|
1
|
0
|
6791
|
|
POST
|
Or (lazy answer), replace the value to 91 - then you're guaranteed to include the maximum value of 90 degrees regardless of the actual maximum data value.
... View more
03-16-2015
09:18 AM
|
2
|
2
|
2047
|
|
POST
|
You could use the Con tool (see this page for relevant examples): Con(("rclslope">=45)&("rclmosaic">=2000)&("rclfocal">15),1) This returns a raster with pixel value = 1 which meets the criteria. If you're looking for a way to spatially query pixel values in ArcGIS, that doesn't exist to my knowledge.
... View more
03-16-2015
08:47 AM
|
2
|
9
|
2726
|
|
POST
|
I'm not sure of an arcpy method to list lyrs, but you can do so with os.listdir(). Then, loop through the list, creating a where clause. Finally, Select tool using where clause to extract matching points.
... View more
03-14-2015
09:03 AM
|
1
|
6
|
3834
|
|
POST
|
In your first script, the line should be: if field.name == 'total_length' and field.type == 'String': There are other logic issues in the first script, too. For example, it is only looking for one field, but does the operation once per field per row.
... View more
03-13-2015
11:47 AM
|
0
|
2
|
5173
|
|
DOC
|
This is great, and potentially has uses outside city planning (wildlife habitat suitability comes to mind, although you'd rarely have enough detections to make it work). The only thing throwing me off is the use of the term "suitability" for the input, when for me the output is "suitability". The input is more like "known occurrences" or similar. Of course, I may be interpreting this backwards. Thanks for sharing.
... View more
03-13-2015
09:53 AM
|
1
|
0
|
1749
|
|
POST
|
I won't pretend to understand the inner workings of it (I usually use 'SHAPE@', as a convenient but wasteful practice), but I think that because cursor.updateRow updates the table value rather than changing the tuple itself, it works, like below. >>> with arcpy.da.UpdateCursor("fc",'SHAPE@XY') as cursor:
... for row in cursor:
... cursor.updateRow([[row[0][0]+100, row[0][1]+1000]]) The value of row never changes within the loop. Conversely, the following does not work, for the reason you've identified: >>> with arcpy.da.UpdateCursor("fc",'SHAPE@XY') as cursor:
... for row in cursor:
... row[0][0] += 100
... row[0][1] += 1000
... cursor.updateRow([[row]])
...
Runtime error
Traceback (most recent call last):
File "<string>", line 3, in <module>
TypeError: 'tuple' object does not support item assignment
... View more
03-13-2015
09:13 AM
|
1
|
0
|
3468
|
|
POST
|
Thanks. I could work out the simpler geometries, just curious if there was some magical algorithm for figuring out more complicated shapes.
... View more
03-12-2015
10:04 PM
|
0
|
1
|
1702
|
| 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
|