|
POST
|
I see. I think you can basically use your existing code, wrapping around the year one more time to pick up the dec->jan connection. Then, use the second "year" of rasters to get the max. jan1 = jan
feb2 = Con((feb) == 1, (jan1) + 1, 0)
mar3 = Con((mar) == 1, (feb2) + 1, 0)
apr4 = Con((apr) == 1, (mar3) + 1, 0)
may5 = Con((may) == 1, (apr4) + 1, 0)
jun6 = Con((jun) == 1, (may5) + 1, 0)
jul7 = Con((jul) == 1, (jun6) + 1, 0)
aug8 = Con((aug) == 1, (jul7) + 1, 0)
sep9 = Con((sep) == 1, (aug8) + 1, 0)
oct10 = Con((oct) == 1, (sep9) + 1, 0)
nov11 = Con((nov) == 1, (oct10) + 1, 0)
dec12 = Con((dec) == 1, (nov11) + 1, 0)
# wrap back around
jan1_2 = Con((jan) == 1, (dec12) + 1, 0)
feb2_2 = Con((feb) == 1, (jan1_2) + 1, 0)
mar3_2 = Con((mar) == 1, (feb2_2) + 1, 0)
apr4_2 = Con((apr) == 1, (mar3_2) + 1, 0)
may5_2 = Con((may) == 1, (apr4_2) + 1, 0)
jun6_2 = Con((jun) == 1, (may5_2) + 1, 0)
jul7_2 = Con((jul) == 1, (jun6_2) + 1, 0)
aug8_2 = Con((aug) == 1, (jul7_2) + 1, 0)
sep9_2 = Con((sep) == 1, (aug8_2) + 1, 0)
oct10_2 = Con((oct) == 1, (sep9_2) + 1, 0)
nov11_2 = Con((nov) == 1, (oct10_2) + 1, 0)
dec12_2 = Con((dec) == 1, (nov11_2) + 1, 0)
Final_Output = CellStatistics([(jan1_2), (feb2_2), (mar3_2), (apr4_2), (may5_2), (jun6_2), (jul7_2), (aug8_2), (sep9_2), (oct10_2), (nov11_2), (dec12_2)] , "MAXIMUM", "NODATA")
... View more
10-23-2015
01:06 PM
|
2
|
2
|
3209
|
|
POST
|
Here is some code that should get you most of the way there: >>> import math
... arcpy.CreateFeatureclass_management(r'in_memory','points',"POINT")
... arcpy.AddField_management(r'in_memory\points',"Angle","DOUBLE")
... sr = arcpy.Describe("line").spatialReference
... insCur = arcpy.da.InsertCursor(r'in_memory\points',["SHAPE@","Angle"])
... with arcpy.da.SearchCursor("line","SHAPE@",spatial_reference=sr) as cursor:
... for row in cursor:
... for part in row[0]:
... first = 1
... for pnt in part:
... if first == 0:
... dx = pnt.X - prev.X
... dy = pnt.Y - prev.Y
... angle = math.degrees(math.atan(dy/dx))+90
... insCur.insertRow([pnt,angle])
... prev = pnt
... first = 0 ...and the resulting points, symbolized using Arithmetic rotation style.
... View more
10-22-2015
04:01 PM
|
0
|
1
|
2797
|
|
POST
|
Use the Create TIN tool on those points. If they're not points already, make them into points first, using the coordinates.
... View more
10-22-2015
03:10 PM
|
2
|
2
|
1552
|
|
POST
|
Your main task is figuring out the angle of the line and transferring it to the point. You can do this using arcpy Polyline geometry vertices, good, old-fashioned trigonometry, and a Spatial Join. When you've got some code going, post it for more help.
... View more
10-22-2015
10:40 AM
|
1
|
3
|
2797
|
|
POST
|
If I understand correctly, rather than hard-coding month names into your variable names, I believe you should try naming based on something like "number of months before now (or given date)". So, if you ran the code now (October) the value for September would be held in the variable "months_ago_1", August in "months_ago_2", etc. When you run the code in November, October would move into "months_ago_1" etc.
... View more
10-22-2015
10:33 AM
|
0
|
5
|
3209
|
|
POST
|
Hmmm it seems to work for me. 1.) Created add-in using Python add-in assistent. One Extension with openDocument selected. 2.) Changed openDocument method to: def openDocument(self):
pythonaddins.MessageBox('This is a message box!', 'INFO', 0) 3.) Save add-in script and run makeaddin.py 4.) Run .esriaddin file to install 5.) Open ArcMap 6.) Enable new extension 7.) Open Python window 8.) Load a map document 9.) Message box appears This only fires when a document is opened, not on ArcMap startup, unless you open an mxd at (approximately) the same time as startup (e.g. double-click an mxd outside ArcMap).
... View more
10-21-2015
03:21 PM
|
1
|
4
|
2377
|
|
POST
|
You can (and possibly, must) remove all lines of 'del cursor'. Using the 'with' statement means the variable 'cursor' will be deleted on completion, so it may not be there to delete whatsoever.
... View more
10-21-2015
01:02 PM
|
1
|
0
|
2753
|
|
POST
|
deleteRow() deletes the current row, so no need to tell it which row. cursor.deleteRow()
... View more
10-21-2015
11:55 AM
|
0
|
4
|
2753
|
|
POST
|
Well, line 26 (row[1]) looks wrong. Gee, an error message would sure be useful...
... View more
10-21-2015
11:44 AM
|
0
|
6
|
2753
|
|
POST
|
Try: with arcpy.da.SearchCursor(table, ["RID", "to_MEAS"], "RID = '" + RID + "'") Otherwise, provide error message.
... View more
10-21-2015
10:07 AM
|
0
|
8
|
2753
|
|
POST
|
It's a bit of a personal preference how close to the bleeding edge you want or need to be. For me, I generally don't upgrade until there is some reason to do so, and not until there has been at least one service pack released to fix all the major bugs in version 0. Nothing worse than upgrading only to find you need to revert for some piece of broken crucial functionality. You've identified well-established tasks that would probably be safe at any version since 9.x (and some would say well before that), so those requirements don't need to play a pivotal role in your decision. Something you may want to consider is backwards compatability within or outside your organization. Higher versions can open previous versions' geodatabases, but not the other way around, without the former saving to the latter's version. It doesn't need to be a showstopper, just an extra annoyance if you have, say, 10.3 and are often sharing (or trying to replicate) data with a slow-moving organization like, say, government who are still at 10.0. I'll add, I'm comfortably at 10.2.2 and I will stay here until I have a reason to upgrade.
... View more
10-20-2015
04:48 PM
|
1
|
1
|
2187
|
|
POST
|
Not sure if this helps, but here's how I view the "problem" with using a 3D buffer, looking end-on at a stream. It's still better than a 2D buffer and the smoother the terrain the closer it will be to the true path distance, but still not exactly what's required.
... View more
10-20-2015
09:35 AM
|
1
|
1
|
3091
|
|
POST
|
arcpy.GetParameterAsText() grabs the value from the tool dialog. Since you're running this from the Python window, there is no tool dialog, thus no value to describe. Until you're ready to run this within a tool, you can debug with a hardcoded value: lyr = "THE_NAME_OF_YOUR_LAYER_IN_THE_TOC"
... View more
10-19-2015
12:18 PM
|
1
|
0
|
3808
|
|
POST
|
Most tools respect selections. If you run Copy Features while there is a selection, only the selected features will be copied (otherwise, all features will be copied).
... View more
10-19-2015
11:30 AM
|
1
|
0
|
3808
|
|
POST
|
Just echoing Dan Patterson's suggestion for using Path Distance, with a couple extra notes. - I believe you actually could use Cost Distance, if you really wanted, by calculating the cost from the stream layer over a slope raster (not DEM), scaled by cell size. High slope = high distance/cell = high cost. But, Path Distance already does this for you. - You can't use 3d Buffer. This will produce a cylinder around your stream, but not take into account the topography between the stream and your buffer distance. - You can't use contour geometry directly whatsoever, as the desired distance should almost never follow a contour line. Your stream is going downhill, and so should your buffers (generally). - Regarding using your pre-existing buffers, I think this would be possible, though complicated to implement, using 3d graphics software like Blender (you can import DEMs and shapefiles), but AFAIK not ArcGIS. Before you go down this rabbithole, Blender does choke up using even moderately large elevation datasets - I wouldn't recommend this route unless you're really interested in learning the software.
... View more
10-19-2015
09:37 AM
|
2
|
14
|
4302
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-25-2015 01:51 PM | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|