|
POST
|
I would have thought the mosaic operation would require a spatial reference? That's a big indicator of the problem. Defining the spatial reference will not affect the data, it just let's the system know what it's looking at. Use the define spatial reference tool first and calculate statistics. Check the tiles match up with other boundary data etc.
... View more
02-01-2020
08:09 AM
|
0
|
2
|
3108
|
|
POST
|
I've edited it again to attempt to go into the attribute tasble
... View more
02-01-2020
08:06 AM
|
2
|
3
|
978
|
|
POST
|
Edited. If that doesnt work try it on a subset of features, say 100
... View more
02-01-2020
07:30 AM
|
2
|
5
|
1172
|
|
POST
|
Wow looks awful. I've edited the code to just spit out the values, -999 represents rows where no median could be computed.
... View more
02-01-2020
06:56 AM
|
2
|
7
|
1172
|
|
IDEA
|
Perhaps you could use a raspberry pi or laptop connected to the tv as a cheap alternative until this is hopefully resolved for you?
... View more
02-01-2020
06:45 AM
|
1
|
0
|
2640
|
|
POST
|
Check your attribute table, should have populated it
... View more
02-01-2020
06:23 AM
|
2
|
1
|
1172
|
|
POST
|
import arcpy
input_table = r'put the path to your table here'
#lcb is the lower class boundary
width_age_range_1 = 14.5
lcb_age_range_1 = 0.0
width_age_range_2 = 50.0
lcb_age_range_2 = 14.5
width_age_range_3 = 35.5
lcb_age_range_3 = 64.5
median_list = [ ]
with arcpy.da.SearchCursor(input_table, ["TOT", "TOT_0_14", "TOT_15_64", "TOT_65"]) as cursor :
for row in cursor :
#if all numeric fields hopefully
n_over2 = (row[0]/2.0)
if row[0] == 0 :
median_list.append(-9999)
continue
if row[1] >= n_over2 :
#cumulative freq of groups before median group
cumu_freq = 0.0
if row[1] != 0.0 :
median = lcb_age_range_1 + ( ((n_over2 - cumu_freq)/row[1]) * width_age_range_1)
median_list.append(median)
continue
continue
if (row[1] + row[2]) >= n_over2 :
#cumulative freq of groups before median group
cumu_freq = row[1]
if row[2] != 0.0 :
median = lcb_age_range_2 + ( ((n_over2 - cumu_freq)/row[2]) * width_age_range_2)
median_list.append(median)
continue
continue
if (row[1] + row[2] + row[3]) >= n_over2 :
#cumulative freq of groups before median group
cumu_freq = row[1] + row[2]
if row[3] != 0.0 :
median = lcb_age_range_3 + ( ((n_over2 - cumu_freq)/row[3]) * width_age_range_3)
median_list.append(median)
continue
continue
else:
median_list.append(-999)
#for median in median_list:
#print(median)
counter = 0
with arcpy.da.UpdateCursor(input_table, ["median"]) as cursor :
for row in cursor :
if counter < len(median_list):
row[0] = median_list[counter]
try :
cursor.updateRow(row)
counter += 1
except :
print("error at count - " + str(counter))
else:
break
print("complete")
... View more
02-01-2020
04:57 AM
|
2
|
13
|
6749
|
|
POST
|
You could pretty easily populate the column by copying and pasting the printed values into your blank column whilst editing the table. Are they correct?
... View more
01-31-2020
04:47 PM
|
2
|
1
|
1231
|
|
POST
|
Wow, I'd test the results against your website, bear in mind it may have calculated lower class boundaries different from what you expected. Basically test quite a few features to see if correct result
... View more
01-31-2020
04:40 PM
|
2
|
1
|
1231
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-13-2025 01:08 PM | |
| 1 | 09-25-2025 03:19 PM | |
| 1 | 09-24-2025 02:35 PM | |
| 1 | 09-17-2025 02:42 PM | |
| 1 | 09-10-2025 02:35 PM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|