POST
|
Thanks so much and appreciate it on the testing. I'm a bit of an Island in our organization. The table screenshot above was from ArcGIS Pro so the first few values in the AKCreationDate wrote with the 8 hour offset from UTC datetime which was perfect. I found that out on AGOL/web maps with the data displaying with local browser and its just easier on my part for processing data and dashboards to also have an AKCreationDate field. Usually I would have python script tool that updates the fields (using the code below), but thought I would try to make use of the arcade calculated expressions this go around. So one step forward but also backward if the data isn't accurate for what I intended. with arcpy.da.UpdateCursor(value, ["CreationDate", "AKCreationDate", "AKDate","ManagementArea"], 'OBJECTID = ' + str(oid)) as tbl:
for r in tbl:
utc = r[0]
arcpy.AddMessage(str(utc))
ak = utc.replace(tzinfo=pytz.UTC)
r[1] = ak.astimezone(pytz.timezone(AKzone))
r[2] = r[1].strftime('%m/%d/%y')
... View more
04-11-2023
09:55 AM
|
0
|
0
|
2688
|
POST
|
Thanks for the reply. I believe I commented it out, because I felt like 'ToLocal' wasn't working 'offline'. If Now provides the value in the local system of the client, why add the ToLocal(Now())? In reviewing the expressions, for one of the layers I have the following expression. Ideally all I want is the local time of the CreationDate that will work offline and not change when syncing offline edits. The screenshot below shows the arcade expression and resulting datetime in Alaska or that was my goal. You can see the location Fix Time in UTC. The first few records in AKCreationDate look good, but we have a boat using Starlink so they are basically connected. Then the other records match the fix time and those were collected offline and those values were not converted to local datetime which leads me to believe ToLocal does not work offline. var dt_now_utc = Timestamp()
var akdt = ToLocal(dt_now_utc)
if (IsEmpty($feature.AKCreationDate)){
return akdt;
}else{
return akdt;
}
... View more
04-11-2023
08:46 AM
|
0
|
7
|
2699
|
POST
|
Good Morning, We publish our AGOL hosted feature layers with a UTC date/time knowing then the CreationDate and EditDates will be in UTC. In addition, we have been adding a local DateTime field that gets calculated based on the CreationDate field usually in a post-survey script process. Now with arcade expressions, I wanted to use this functionality to auto-populate these fields, but I'm seeing discrepancies for what displays on the iPads then what writes to the AGOL feature layer tables. Also if the calculations recalculate when offline data is synced, then that is another consideration as posted here: Below is one version I have started out with, which displays accurately in Field Maps in the layer form on the tablet, but when the data is synced from offline the date writes to the feature layer table in UTC. //var dt_now_utc = Timestamp()
var akdt = Now()
//var akdt = ToLocal(dt_now_utc)
if (IsEmpty($feature.AKCreationDate)){
return akdt;
}else{
return akdt;
} I have also tried to this which writes to the feature layer tables better (although if it recalculates when the offline edits sync, then this no longer works). This also isn't great because it displays in the tablet 8 hours behind the current time which doesn't look accurate even though it is writing to the tables accurately. var dt_now_utc = Timestamp()
var akdt = DateAdd(dt_now_utc, -8, 'Hours')
if (IsEmpty($feature.AKCreationDate)){
return akdt;
}else{
return akdt;
} What is the recommended arcade functions to get a local data time field to calculate using arcade expressions with offline data collection and for the data to be accurate when offline edits sync, do these values update then to the local time I think they do change. Thanks in advance!, Kathy
... View more
04-10-2023
09:39 AM
|
0
|
9
|
2784
|
POST
|
Hi, In a few Field Maps forms we have added arcade calculations and work offline. For one of the calculations, it was querying the layers for a max value (which I ended up changing the logic since offline this value is different than online). Anyway what a few users experienced is the feature/form offline would populate and they would submit their edits. The points show on the map, but then when they would sync the offline edits the one field with this 'maximum' calculation changed which in our case was the sample number/label on the map so it was an obvious change. This didn't make sense except if the form recalculates when syncing? Thanks for the info!, Kathy
... View more
04-07-2023
05:29 PM
|
4
|
0
|
880
|
POST
|
Hi!, I'm still running into issues with the code above in ArcGIS Pro 3.0.3 although it seems to work for 1 polyline layer and not another? In the code below, the second line with .sdf will work and not throw an error, but the original code statement like your example throws an error. Can you help translate why this would be? Another weird thing happening, is when the code calculates the length, it is changing the CreationDate/EditDate fields or actually all DateTime fields which I don't remember happening. thanks for any insight/translation? 🙂 #df = lyr.query(where = "LENGTH_NM IS NULL", out_sr = 26931, as_df=True)
df = lyr.query(where = "LENGTH_NM IS NULL", out_sr = 26931).sdf
... View more
04-01-2023
04:17 PM
|
0
|
0
|
2931
|
POST
|
Hello, As noted by others posting recently and I also had an incident yesterday luckily a user was just testing, but if arcade expressions fail in the Field Maps form this does prevent a user from submitting that feature. PLEASE modify the app to STILL ALLOW a feature to be submitted if a calculation is failing in the form. Expressions are great, I tested in the Designer and worked great but we work offline and use the app for aerial surveys, so its an expensive fail if we can't collect data based on a calculation failing. The Field Maps Designer would also benefit from having an offline tester so folks KNOW which expressions also work offline. The issue is also noted in this post. I want to use the expressions, but need reliability in data collection. Thanks, Kathy
... View more
03-14-2023
07:18 AM
|
2
|
0
|
485
|
POST
|
Hi, I have similar expressions set up and we are just going to be starting offline surveys. When you say the expressions don't always calculate do they show consistently with the red message 'failed to calculate' in the layer form? How are you downloading/creating the offline map areas? We did recently log a bug/defect in that the offline map generated from the AGOL web map settings, when we opened the form 2 of the calculated expressions did not work. However when we download an offline map using the device to create the offline map these expressions DO work. So something is happening when the maps are packaged up. Also we are using AGOL and iOS, what environment and device are you using? We work 100% offline and this is the first go of using these expressions in all the layer forms, so I'm hoping they are reliable, but at the same time already logged a defect. Thanks, Kathy
... View more
03-13-2023
08:52 AM
|
0
|
1
|
1361
|
POST
|
Update: As it turns out, I had a bad install of ArcGIS Pro. An uninstall/install solved both the missing packages in the package manager on this post (https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-pro-3-1-0-arcgis-package-does-not-show-in/m-p/1266840#M8488) The code above now works too! which is great but just wish I would have realized something wasn't right on the install earlier.
... View more
03-11-2023
08:15 AM
|
0
|
0
|
3035
|
POST
|
Ok, yes I had a bad install. The uninstall/reinstall now show the arcgis and arcpy packages and the code error now works as well. I wish I would have figured this out days ago. Thanks!
... View more
03-11-2023
08:06 AM
|
0
|
0
|
2990
|
POST
|
Thanks Dan. I just searched 'Add Packages' there is no arcgis or even arcpy showing up as an option. Seems odd? I know I didn't have to add them in on the 2.9 install. Do you think this is causing the code above to throw an error or just another issue. thanks, Kathy
... View more
03-10-2023
06:57 PM
|
0
|
0
|
3031
|
POST
|
Hello, I recently installed ArcGIS Pro 3.1.0 and in the Package Manager I do not see the argis package? I wanted to see what version is installed and I'm not seeing it (screenshot attached)? I've searched and nothing shows in the search? I'm still very much learning on the API but this seemed odd. In looking at another computer with ArcGIS Pro 2.9.5 in the installed packages list I see arcgis 1.9.1 I'm currently having an issue with the following statement in a python script tool/notebook and I'm wondering if the issues are related? lyr.edit_features(updates = df.spatial.to_featureset()) I had also tried to clone the conda environment using the package manager and command line both ways fail. Thanks in advance! Kathy
... View more
03-10-2023
05:22 PM
|
0
|
6
|
3060
|
POST
|
Hi @jcarlson , I was so excited last year to see your posts and have been using the code examples to query and edit an AGOL item to update the polyline length. Or I was until recently and now the code is throwing an error. After too many hours today, I upgraded my ArcGIS Pro version to the latest which fixed one error, but now I'm onto to a new one. I'm using ArcGIS Pro 3.1.0 and default conda environment, but I tried an older version of ArcGIS Pro 2.9.5 with arcgis 1.9.1 and the same code works there. lyr = gis.content.get('xxxxxxxxxxxxxxxxxxxxxxxxxxxxx').layers[2]
df = lyr.query(where = "LENGTH_NM IS NULL",out_sr = 26931, as_df=True)
gsa = GeoSeriesAccessor(df['SHAPE'])
df['LENGTH_NM'] = gsa.get_length('PLANAR', 'NAUTICALMILES')
df
lyr.edit_features(updates = df.spatial.to_featureset()) This code does calculate the length of the polyline but fails on the edit statement. Would you have any ideas why? It worked last year and still works on the Pro 2.9.5 environment. It was amazing to be able to calculate length in the other projection. Did the edit_features syntax change in the latest version? When the above runs in a notebook and a python script tool within ArcGIS Pro, the same error results "ValueError: StringArray requires a sequence of strings or pandas.NA" I've attached a screenshot. Thanks in advance!, Kathy
... View more
03-07-2023
04:17 PM
|
0
|
2
|
3087
|
IDEA
|
Hi @BrentPierce, In one of your posts above you write "It's a little too early to speculate when this will be available, but recently versions of Windows11 which support the Windows Subsystem for Android, are generally available outside of the insider program, we are in a pretty good spot. " Am I understanding correctly that if a person had a tablet with Windows 11 and that supports the 'Windows Subsystem for Android' folks could install Field Maps for Android and be able to use outside of the Early Adopter Program? Thanks for the clarification, Kathy
... View more
03-03-2023
12:32 PM
|
0
|
0
|
1775
|
POST
|
BUG Logged Esri tech support was able to reproduce the issue where the arcade expression fails in the AGOL webmap settings generated offline map but the expression works in an offline map generated from the device. In our case we are using iOS, so I'm not sure of other systems. BUG-000155887 has the details, so hopefully the developers can fix soon as for our organization we prefer to have the pre-planned offline maps available for download rather than having the surveyor generate their own area. Also lesson learned, if an expression calculates online and then doesn't in the offline map try both the AGOL generated offline maps and the device because there are differences on how these are generated. Thanks
... View more
03-02-2023
08:49 AM
|
0
|
1
|
4481
|
POST
|
Hi @Chess , I am running into the similar http messages trying to clone the default python environment ArcGIS Pro 3.0. I've tried both the package manager and also command line instructions similar to the above but listed below. Both are throwing the same http errors. Did you get this resolved/find a work around? How To: Clone a Python environment with the Python Command Prompt (esri.com) Thanks in advance, Kathy
... View more
03-01-2023
10:06 AM
|
0
|
0
|
3906
|
Title | Kudos | Posted |
---|---|---|
2 | 11-29-2024 09:19 AM | |
1 | 12-16-2024 03:52 PM | |
1 | 12-17-2024 08:11 AM | |
1 | 12-02-2022 03:16 PM | |
1 | 11-23-2024 04:48 PM |
Online Status |
Offline
|
Date Last Visited |
12-20-2024
11:31 PM
|