|
POST
|
It's not as easy as just setting the page definition query once, but if you're using arcpy to export the DDP anyhow, you could just change the definition query before exporting, for each page.
... View more
02-22-2017
11:17 AM
|
0
|
0
|
1724
|
|
POST
|
Just to add that you can test whether or not there is a selection by inspecting the describe FIDSet property: ... if arcpy.Describe(fc).FIDSet == '':
... print 'There is no selection'
... else:
... print 'There is a selection'
... View more
02-22-2017
11:08 AM
|
0
|
2
|
5986
|
|
POST
|
A few things: - Cursors cycle through individual features within a feature class/table. You don't seem to need that here. - When you do 'for row in fcs:', the individual feature class is called row. The list of feature classes is fcs. So, you should select from row, not fcs. - Refer to the help for GetCount, especially the example. Note that it returns a result, not a number.
... View more
02-22-2017
09:35 AM
|
0
|
0
|
5986
|
|
POST
|
You can delineate the shoreline in many different ways. The problem is that the surface height of the water can change through time, so you need to somehow account for the surface height at the time of your bathymetry collection. 1.) Survey (not feasible for large lakes) 2.) GPS the shoreline (not feasible for large lakes) 3.) Delineate from very recent aerial photos (probably not available) 4.) Use an existing delineation of the lake (e.g. CanVec waterbodies, or higher resolution if you can find it for SK). Ideally, you collected accurate GPS points on the shoreline, and better yet you collected shoreline profiles at locations around the lake, so that you can adjust the existing shoreline delineation to the current condition.
... View more
02-22-2017
09:16 AM
|
2
|
0
|
2412
|
|
POST
|
As far as I know, you do need to include the shoreline delineation as height = 0.
... View more
02-21-2017
01:47 PM
|
2
|
2
|
2412
|
|
POST
|
You can't multiply lists of rasters together - it just doesn't work: >>> arcpy.env.workspace = r'C:\junk'
... rasterlist = arcpy.ListRasters()
... newlist = rasterlist * rasterlist
...
Runtime error
Traceback (most recent call last):
File "<string>", line 3, in <module>
TypeError: can't multiply sequence by non-int of type 'list'
... View more
02-21-2017
01:06 PM
|
1
|
0
|
2826
|
|
POST
|
Shouldn't it be 'lst_polygons = []'? The way it is now, I think it's getting hung up trying to make a polygon out of the number 1.
... View more
02-20-2017
06:56 PM
|
2
|
1
|
1898
|
|
POST
|
Are you sure 'points' is a feature class and not a nonspatial table, that wouldn't have a spatial reference?
... View more
02-20-2017
05:07 PM
|
2
|
3
|
1899
|
|
POST
|
If you've tried everything, how can we help? Share your best guess and we can go from there.
... View more
02-20-2017
03:12 PM
|
1
|
1
|
1756
|
|
POST
|
Yes, I assume it does have to do with the quotes. It looks like a mess, but here's how I try to set up my queries. 1.) Enclose the main query in triple-double-quotes. 2.) Use 'format' notation. 3.) Use AddFieldDelimiters to avoid the quote/bracket/nothing problem between data sources. arcpy.SelectLayerByAttribute_management("Strain Regions","NEW_SELECTION",""" {} = 'Band {}' """.format(arcpy.AddFieldDelimiters("Strain Regions","band_number"),str(i))) More info and an example here.
... View more
02-20-2017
02:59 PM
|
1
|
1
|
2171
|
|
POST
|
It may be having issues with escape characters in the lines where you specify the paths. Try adding an 'r' to denote raw string notation: e.g. fc_in = r"C:\Users\ihwm\Documents\ArcGIS\Flood_NT_WA.gdb\points"
... View more
02-20-2017
02:44 PM
|
1
|
6
|
1897
|
|
POST
|
Untested, but I think it should be like this: for i in range(1,4): # returns 1,2,3
arcpy.SelectLayerByAttribute_management("Strain Regions","NEW_SELECTION",'''"band_number" = 'Band ' + str(i) ''')
arcpy.SelectLayerByLocation_management("Earthquakes","COMPLETELY_WITHIN","Strain Regions",'',"ADD_TO_SELECTION")
arcpy.AddField_management("Earthquakes",'region2', "TEXT")
arcpy.CalculateField_management("Earthquakes","region2",'"band " + str(i) ')
arcpy.SelectLayerByAttribute_management("Strain Regions","CLEAR_SELECTION")
arcpy.SelectLayerByAttribute_management("Earthquakes","CLEAR_SELECTION") Basically, by using str(i) in the loop, it changes from 1 to 2 to 3.
... View more
02-20-2017
02:10 PM
|
1
|
3
|
2171
|
|
POST
|
Just a few points of clarification: - do the "closest" lines have to be distance = 0? - does every line segment need to be merged with one other line segment, or will some remain un-merged? - once a line segment is merged, does it become a candidate for other line segments to merge onto? - can you describe the steps (i.e. the algorithm) that will produce the results you're after? - your example of three segments can be solved very easily, but what about if you had 4 segments (10,5,5,15)? I guess if you start at the beginning you would be left with two segments (15,20). But, what if the first segment you considered happened to be in the second position (5). Then, you'd be left with three segments (10,10,15). Basically, it will depend greatly on the order in which you consider the segments.
... View more
02-20-2017
01:53 PM
|
1
|
0
|
394
|
| 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
|