|
POST
|
Hmmm. Nothing I see here: http://resources.arcgis.com/en/help/main/10.1/index.html#//003n000000sr000000 leads me to believe you can script this. Can you handle it all through plain versions? That you can script.
... View more
08-08-2013
09:20 AM
|
0
|
0
|
2440
|
|
POST
|
How about something like: arcpy.env.extent = "C:/studium/00_Master/clean/clipper.shp"
comboGrdList = []
rastersList = arcpy.ListRasters("Raster*")
for raster in rasterList:
out1 = Con(IsNull(raster), 0, raster)
out1.save("twr_" + str(raster.split("_")[-1])) #assuming that raster is something like "tower_12"
comboGrdList.append(out1)
comboGrd = arcpy.sa.Combine(comboGrdList) I don't really understand the tower distance order weighting you are trying to implement, but the GenerateNearTable tool will give you a matrix for all 155 ^ 2 combinations and the distances between them. A dictionary that stores the distances (generated from the near table) plus an update cursor on the combine table that accesses the dictionary should be what you need I think.
... View more
08-07-2013
12:31 PM
|
0
|
0
|
5568
|
|
POST
|
BTW: I like the look of wind towers - I think they are cool - I just don't like the sound downwind of them!
... View more
08-07-2013
10:17 AM
|
0
|
0
|
6924
|
|
POST
|
Are you running ArcSDE? As far as I know, FGDB and PGDB formats don't suport archiving/versioning. In the interest of keeping things simple and straightforward (which is always a good idea), I don't see much wrong with what you are doing. That same copy/rename/repost stategy can be applied to FGDB, GRID, SHP, PGDB, SDE, whatever. I do it all the time - it's great. It may be more "efficient" database/storage-wise to implement SDE enterprise archiving/versioning, but I know it isn't easier.
... View more
08-07-2013
08:35 AM
|
0
|
0
|
2440
|
|
POST
|
each row is returned as list of values To be more precise, each row is returned as a Python tuple... which is similar to a Python list, but one that can't be rearanged/sorted (aka an imutable list). In Python: tupleExample = (1,2,3,4) listExample = [1,2,3,4]
... View more
08-07-2013
08:17 AM
|
0
|
0
|
805
|
|
POST
|
Thanks Steve - that's the same method I came up with too.
... View more
08-05-2013
07:57 AM
|
0
|
0
|
1005
|
|
POST
|
I got it: Con(valueGrd == ZonalStatistics(strmLinkGrd, "VALUE", valueGrd, "MINIMUM", "DATA"), 1)
... View more
07-31-2013
01:39 PM
|
0
|
0
|
1005
|
|
POST
|
I have a streamlink raster and a "value" raster that has floating point values. I want to return the pixel position of the minimum value for each zone.... Sort of like a zonal minimum, but instead of applying the minimum value to the entire zone, I just want to return the pixel(s) that have the minimum value of each zone (and tag the rest as NoData or some other value). I don't even need to return the minimum value - just return the pixel that has the minimum value and assign it a value of 1. I have a working method for doing this, but it requires converting my raster to points and then a bunch of extra steps along the way - pretty sloppy and slow. I am looking for an elgant raster-based solution that is fast, since I have to do this process many times over via a Python script. A graphical representation of a hypothetical zone (x = nodata) input: 3 5 6 2 3 4 6 7 9 output: x x x 1 x x x x x Any ideas?
... View more
07-31-2013
09:45 AM
|
0
|
3
|
1497
|
|
POST
|
I also use the COM method to interact with Excel... Works great assuming you have Excel and PythonWin installed. It's nice to couple the data access cursors (a tuple of the field values) with a sheet's .Range() write method - fastest way I have found to write native Excel tables.... row by row instead of cell by cell.
... View more
07-30-2013
04:54 PM
|
0
|
0
|
3003
|
|
POST
|
A poor mans guide to building a "randomly shapped polygon": Step 1. Generate some random points - using the CreateRandomPoints tool. Step 2. Use the MinimumBoundingGeometry tool to build a convex hull around each set of points.
... View more
07-29-2013
01:52 PM
|
0
|
0
|
1962
|
|
POST
|
ESRI GRID format has a limit of 13 characters, but it appears you are using a different format (something with a file extension like a .tif or .img or something). Make sure you don't have the file you are attempting to rename open in another application. What is the raster format you are using and the new name you are trying to rename to?
... View more
07-15-2013
01:42 PM
|
0
|
0
|
1358
|
|
POST
|
How about just extending all the lines by a large distance (larger than your max extention) using the ExtendLine tool, and then clip the extended lines to a polygon version of your polyline layer (a shoreline from the looks of it)?
... View more
07-12-2013
12:23 PM
|
0
|
0
|
726
|
|
POST
|
The .next() statement (in addition to the for loop) is unneccessary. I think a bit cleaner code would look like: import arcpy
myOutputFile = open('C:\\temp\\myoutputfile.txt', 'w')
rows = ap.SearchCursor('C:\\temp\\myInputTable.shp')
for row in rows:
myOutputFile.write(str(row.APN) + '\n')
del row, rows
myOutputFile.close() Also, in v10.1 syntax using the .da cursors (~30x faster than the old search cursors): import arcpy
myOutputFile = open('C:\\temp\\myoutputfile.txt', 'w')
rows = arcpy.da.SearchCursor('C:\\temp\\myInputTable.shp',["APN"])
for row in rows:
myOutputFile.write(str(row[0]) + '\n')
del row, rows
myOutputFile.close()
... View more
07-11-2013
12:10 PM
|
0
|
0
|
4109
|
|
POST
|
Two other ways to get a list of OIDs of selected records (method #2 is the best BTW): #Method1: Must have a selection on the feature layer for this to work... but works in any version fc = r"C:\csny490\overlay_20130620\gis_layers\county.gdb\county"
arcpy.MakeFeatureLayer_management(fc, "fl")
arcpy.SelectLayerByAttribute_management("fl", "NEW_SELECTION", "COUNTY_CD > 10")
oidList = [int(oid) for oid in arcpy.Describe("fl").FIDSet.split(";")] #Method2: Uber fast! Works with a feature layer with a definition query and/or selected set... but only in v10.1+! fc = r"C:\csny490\overlay_20130620\gis_layers\county.gdb\county"
arcpy.MakeFeatureLayer_management(fc, "fl", "COUNTY_CD > 10")
oidList = [oid[0] for oid in arcpy.da.SearchCursor("fl",["OID@"])]
... View more
07-09-2013
04:42 PM
|
0
|
0
|
1634
|
|
POST
|
Yep - on the last line try: elevation.save("my_output") The raster "my_output" should then be saved to the 'FD_addr' workspace. Question though: Does 'FD_addr' point to a feature dataset within a geodatabase? Last I checked, I thought that you can't write rasters to a feature dataset (has to be directly to the GDB).
... View more
06-27-2013
08:56 AM
|
0
|
0
|
2579
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-25-2014 12:57 PM | |
| 1 | 08-29-2024 08:23 AM | |
| 1 | 08-29-2024 08:21 AM | |
| 1 | 02-13-2012 09:06 AM | |
| 2 | 10-05-2010 07:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-30-2024
12:25 AM
|