POST
|
From what I can tell there must not be a property to describe the state of the check box. That is all I am looking for. I have another route I can go but if there was this option then that would make it easy.
... View more
04-01-2021
04:16 PM
|
0
|
0
|
1306
|
POST
|
Dictionary .get() is great! You can also specify a default value (besides None) if the key is not found.
... View more
04-01-2021
01:54 PM
|
0
|
0
|
3858
|
POST
|
You could also use Calculate Field to do something simple like this. You can even script creating the new field if you need!
... View more
04-01-2021
07:25 AM
|
2
|
0
|
529
|
POST
|
Another way: fc = r'path/to/featureclass'
dateformat = '%Y-%m-%d'
datefields = [d.name for d in arcpy.ListFields(fc, field_type='Date')]
recs = []
with arcpy.da.SearchCursor(fc, ['OID@', 'TheDate']) as rows:
for row in rows:
recs += [r if f not in datefields else r.strftime(dateformat) for r, f in zip(row, rows.fields)]
print(recs) Or as a iterator: def datecursor(fc, dateformat, *args, **kwargs):
datefields = [d.name for d in arcpy.ListFields(fc, field_type='Date')]
with arcpy.da.SearchCursor(fc, *args, **kwargs) as rows:
for row in rows:
yield [r if f not in datefields else r.strftime(dateformat) for r, f in zip(row, rows.fields)]
fc = r'path/to/featureclass'
dateformat = '%Y-%m-%d'
recs = [row for row in datecursor(fc, dateformat, ['OID@', 'TheDate'])]
... View more
03-26-2021
03:14 AM
|
0
|
0
|
1742
|
POST
|
There was quite the controversy surrounding it initially
... View more
03-22-2021
08:54 AM
|
0
|
0
|
228
|
POST
|
Code worked and provided the correct output after changing it from long to float. Thanks everybody!
... View more
03-18-2021
01:47 PM
|
0
|
0
|
650
|
POST
|
Here's a solution from @ReneRubalcava Solved: Re: When featurelayer done drawing - Esri Community
... View more
03-15-2021
07:32 AM
|
1
|
0
|
1200
|
POST
|
Sorry if I convolute this situation more for you @Mick , but I just want to add that you can use a wildcard argument with ListFiles() to only return txt files. import arcpy
import os
inPut = r'D:\Downloads\aatester'
arcpy.env.workspace = inPut
myList = arcpy.ListFiles("*.txt")
for fileName in myList:
out = os.path.join(inPut, f"{fileName[:-4]}.txt")
print(out)
with open(out, "a") as k:
k.write('Hellow') Additionally, I updated your path construction to use os.path.join() so it reliably does the separator. You will also notice the f string formatting for the file name. This will function the same but I just wanted to demonstrate there are multiple ways to accomplish something.
... View more
03-12-2021
06:54 AM
|
1
|
0
|
387
|
POST
|
Sorry, I misinterpreted the use case. I think that using a self-hosted resource proxy as described in the 'Application login' section would be an option. The calls to the secure service from the public app would go through the proxy.
... View more
03-10-2021
03:22 PM
|
0
|
0
|
1227
|
POST
|
An address from a form is just a string. You will need to geocode it to determine the actual spatial location (geometry) in order to perform geometry operations with it, like testing if it's located inside a polygon.
... View more
03-10-2021
11:11 AM
|
0
|
0
|
1136
|
DOC
|
@JakeSkinner yes I used your code as is, with my micro tweaks as described above, so I was writing to your file geodatabase... It worked for me. I too have discovered that multiprocessing is not always faster, I think there is a big hit on instantiating the geoprocessor, tool validation etc; so you only get a performance boost if what you are splitting out inherently has a long run time (e.g. munching some large raster dataset). Weirdly only today I was looking at manifold.net ...
... View more
03-10-2021
08:50 AM
|
0
|
0
|
7082
|
POST
|
Oops, I had forgotten a folder name in the path. Thank you so much for all your help!!
... View more
03-09-2021
07:07 AM
|
0
|
0
|
448
|
POST
|
Thank you! I ended up doing something a little different because even when I changed my fieldnames to be the appropriate format, it was throwing an error. Here's what I came up with: # Calculate sum field for sum of all values
crop_table_all = r'E:\FATHOM\2020FATHOM\Analysis\MR_cropscape_2016_FPstats_02062021.gdb\Cropscape_MR_floodplain_statsALL'
cropfieldlist = [f.name for f in arcpy.ListFields(crop_table_all,"VALUE_*","")]
print (cropfieldlist)
fieldName1 = "VALUE_SUM"
arcpy.AddField_management(crop_table_all, fieldName1, "DOUBLE","", "", "", "", "")
with arcpy.da.UpdateCursor(crop_table_all, cropfieldlist) as cursor:
for row in cursor:
row[-1] = sum(row[:-2])
cursor.updateRow(row)
fieldName5 = "Pct_Ag_Cropscape_FATHOM"
fieldName2 = "Pct_AgPlus_FATHOM"
fieldName3 = "Pct_Natural_FATHOM"
fieldName4 = "Pct_Developed_FATHOM"
fieldName6 = "Pct_Disturbed_FATHOM"
arcpy.AddField_management(crop_table_all, fieldName5, "DOUBLE","", "", "", "", "")
arcpy.AddField_management(crop_table_all, fieldName2, "DOUBLE","", "", "", "", "")
arcpy.AddField_management(crop_table_all, fieldName3, "DOUBLE","", "", "", "", "")
arcpy.AddField_management(crop_table_all, fieldName4, "DOUBLE","", "", "", "", "")
arcpy.AddField_management(crop_table_all, fieldName6, "DOUBLE","", "", "", "", "")
expression2 = "((!Value_1! + !Value_2! + !Value_3! + !Value_5! + !Value_12! + !Value_13! + !Value_42! + !Value_26! + !Value_52! + !Value_225! + !Value_226! + !Value_228! + !Value_232! + !Value_237! + !Value_238! + !Value_239! + !Value_240! +!Value_241! + !Value_254!) / (!VALUE_sum!)) *100"
expression3 = "(( !Value_111!+ !Value_131!+ !Value_141!+ !Value_142!+ !Value_143!+ !Value_152!+ !Value_190!+ !Value_195!) / (!VALUE_sum!)) *100"
expression4 = "((!VALUE_121!+!VALUE_122!+!VALUE_123!+ !VALUE_124!) / (!VALUE_sum!)) *100"
expression5 = "100 - (!Pct_Natural_FATHOM! + !Pct_Disturbed_FATHOM!)"
expression6 = "(!Pct_Ag_Cropscape_FATHOM! + !Pct_Developed_FATHOM!)"
arcpy.CalculateField_management(crop_table_all, fieldName5, expression5, "PYTHON_9.3")
arcpy.CalculateField_management(crop_table_all, fieldName2, expression2, "PYTHON_9.3")
arcpy.CalculateField_management(crop_table_all, fieldName3, expression3, "PYTHON_9.3")
arcpy.CalculateField_management(crop_table_all, fieldName4, expression4, "PYTHON_9.3")
arcpy.CalculateField_management(crop_table_all, fieldName6, expression6, "PYTHON_9.3")
... View more
03-01-2021
07:22 AM
|
0
|
0
|
3078
|
POST
|
I'm getting undefined error for pausable watchUtils.pausable(layerView,"updating",(val:any)=>{ console.log("**** WATCH UTIL PAUSABLE *****",val); });
... View more
02-25-2021
12:00 AM
|
0
|
0
|
883
|
Title | Kudos | Posted |
---|---|---|
4 | yesterday | |
1 | a week ago | |
1 | Friday | |
2 | a week ago | |
1 | a week ago |