|
IDEA
|
@JoeBryant1 Glad I'm not the only one with this issue! Seems like a big (but obvious) gap in functionality to me.
... View more
08-22-2023
05:26 PM
|
0
|
0
|
2223
|
|
IDEA
|
I agree that sometimes it would be useful to be able to edit a pre-calculated value. In our use cases it would be that the field returns the users Name or ID, but sometimes they might be filling it out on behalf of someone else and would need to change the name to someone elses. @JoshuaFlickinger in your current situation where the accuracy isn't good enough to make the intersection - have you considered adding a buffer to the intersection? It would act like adding a search distance. You can also add an IIF statement to return "Unknown" instead of the first random value if it fails to find a search. The buffer would be useful if there's enough space between plots to ensure that you can still find the one you need within a reasonable tolerance. I've listed a code I use below for you to review. var BufferedFeature = Buffer($feature, 20, 'meters') //Adds 20 metre buffer to the feature geometry before intersecting
var intersectLayer1 = Intersects(FeatureSetByName($map, 'FPC Plantations'),BufferedFeature) //Searches this layer 1st.
var intersectLayer2 = Intersects(FeatureSetByName($map, 'Planned Establishment Areas'),BufferedFeature) //If no value found above, searches this layer
//Search of Layer 1 - returns value in field "Name" - if empty, then runs search on Layer 2
for(var f in intersectLayer1) {
if(!IsEmpty(f.Name)) {
return f.name
}
}
//Search of Layer 2 - returns value in field "Name" - if empty, then returns "Unknown"
for(var f in intersectLayer2) {
if(!IsEmpty(f.Name)) {
return f.Name
}
}
return "Unknown"
... View more
08-22-2023
05:20 PM
|
0
|
0
|
7756
|
|
IDEA
|
Maybe have a look at the GeoJobe software - they offer tools to do this sort of thing. Might be something you could setup on a short term arrangement to enable organisation setup then deactivate.
... View more
08-21-2023
05:07 PM
|
0
|
0
|
3038
|
|
POST
|
Thanks for the additional info. I can confirm for us it's the feature storage (and thus geometry) and offline replicas. We do have attachments on some layers but it's minimal compared to what many would have happening. We have been downloading the csv to review and track changes to individual feature services after trying different things. Trimming the change log for just our top 3 layers has saved us nearly 7GB! Feature Service MB (14/08) MB (15/08) Change (15/08) MB (16/08) Change (16/08) MB (17/08) Change (17/08) FS 1 3604.9 3555.5 -49.4 3555.5 -49.4 1218.0 -2386.9 FS 2 3318.8 3318.8 0.0 3318.8 0.0 692.3 -2626.5 FS 3 2028.8 2028.8 0.0 2028.8 0.0 146.1 -1882.7
... View more
08-16-2023
08:01 PM
|
2
|
0
|
1101
|
|
POST
|
A bit of context from our org summary: Thankfully we already use Views for the majority of feature services in our maps. I've just gone through and done some Change Log Trimming to see if that makes any difference of significance on the 3 largest feature services. I'm hoping it does! We're also assessing what data we have in AGOL which may not be getting utilised enough to warrant the storage and removing where we can in full.
... View more
08-16-2023
07:35 PM
|
1
|
2
|
6347
|
|
POST
|
We're stuggling to reduce our credit consumption too at present. Ours is all around feature service storage (no analysis) and it seems that a lot of it is from 3 or 4 layers that have a lot of offline replicas (most of our data is offline enabled). Is there any way of reducing the consumption from those services without breaking the offline connections in our field staff offline maps?
... View more
08-16-2023
05:42 PM
|
0
|
4
|
6350
|
|
POST
|
Thanks for your explanation. I've accepted it as the solution, because I'm sure it works as you've stated - just not in my particular case as the 2 layers are not in the same database. Will think on it some more to see if I can work around that, but for now, will accept a manual step in my map automation process! I'm sure this code will still prove useful in the future!
... View more
08-09-2023
05:31 PM
|
0
|
0
|
4367
|
|
POST
|
Correct, and I would do this if it were a one off project - my desire is to create an automated solution for a template which can be opened, a definition query set for a plantation, zoom to the plantation and the layout information updates automatically based on the returned information. We have dynamic text returning simple information from visible rows of that layer (i.e. Plantation Name), but this obviously extends to other layers that we want to return information for, but require further filtering beyond the simple "Visible Rows" setting.
... View more
08-08-2023
05:05 PM
|
0
|
2
|
4394
|
|
POST
|
I'd like to add some dynamic text to a layout that returns attribute values from a layer, but instead of returning all values, visible values or values from an expression, I would like to try write an arcade expression that only returns values where the source layer intersects with another layer which has a filter applied to it. My example would be returning Lot numbers from a Land Parcel layer for lots that have plantation areas on them, and not the neighbouring lots. I've tried using Intersects() and the $map and $datastore profiles to lookup my plantation layer, but my understanding is the dynamic text doesn't recognise the $map profile and the $datastore profile only returns layers in a feature service. I've also looked at including a dynamic table, but I can't format that to read as text, and also can't remove duplicate values.
... View more
08-07-2023
07:16 PM
|
2
|
6
|
4491
|
|
BLOG
|
@ChrisDunn1 Perfect! My complete code below. I tested you're suggestion with the Rounding included at Line 22 in addition to your rounding step, and without the rounding at Line 22 (and just using yours). It looks like it works best with just yours in place (returns different results - I suspect double rounding skewing the results with both steps). //Refer to https://community.esri.com/t5/arcgis-field-maps-blog/field-maps-tips-amp-tricks-using-arcade-to-find/bc-p/1314058 for details on the below script
//Requires that the FPC Plantations layer is also present in the map or lookups won't work
//Return Plantations
var BufferedFeature = Buffer($feature, -10, 'meters')
var Plantations = OrderBy(Intersects(BufferedFeature, FeatureSetByName($map, "FPC Plantations")), 'Plantation')
//Hide element if no data is found
if (count(Plantations)<1){
return null
}
//Create empty array for LGA use codes and dictionary for field values
var ptns = []
var ptns_d = Dictionary()
//Iterate and add to dictionary, adding to value if key exists
for (var p in Plantations) {
//Intersect the selected feature with the current iterated feature
var LGA = Intersection($feature, p)
//Set variables for LGA use and area
var p_name = p.Plantation
var p_area = p.AreaHa //AreaGeodetic(LGA, "hectares") <--- use this to calculate and area instead of pulling an area from the attribute table. Set rounding at Line 45
//Check for LGA use key in dict
if (HasKey(ptns_d, p_name)==true) {
//If the LGA use code is in the dictionary, get the area from the dictionary and add the current area to it
var current_area = ptns_d[p_name]
var total_area = current_area + p_area
ptns_d[p_name] = total_area
} else {
//If the LGA use code is not in the dictionary, add it with the current area
ptns_d[p_name] = p_area
Push(ptns,
{"fieldName":p_name})
}
}
var ptns_ha = Dictionary()
for (var k in ptns_d) {
var round_area = Text(ptns_d[k], '#') //Rounds the number to whole figures. To round to a decimal, use #.0 which also pads the rounded figures with ".0" when value rounds to a whole number
ptns_ha[k] = round_area + " ha"
}
return {
type: 'fields',
title: 'Plantations in LGA',
description : 'Plantation Name | Plantation Area (Hectares)',
fieldInfos: ptns,
attributes : ptns_ha
} Incorrect sums: Correct sums: Thanks again both @KerriRasmussen and @ChrisDunn1 for your help. This stuff is really useful and I can see it being used more and more in our ArcGIS Online space!
... View more
08-01-2023
10:56 PM
|
1
|
0
|
2812
|
|
BLOG
|
@KerriRasmussen Thank you for your response! I've implemented the sorting and that works perfectly. I'm struggling with the addition of the " Ha" suffix bit though (not sure where I'm putting it). Regarding the rounding solution, I just wanted to clarify something on my original post. The AreaHa field I'm using is actually a static area figure (calculated in ArcGIS Pro using a different projection) and not an auto-calculated field (like Shape_Area). This was our preference so that the areas returned in the popup match what is calculated and reported on in our plantation database. When I try your solution rounding to 1 decimal, it still gives the same results as per below, which is the same as if I use my static attributes (despite them only containing 1 decimal to start with - sample data at bottom).
... View more
07-31-2023
05:42 PM
|
0
|
0
|
2859
|
|
BLOG
|
Hi @KerriRasmussen. My code is below. You'll see that I've swapped most references to land use to Plantation Name (the layer and list field are both called "Plantation" with my Area field being "AreaHa"). You'll see that I've swapped out the Area calculation for summing an area field within my attribute table (to provide consistent results with other reports). I've also included a negative buffer at the beginning to prevent features that slightly overlap LGA boundaries being counted where they shouldn't be. //Return Plantations
var BufferedFeature = Buffer($feature, -10, 'meters')
var Plantations = Intersects(BufferedFeature, FeatureSetByName($map, "FPC Plantations"))
//Hide element if no data is found
if (count(Plantations)<1){
return null
}
//Create empty array for LGA use codes and dictionary for field values
var ptns = []
var ptns_d = Dictionary()
//Iterate and add to dictionary, adding to value if key exists
for (var p in Plantations) {
//Intersect the selected feature with the current iterated feature
var LGA = Intersection($feature, p)
//Set variables for LGA use and area
var p_name = p.Plantation
var p_area = Round(p.AreaHa,0) //Round(AreaGeodetic(LGA, "hectares"),0)
//Check for LGA use key in dict
if (HasKey(ptns_d, p_name)==true) {
//If the LGA use code is in the dictionary, get the area from the dictionary and add the current area to it
var current_area = ptns_d[p_name]
var total_area = current_area + p_area
ptns_d[p_name] = total_area
} else {
//If the LGA use code is not in the dictionary, add it with the current area
ptns_d[p_name] = p_area
Push(ptns,
{"fieldName":p_name})
}
}
return {
type: 'fields',
title: 'Plantations in LGA',
description : 'Plantation Name | Plantation Area (Hectares)',
fieldInfos: ptns,
attributes : ptns_d
} An additional comment on my above issues around the " Ha" suffix to the results is that where I have Rounded the figures to 0 decimals, I was trying to do it to 1 decimal, but found some results would still come out with 6(?) decimals. Also, that Rounding had to happen by feature (Line 22) instead of on the overall outcome (Line 33) as that also had unpredictable results with some lines being rounded and some not. Rounding to 0 decimals was the only way of getting consistent results for all records returned. It would be good to pad with 0's as well if rounded to 1 decimal, but fear I'd run into a similar problem to the above " Ha" suffix and the summing of values by formatting the text result #.# but haven't tried it.
... View more
07-30-2023
07:18 PM
|
3
|
0
|
2904
|
|
BLOG
|
So I've been experimenting with your code. I've managed to get it to return a list of Plantations within an LGA, but I'm guessing it's returning them ordered by first feature found - any chance we could sort the results alphabetically? I've also experimented with adding text to the end of the area value returned, but each location I've tried adding text to the end of the returned value (Lines 21, 32 or 43) has just resulted in the Summing or Value return not working properly. I'm currently stuck with the total number. (i.e. want to format the returned area as "100 Ha" to represent Hectares instead of just "100").
... View more
07-27-2023
09:45 PM
|
0
|
0
|
2942
|
|
POST
|
Thanks for the pointer. I just went through and updated all our lists (added, removed and saved) and tried to export again, and no joy 😞
... View more
07-25-2023
06:31 PM
|
0
|
0
|
3123
|
|
POST
|
I should have mentioned that additional information - yes, all our other services (around 100 of them) download as expected, and this issue has been occurring for a couple of months - I just haven't been able to dig into it before now. So don't think it's a "temporary" glitch as you've described, and also don't believe it to be a a problem on our end - though I'll still try your Developer Tools suggestion to see if it captures errors from the other end.
... View more
07-25-2023
12:50 AM
|
0
|
0
|
3141
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | yesterday | |
| 2 | 2 weeks ago | |
| 2 | 2 weeks ago | |
| 4 | 2 weeks ago | |
| 1 | 2 weeks ago |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|