POST
|
Hello Dan, hello Peter, thank you for your answer and help. I did not work on that project for quite a while, so please excuse my delayed answer. I finally found out why my "Zonal statistic as table - 2" - Tool behaved like the normal "Zonal statistics as table" tool. The solution turned out to be very simple...! The script works with exception handling by using "TRY" and "EXCEPT", where "TRY" is dealing with overlapping polygons and "EXCEPT" is just the normal "Zonal statistics as table" tool (which provides unsatisfactory results). When I tried to find out why an exception was caused, i saw that this part of the script: if arcpy.env.overwriteOutput == "False":
arcpy.env.overwriteOutput = "True"
owFlag = 1
else:
owFlag = 0 is not really working. I do not know why exactly it does not work, but by simply setting arcpy.env.overwriteOutput = "True" no exception was caused anymore and the script worked perfectly. Simon
... View more
03-17-2016
04:28 AM
|
0
|
2
|
1755
|
POST
|
Hey Dan, thanks for your reply! Yes, I read the comment section. But it is not one of these problems. What I meant by "the whole color thing" was this part of the code, where I did not really understand what it is good for (I am just a beginner): # Retrieves the colors of the neighboring nodes
def get_colors(nodes, neighbors):
colors = set()
for neighbor in neighbors:
colors.add(nodes[neighbor][0])
colors.difference([0])
return colors
# Create a new color
def get_new_color(colors):
return max(colors)+1 if len(colors) > 0 else 1
# Chooses from existing colors randomly
def choose_color(colors):
return random.choice(list(colors))
... View more
02-16-2016
08:59 AM
|
0
|
1
|
1755
|
POST
|
Hello to all of you, I am processing 11.000 polygons, which are partially overlaying, by the published "Zonal statistic as table - 2" tool (New Spatial Analyst Supplemental tools, v1.3 | ArcGIS Blog ). Somehow, even though my input layers meet the criteria, it just creates an output table with 665 items, not 11.000. Is there any known reason for that? Since I am not so familiar with python: What is this whole colour thing about and could it be the reason for the limited items? I attached the "Zonal statistic as table - 2" script file. Thanks in advance
... View more
02-16-2016
05:26 AM
|
1
|
7
|
4793
|
Title | Kudos | Posted |
---|---|---|
1 | 02-16-2016 05:26 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|