|
POST
|
I think the general idea is to add a table to the layout (Adding a table to a layout—Help | ArcGIS for Desktop ), however, I believe there may be a bug related to refreshing the table to reflect the current data driven page.
... View more
10-03-2016
09:48 AM
|
0
|
0
|
1126
|
|
POST
|
Whether this is your main problem or not, you can't create a geodatabase feature class (regardless of being in-memory or not) that starts with a number. I also don't believe it can contain a space.
... View more
09-30-2016
10:32 AM
|
0
|
4
|
2039
|
|
POST
|
The parameters for Buffer are (input, output, buffer distance or field, ...). Since you provide a buffer distance (e.g. 100) not a field, it uses that distance. If you want to use different distances, you would need to write the distance to a field using an Update Cursor or possibly Field Calculator and use that field for the third parameter. I'm not sure whether your Buffer is executed within the Search Cursor or outside because we can't see your indentation. If inside, Buffer will run for each feature, overwriting the file each time, leaving you with the last run. If outside, Buffer will run once, using the last value as the buffer distance.
... View more
09-30-2016
10:15 AM
|
2
|
0
|
1077
|
|
POST
|
This works for me: >>> mxd = arcpy.mapping.MapDocument("CURRENT")
... df = arcpy.mapping.ListDataFrames(mxd)[0]
... feeder_field = "FEEDERID"
... value = "something"
... for lyr in arcpy.mapping.ListLayers(mxd, "", df):
... fields = arcpy.Describe(lyr).fields
... for f in fields:
... if f.Name == feeder_field:
... delim = arcpy.AddFieldDelimiters(lyr,feeder_field)
... lyr.definitionQuery = delim + "='" + value + "'"
... View more
09-29-2016
02:23 PM
|
2
|
7
|
2960
|
|
POST
|
I believe your Python solution will look like: 1.) cycle through your DDPs (see example 1 here) and get the current extent 2.) list and loop through your data frames (ListDataFrames) 3.) set the extent of each data frame to the current DDP extent
... View more
09-29-2016
10:33 AM
|
0
|
0
|
1826
|
|
POST
|
Not sure if this is the issue, but can you try it with raw notation strings? I'm sure I've had issues not using raw notation with the in_memory workspace. And, '\T' is pretty close to '\t' (tab). r"in_memory\TaxPar"
vs.
"In_memory\TaxPar"
... View more
09-27-2016
03:45 PM
|
0
|
0
|
1733
|
|
POST
|
You've got two identical lines that create an insert cursor. You only need to create it once - the line before you've created the search cursor. So, you may as well delete the line that re-creates the insert cursor within the search cursor. As far as I'm concerned, it's ok to nest an insert cursor within a search or update cursor. I don't know the inner workings, but insert cursors (which run only when called) are quite different from search and update cursors (which loop through all features or those that meet the where clause criteria). You can run into trouble nesting any combination of search or update cursors, especially with large datasets, because it compounds the looping.
... View more
09-27-2016
02:50 PM
|
1
|
1
|
3989
|
|
POST
|
Can you try this?
import arcpy
fc = r'C:\path\to\your\geodatabase.gdb\polygon'
sr = arcpy.Describe(fc).spatialReference # get spatial reference
array = arcpy.Array([arcpy.Point(-111.8256, 40.691085),
arcpy.Point(-111.825347, 40.691614),
arcpy.Point(-111.824706, 40.691896),
arcpy.Point(-111.825592, 40.68703)
])
polygon = arcpy.Polygon(array,sr) # create polygon with spatial reference
cursor = arcpy.da.InsertCursor(fc, ['SHAPE@'] )
cursor.insertRow([polygon])
... View more
09-23-2016
01:25 PM
|
1
|
1
|
3958
|
|
POST
|
What is the spatial reference of your 'polygon' feature class?
... View more
09-23-2016
01:18 PM
|
0
|
3
|
3135
|
|
POST
|
How does it fail? With an error? If so, what's the full error? I suspect it's because you don't set a spatial reference anywhere, but we'll see.
... View more
09-23-2016
01:14 PM
|
0
|
0
|
3135
|
|
POST
|
Can you provide an example where it fails? Or does your given example fail?
... View more
09-23-2016
01:11 PM
|
0
|
5
|
3135
|
|
POST
|
If your codeblock is stored in a variable named "codeblock", then access it using the variable codeblock (no quotes - quotes means it's a string that literally is "codeblock") arcpy.CalculateField_management("1st_dataset_name","field_to_calculate",codeblock)
... View more
09-23-2016
01:08 PM
|
1
|
0
|
2381
|
|
POST
|
This is a good example of why you should try running the misbehaving tool in the GUI. Try it. You need to set the "dissolve_type" to "LIST" before it will let you choose a field to dissolve upon: arcpy.Buffer_analysis(SP, outfile, distance, "OUTSIDE_ONLY", "ROUND", "LIST", "BUFF_DIST")
... View more
09-23-2016
01:00 PM
|
0
|
1
|
869
|
|
POST
|
It depends what you were searching for. Does it ever work to search for a ready-made script that does exactly what you want? You really just need a "Python if statement" (or more likely, several), which produces endless useful search results explaining how to do what you need to do, if you look at the more general problem.
... View more
09-23-2016
09:21 AM
|
0
|
0
|
3411
|
|
POST
|
You can't concatenate a string and a number. Convert the number to a string before concatenating: str(start)
... View more
09-22-2016
04:28 PM
|
1
|
3
|
1579
|
| 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
|