|
POST
|
I believe you can grab the scale inside the loop, once you've got your dataframe object, using: scale = dataframe.scale This will return an absolute scale for the dataframe, like 5000 would equal a scale of 1:5000. You could then do some math to calculate how many feet would equal one inch. For example: scale = dataframe.scale # e.g. 5000
engScale = '1 inch = ' + int(scale/12) + ' feet' # returns "1 inch = 417 feet" You can escape quotes inside the string, but that's an extra step for me.
... View more
10-09-2015
09:20 AM
|
0
|
0
|
2168
|
|
POST
|
Are you only interested in the drain itself (i.e. how much water goes down the drain) or do you need to consider the drainage system itself (e.g. this drain + this drain = this accumulated drainage going through the pipe)?
... View more
10-07-2015
03:34 PM
|
0
|
0
|
746
|
|
POST
|
See this help page, which describes how to generalize a messy raster imagery classification. In particular, try starting from the second last step, which describes how to remove areas smaller than a threshold (your blue pixels) and fill in the resulting voids using the Nibble tool. Alternatively, if you really want to consider only the 8 surrounding pixels and reclassify those that are surrounded by all green, you can do so with Focal Statistics to calculate the min and max within the default 3x3 square, then use Con to test if the min = green value, and max = green value, and the green/blue raster = blue value, change it to green.
... View more
10-07-2015
03:22 PM
|
0
|
1
|
3608
|
|
POST
|
Yes, that would work most of the time, although some index features may not cover the center of the map extent, and the center of some map extents may cover multiple index features. Whether or not that matters would depend on why you wanted to know which feature produced which map extent, or if any would do.
... View more
10-07-2015
02:01 PM
|
0
|
3
|
2171
|
|
POST
|
In most cases (mutually exclusive index features), you could use Spatial Join for this but not necessarily for more complex cases (e.g. coincident or overlapping index features).
... View more
10-07-2015
01:18 PM
|
0
|
5
|
2171
|
|
POST
|
I don't see anything immediately wrong with your code (i.e. it looks like you are passing the proper variables into your custom focalStats function, and executing the FocalStatistics call correctly). The vagueness of Error 999999 makes me wonder if restarting ArcGIS (or your Python IDE) may help. edit: you may want to check that myRasLst[0] actually exists.
... View more
10-07-2015
11:31 AM
|
0
|
1
|
3643
|
|
POST
|
As far as I know, you have to do a fair bit of recoding to incorporate attributes into this type of snippet. It can be done by creating a new feature class and adding the field before the loop, then adding features to the feature class inside the loop using an InsertCursor. If someone know if it's possible to include attributes somehow using CopyFeatures, I would be eternally grateful. Something like this would be ideal, although I don't believe it's possible: extents.append([polygon, field1, field2, etc.])
arcpy.CopyFeatures_management(extents, "Polygon_Extent")
... View more
10-07-2015
10:19 AM
|
0
|
0
|
6534
|
|
POST
|
I think this is the difference Dana Nolan is referring to:
... View more
10-06-2015
11:35 AM
|
0
|
0
|
1195
|
|
POST
|
Hmmm it's neither here nor there, but I believe the output location was a FGDB named 2010.gdb, unless I'm missing something.
... View more
10-05-2015
07:20 PM
|
0
|
1
|
2328
|
|
POST
|
Yes, I believe it is the problem with starting the FGDB raster with a number. I get the same error. It would be nice if the error message told you why the table name is invalid, as there are a few different ways to make this happen.
... View more
10-05-2015
04:53 PM
|
0
|
3
|
2328
|
|
POST
|
Try starting your output raster with a letter instead of a number. There are a few errors indicating that table names must start with a character, not number (like this and this). Alternatively, try saving outside a GDB. If that fails, some other things to try are: - restart ArcGIS - save to a simple path, with no spaces (e.g. "C:\junk")
... View more
10-05-2015
03:44 PM
|
1
|
5
|
2328
|
|
POST
|
Can you provide a link to where you found this code snippet, and why you might think this might work recursively? If you got the code from the PrintMap help page, example two, it says that this only prints the first data frame ([0]). If you want to loop through all data frames, use a for loop and change the df variable. import arcpy
mxd = arcpy.mapping.MapDocument(r"path")
dfs = arcpy.mapping.ListDataFrames(mxd)
for df in dfs:
arcpy.mapping.PrintMap(mxd, r"printer", df) If this isn't what you're asking, please try rephrasing your question.
... View more
10-05-2015
09:23 AM
|
0
|
0
|
1039
|
|
POST
|
I stand corrected. I didn't realize you could refer to a feature class in a dataset without including the dataset in the path. I think you're going to have to resort to something like arcpy.da.Walk() to find your feature class and the containing feature dataset, but I may be missing something else.
... View more
10-04-2015
10:45 PM
|
0
|
0
|
4091
|
|
POST
|
I'm using 10.2, so can't test anything in 10.3, but this doesn't appear to be a property of the Layer object. I'm guessing you're out of luck, at least as far as arcpy goes, which truly isn't meant to do absolutely everything.
... View more
10-02-2015
02:32 PM
|
1
|
0
|
4267
|
|
POST
|
I'm unclear how you can describe a feature class and not know its path. The path tells you if it's in a feature dataset. Isn't this the case in SDE feature classes (obviously, I don't use SDE)?
... View more
10-02-2015
12:39 PM
|
1
|
2
|
4091
|
| 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
|