|
POST
|
Sorry if you know this already, but are you sure you have enough parameters for this? In other words, do you have four parameters - the fourth parameter would be gp.GetParameterAsText(3), not the third?
... View more
04-02-2012
11:10 AM
|
0
|
0
|
1329
|
|
POST
|
Mike, you're getting close. It's a funny syntax thing - in the expression you reference fields (e.g. !ECOSITE!), then they turn into arguments/variables in the function (e.g. ECOSITE). Then, "return" the values. def TestFields ( ECOSITE , ECOSITE_1 ): # these reference individual values if ECOSITE_1 == ECOSITE: return "Same" else: return "Inclusion" COMPARE_FIELDS = TestFields(!ECOSITE!,!ECOSITE_1!) # these reference the field to grab individual values
... View more
04-02-2012
10:50 AM
|
0
|
0
|
1764
|
|
POST
|
I assume you mean "store the individual values" (one row for each pixel)...? Raster attribute tables are a list of unique values.
... View more
03-30-2012
12:44 PM
|
0
|
0
|
1472
|
|
POST
|
I'm guessing that the problem is that SelectLayerByLocation puts a selection on a feature layer, and SearchCursors take a feature class, shapefile, or table as input.
... View more
03-29-2012
12:02 PM
|
0
|
0
|
978
|
|
POST
|
I think your problem is stemming from the fact that ArcMap isn't smart enough to figure out that a path to a .lyr is a "Layer Object". You need to add arcpy.mapping.Layer() statements to make it clear. This is what I have for inside your try: source_layer = "H:/GIS_Data/Buffer.lyr" # point to your own .lyr sourceLayer = arcpy.mapping.Layer(source_layer) arcpy.MakeFeatureLayer_management(output, "Buffs") addLayer = arcpy.mapping.Layer("Buffs") arcpy.mapping.AddLayer(df,addLayer) update_layer = arcpy.mapping.ListLayers(mxd, "Buffs", df)[0] arcpy.AddMessage(source_layer) arcpy.mapping.UpdateLayer(df, update_layer, sourceLayer, True)
... View more
03-28-2012
09:16 AM
|
0
|
0
|
1949
|
|
POST
|
That's what Page Definition Queries are for, using Data Driven Pages.
... View more
03-26-2012
01:40 PM
|
0
|
0
|
1407
|
|
POST
|
If result is going into a field of type float then you shouldn't have the quotes around the value: If [FUNC_CLASS] = 1 then
result = 2.25
elseif [FUNC_CLASS] = 11 then
result = 3.30
elseif [FUNC_CLASS] = 12 then
result = 1.14
else
result = 0
end if Just FYI, I tried calculating a float field to equal a number in quotes and it worked - I agree it shouldn't, but curiously it does. I'm using ArcGIS 10, SP2, and in the calculator VBScript parser.
... View more
03-26-2012
01:36 PM
|
0
|
0
|
604
|
|
POST
|
This will add the feature class specified in "fc" to the current map document. Run as a script from inside ArcMap. import arcpy
fc = "H:/GIS_Data/TEMP.gdb/polygons"
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
arcpy.MakeFeatureLayer_management(fc, "poly")
addLayer = arcpy.mapping.Layer("poly")
arcpy.mapping.AddLayer(df,addLayer) What do you mean by "generate straight line distances for each of them in a folder"?
... View more
03-21-2012
11:07 AM
|
0
|
0
|
3384
|
|
POST
|
I'm not if there's a more direct solution, but you can create minimum and maximum raster (from each cell, the minimum or maximum value within a given neighborhood) using Focal Statistics. Then, you should be able to subtract the original raster from the min and max to find those cells over and under the 30m difference limits.
... View more
03-20-2012
02:09 PM
|
0
|
0
|
992
|
|
POST
|
I don't know of any way to circumvent the "convert->append->delete" workflow, but if you're doing this on a small number of line features numerous times and have the need for speed, you might want to look into using the "in_memory" workspace (probably my favourite ArcGIS secret). import arcpy
lineFeature = "H:/GIS_Data/TEMP.gdb/lines"
intPoly = "in_memory/intpoly"
polygonFeature = "H:/GIS_Data/TEMP.gdb/poly"
arcpy.FeatureToPolygon_management(lineFeature, intPoly, "", "NO_ATTRIBUTES", "")
arcpy.Append_management(intPoly, polygonFeature, "NO_TEST")
arcpy.Delete_management(intPoly)
... View more
03-20-2012
12:47 PM
|
0
|
0
|
848
|
|
POST
|
Did you type the name of your workspace, or select it from the folder selection dialog? If you typed it, check your spelling (ie. "Tutorails" vs. "Tutorials").
... View more
03-16-2012
07:56 AM
|
0
|
0
|
2229
|
|
POST
|
Hmmm... You can get X and Y coordinates of the rectangle centroid from Calculate Geometry (right-click column, choose Calculate Geometry). You can get width and height value from the Minimum Bounding Geometry tool (group by Object ID, envelope shape). Join output back to fishnet. Then, you should be able to subtract or add half the width and height to get your desired values. Warning: totally untested. edit: I just realized this is in the Python forum. I guarantee there is a Python solution, not that I know it off hand. Check out Reading Geometry. Also, looks relatively simple to get to an Extent object which has the values you're looking for (see the example).
... View more
03-15-2012
08:38 AM
|
0
|
0
|
1784
|
|
POST
|
fileName = "C:\FileList.txt" Don't use backslashes in paths. It escapes the next character. Instead it should be: "C:/FileList.txt" OR "C:\\FileList.txt" OR r"C:\FileList.txt"
... View more
03-15-2012
07:06 AM
|
0
|
0
|
2156
|
| 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
|