POST
|
Dear ArcGis community. I mastered to write a little script that runs a naturalneighbor interpolation for several columns (hourly temperature measurements) in a shapefile. This works fine so far, but I want to apply symbology from a layer having classified intervals with 1 degree class breaks reaching from 0 to 35 degrees. I used arcpy.ApplySymbologyFromLayer_management("temperaturemap.tif", "symbollayer.lyr"). This also worked but the routine does not adopt the correct colors from the colorramp of the symbollayer. It always assigns the ends of the colorramp to the max and min value of the individual interpolation map. But when I do this manually in the layer properties -> symbology -> import symbology, it just works out fine. # Import system modules import arcpy from arcpy import env from arcpy.sa import * # Set environment settings env.workspace = "S:/B5_2014" inPointFeature = "S:/B5_2014/Temp_points.shp" clipFeature = "S:/B5_2014/Messflaeche.shp" symbol = "S:/B5_2014/temperatures.lyr" outFolinWsp = "temperatures" namesuppl = "temp" #arcpy.MakeFeatureLayer_management(inPointFeature, "points") # Set local variables cellSize = 5 # Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial") # Execute NaturalNeighbor for i in range(5): num = i+1 zField = str(num) outNatNbr = NaturalNeighbor(inPointFeature, zField, cellSize) string1 = "S:/B5_2014/"+outFolinWsp+"/"+namesuppl+zField outNatNbr.save(string1) string2 = outFolinWsp+"/"+namesuppl+zField string3 = "S:/B5_2014/"+outFolinWsp+"/c"+namesuppl+zField+".tif" arcpy.Clip_management(string2, "#", string3 ,clipFeature, "0", "ClippingGeometry") arcpy.ApplySymbologyFromLayer_management("c"+namesuppl+zField+".tif", symbol)
... View more
03-13-2014
01:53 AM
|
0
|
0
|
1627
|
POST
|
Dear Python+Arcgis experts, I want to sort my contour lines. My table contains the field CONTOURS (double) and sort (double). I want that contours ending with 5 get the value 5 for sort, contours ending with 10 the value 10 and all other contours should get the value 1 for sort. I tried this code: def Reclass(contours): if contours % 10 == 0: !sort! = 10; elif contours + 5 % 10 ==0: !sort! = 5; else: !sort! = 1; Reclass(!Contours!) but it doesn't word. I hope you can help me with. Andreas
... View more
09-24-2012
04:30 AM
|
0
|
7
|
1226
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|