|
POST
|
Hi Jared Pilbeam , Is it possible to share the data? This will make it a lot easier to create the expression that matches the entire data.
... View more
06-23-2020
06:09 AM
|
0
|
9
|
4160
|
|
POST
|
Hi Andres Echeverri , I just did some testing and although Arcade can return an array or a featureset, to create a diagram in the pop-up you will need to return a number. However, a single number does not make much sense for creating a diagram. When I returned a featureset or an array it did not recognize the result and it could not be used to create a diagram.
... View more
06-23-2020
06:07 AM
|
2
|
9
|
21785
|
|
BLOG
|
Hi avezina-esristaff , great resource and thanks for sharing! Is there any ETA on when the other parts will be available?
... View more
06-18-2020
07:06 AM
|
1
|
0
|
7441
|
|
POST
|
Hi Russell Gibson , For ArcGIS Pro there is a support article indicating how to create the label classes and apply the correct symbology: How To: Label highways with a shield marker containing the highway number in ArcGIS Pro . In ArcGIS Online, this is a lot more restricted. In the current web map you cannot create label classes and labeling of lines is restricted to a text. The new (beta) web map does allow you to create label classes, but still you can only create a text for a line. You will need points (which will make it difficult to show the correct one depending the view scale and extent) and place a label on top of it. I don't see how it would be possible to do this correctly in ArcGIS Online. Maybe there is a service in the Living Atlas that contains the highway shields that you can consume directly.
... View more
06-17-2020
03:59 PM
|
0
|
0
|
1754
|
|
POST
|
Hi Michaila Musman , From what I understand, you don't need to access the Water_# fields to get the last date and you don't need them to determine the water status that you are after. So the expression that you already had should solve the problem. Below a slightly changed version: // check if dead
if (DomainName($feature,"Mntc_Condn") == "Dead") {
return "Dead";
}
// check is you have a last date
var last_water = $feature["Last_Water"];
if (IsEmpty(last_water)) {
return "N/A";
}
var result = "";
var days = DateDiff(Now(), last_water, "days");
if (days <= 14) {
result = "Watered";
} else if (days > 14) {
result = "Needs Water (" + $feature["plt_year"] + ")";
}
return result; If you want to do some statistics over the water_# fields you can use the expression below to play around: function GetStats(arr, stat) {
// Get stats and ignore Null values in array
var result = Null;
if (Upper(stat) == "MIN") {
// calculate min
for (var i in arr) {
if (!IsEmpty(arr[i])) {
if (IsEmpty(result)) {
result = arr[i];
} else {
if (arr[i] < result) {
result = arr[i];
}
}
}
}
} else if (Upper(stat) == "MAX") {
// calculate max
for (var i in arr) {
if (!IsEmpty(arr[i])) {
if (IsEmpty(result)) {
result = arr[i];
} else {
if (arr[i] > result) {
result = arr[i];
}
}
}
}
} else if (Upper(stat) == "COUNT") {
// count elements that are not null
for (var i in arr) {
if (!IsEmpty(arr[i])) {
if (IsEmpty(result)) {
result = 1;
} else {
result += 1;
}
}
}
} else {
Console("Invalid statistic...");
}
return result;
}
// Define some dates (you would read those from the Water_# fields directly)
var date1 = Date(2020, 7, 1);
var date2 = Date(2020, 1, 2);
var date3 = Date(2020, 2, 3);
var date4 = Null;
var date5 = Date(2020, 4, 5);
// create an array with the dates
var dates = [date1, date2, date3, date4, date5];
// calculate some statistics and print to the console
Console(GetStats(dates, "min"));
Console(GetStats(dates, "max"));
Console(GetStats(dates, "count"));
return "OK";
... View more
06-17-2020
03:16 PM
|
0
|
0
|
1119
|
|
POST
|
Hi Tyson TM , When you calculate a field in ArcGIS Pro you have access to the FeatureSetBy* functions which you can use to access the featureset and use it in the Min and Max functions of Arcade. Before: After: Arcade expression: var fs = FeatureSetByName($datastore, "BojacaRNI_puntos");
return 1/ (MAX(fs, "CampoEM") - MIN(fs, "CampoEM")); You can use either $datastore with the name of the featureclass or $map with the name in the TOC. Remember that the Min and Max functions take two parameters (the featureset and the fieldname).
... View more
06-17-2020
02:21 PM
|
2
|
0
|
6752
|
|
POST
|
Hi jpilbeam , From the subset of data is is hard to suggest a way to obtain the result. From what I see you can take the first word from he USER_categ field, but since I can only see the first part, it is unclear if this will work.
... View more
06-17-2020
12:53 PM
|
0
|
14
|
4161
|
|
POST
|
Hi Michaila Musman , I am not sure what you mean exactly when you say "assign each new date field a variable and repeat the If else format". Can you explain what your schema looks like at this moment (especially what date fields you have up to now)? I hope you are not going to create a new field to store another date and maintain the history of each visit date. I assume you need to have information on the last date the tree was watered and comparing that with the current date will provide information on how long ago the tree was watered. However, a tree that was watered 5 days ago might not be in good conditions if the times before it wasn't watered in a long time. Are you sure you don't need that history?
... View more
06-16-2020
02:53 PM
|
0
|
2
|
1119
|
|
POST
|
Hi GibbyAR , Although not exactly what you are looking for (pop-up and not label), the example by Esri Netherlands is pretty cool: Combining Arcade and HTML for a Real-life Pop-up Display What exactly are you looking for?
... View more
06-11-2020
04:28 PM
|
2
|
2
|
1754
|
|
POST
|
Hi Andy H , I think I found what you are looking for. Let's say that we have a featurelayer with 3 types of outages (see values A, B and C in field Outage Type) and the data when the outage was reported (field Outage Date): When the Outage Type is "B" the color should vary from yellow to orange to red, where red indicate that most time has passed. Like this: To get there you will nee to do the following. First define the symbology based on the outage type and assign the green and white colors to A and C. Then you will have to go into the second tap "vary the symbology by attribute": To be able to create the colors for outage type "B", you will have enable the option "Allow symbol property connections": When you do this, you can now create the color effect for outage type B based on the date. Click on the symbol for outage type B: You will now be able to enter the properties, and activate the layers and to the right hand side you will see a grey icon that will allow you to define how to vary in this case the color. In my case the symbol is already blue since I already defined the attribute mapping: This will open an interface where you can select an existing field or you can define an Arcade expression. I use the Arcade expression to define the scale of colors: Since the colors should vary from yellow (most recent outages) to red (most dated outages) you can use the DateDiff function to calculate the difference between the current date and the date stored in the Outage Date field. Since to go from yellow, through orange to red you just vary the green intensity from 255 to 0, you can use a simple calculation. In my case my maximum time was 11 days so I divide the calculated days by 11 invert the result and multiply by 255. Then I construct the text to return "rgb(255, green, 0)" and that is all. If your green value will be out of the range from 0 to 255, it will be limited to 0 - 255. Example Arcade expression: var days = Abs(DateDiff(Now(), $feature.OutageDate, "days"));
var green = Round((1.0 - (days / 11.0)) * 255,0);
return "rgb(255," + green + ",0)"; Let me know if you run into any problems.
... View more
06-11-2020
03:23 PM
|
4
|
3
|
7745
|
|
POST
|
Hi Roger Cleaves , Thanks for sharing the blog, which is indeed a nice example of processing related data but this question is related to a specific version of ArcGIS Enterprise and I think the post is based on AGOL.
... View more
06-11-2020
02:24 PM
|
0
|
0
|
9550
|
|
POST
|
Hi soldstatic , It sounds a lot like you are trying to use Attribute-driven color in symbology—ArcGIS Pro | Documentation . I have seen that there were some problems in the past, but I have the idea that this should be working now. Let me test something out and I will get back to you.
... View more
06-11-2020
02:20 PM
|
0
|
4
|
7745
|
|
POST
|
Hi PGvandenBeukelesri-nl-esridist , There are a couple of options. I recommend you to check out the blog post by Paul Barker: Visualizing related data with Join Features in ArcGIS Online . You can use Arcade to access related data a fill values in a field (using the field calculator). The FeatureSetBy functions are not available in the symbology profile though, so you need to calculate the field. This can be done by scheduling a tool in ArcGIS Pro or schedule a notebook in Enterprise. You can also use Attribute rules and use a trigger that will update a field in the featureclass when the related data is changed. This will require an Enterprise GDB or a FGDB (not available in AGOL at this moment).
... View more
06-11-2020
02:16 PM
|
1
|
0
|
5337
|
|
POST
|
Hi klivi001FPUA , Please keep in mind that ArcMap + Attribute Assistant is being replaced by ArcGIS Pro + Attribute Rules. At some point you will want to start moving things over.
... View more
06-11-2020
06:29 AM
|
1
|
1
|
2967
|
|
POST
|
Hi Andy H , Although you mention that you want to create a color based on the attributes; outages vs non-outages and time of the outage, you can also create an expression that returns a classified value (non-outage, outage time range 1, outage time range 2, etc) and assign the symbology accordingly. Would that be something you are after or do you have to manipulate the color directly by Arcade?
... View more
06-11-2020
05:56 AM
|
2
|
6
|
7745
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-09-2020 09:26 AM | |
| 6 | 12-20-2019 08:41 AM | |
| 1 | 01-21-2020 07:21 AM | |
| 2 | 01-30-2020 12:46 PM | |
| 1 | 05-30-2019 08:24 AM |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|