|
POST
|
And as an aside, didn't the sample pages used to have a feedback mechanism, similar to the "Was this page helpful?" link in the lower right corner in the API reference pages? Clicking Yes or No provided a dialog so you could send an email about an issue on the page.
... View more
yesterday
|
0
|
0
|
73
|
|
POST
|
Have you checked the distance attribute for those other features? You'll only get returns if the values exactly match 200, 400, or 600.
... View more
Tuesday
|
0
|
0
|
81
|
|
POST
|
When posting code, please use the "Insert/edit code sample" button. This makes it easier to read or copy your code. You can create a single feature from the roadlessIntersect FeatureSet and using that in the intersection with the speciesRanges FeatureSet. To do this, loop through the FeatureSet and add the features to an array. Use the Union function to create the single feature from that array. var roadlessIntersect = Intersects(RoadlessRule, $feature)
var features = []
for (var f in roadlessIntersect) {
Push(features, f)
}
var roadlessFeature = Union(features)
var speciesIntersect = Intersects(speciesRanges, roadlessFeature)
... View more
a week ago
|
0
|
0
|
18
|
|
POST
|
Esri can be frustrating like that sometimes! What was the final solution? You should click the "Accept as Solution" button in the post with the correct solution (even it was yours!). This will help others search for the same sort of answer.
... View more
a week ago
|
0
|
0
|
55
|
|
POST
|
The variable substitution sqlExpression in line 39 is not correct. You'd have to do something like this var globalId = p.globalid
var related = Filter(comments, "projectguid = @globalId");
... View more
3 weeks ago
|
1
|
1
|
179
|
|
POST
|
You can add an Arcade Element to your popup with this code. It loops through each field in the feature and returns only the fields that contain a value. This also includes a variable (exceptedFields) that contains fields you don't want to show in the field list. Note that those field names are case sensitive. Expects($feature, "*");
var fields = Schema($feature).fields;
var attributes = {};
var fieldInfos = [];
var exceptedFields = ["OBJECTID", "GlobalID"]; //case sensitive!
for (var f of fields) {
if (!Includes(exceptedFields, f.name)) {
if (Trim($feature[f.name]) != "") {
attributes[f.alias] = $feature[f.name];
Push(fieldInfos, { fieldName: f.alias });
}
}
}
return { type: "fields", fieldInfos: fieldInfos, attributes: attributes };
... View more
3 weeks ago
|
2
|
1
|
206
|
|
POST
|
You can use the GroupBy function to calculate this var fs = FeatureSetByPortalItem(
Portal("https://www.arcgis.com"),
"yourID",
0,
['County','Year', 'curr_enr','prev_enr'],
false
)
GroupBy(fs, ['County','Year','curr_enr','prev_enr'], {name: 'Change', expression: '(curr_enr - prev_enr)/prev_enr', statistic: 'Max'})
... View more
4 weeks ago
|
1
|
1
|
286
|
|
POST
|
Also note that you can make the When statement more concise var tod = When(hour >= 0 && hour <= 5, "Night",
hour <= 8, "Morning",
hour <= 15, "Day",
hour <= 23, "Evening",
Null
);
... View more
4 weeks ago
|
1
|
1
|
267
|
|
POST
|
Are you viewing this in Firefox? There have been reports of some issues with Firefox v145.0 That said, I'm seeing the Preview button on my machine using ExB DE 1.18 in both Firefox and Chrome.
... View more
a month ago
|
0
|
2
|
312
|
|
POST
|
You can write a function that returns the color for the attribute passed in as a parameter. function bgColor(attribute) {
when (attribute <= 70, "red",
attribute <= 80, "orange",
attribute <= 90, "yellow",
attribute <= 95, "green",
"blue")
}
//in use
var theColor = bgColor($feature.attribute)
... View more
a month ago
|
1
|
0
|
138
|
|
POST
|
It seems like there are some incompatibilities with the latest version of Firefox and Esri's products https://community.esri.com/t5/community-feedback/map-viewer-issues-when-using-firefox-version-145-0/m-p/1665688#M6016 https://community.esri.com/t5/arcgis-enterprise-portal-questions/issue-with-layer-widget-display-in-experience/m-p/1665001
... View more
a month ago
|
0
|
1
|
374
|
|
POST
|
OK, this should give you what you're trying to do, but I haven't tested it. It loops through each tract, gets the intersecting lakes for that tract, then gets the intersecting area for each lake. Then it gets the total lake count. Note that the area is rounded to two decimal places. It will take a while to process. You could test whether "Memorizing" the tracts and lakes layers makes it any faster. var port = Portal("https://www.arcgis.com");
// Load layers
var tracts = FeatureSetByPortalItem(port, "b9fcbedac0384e32bc3dba6aec1a8cf6", 0);
var lakes = FeatureSetByPortalItem(port, "5564b2e702364aefba08df8c95216a1f", 0, ["OrgKeyID"]);
var lakesfilt = Filter(lakes, "OrgKeyID > 0");
var totalAcres = 0;
var arrTracts = [];
for (var tract in tracts) {
var intersectingLakes = Intersects(lakesfilt, tract);
Push(arrTracts, tract);
for (var intersectingLake in intersectingLakes) {
var lakePart = Intersection(tract, intersectingLake);
totalAcres += Area(lakePart, "acres");
}
}
var lakeCount = Count(Intersects(lakesfilt, Union(arrTracts)))
return FeatureSet(
{
fields: [
{ name: "LakeCount", type: "esriFieldTypeInteger" },
{ name: "Acres", type: "esriFieldTypeDouble" }
],
features: [
{ attributes: { LakeCount: lakeCount, Acres: Round(totalAcres, 2) } }
]
}
);
... View more
a month ago
|
1
|
1
|
371
|
|
POST
|
I guess I'm not clear on the number you're expecting to get for the total area. Do you want to sum up the area of the portion of each lake that intersect the each tract? If so, then you'll have to loop through each tract and each lake to get the Intersection geometry and add its area to the total. However, the total count of the lakes will likely be incorrect, since a lake intersecting several tracts will be counted for each tract.
... View more
a month ago
|
0
|
3
|
376
|
|
POST
|
You have the order of the DateDiff parameters reversed if the ExpDate is in the future. For those dates, your expression returns a negative number. Here's an easier way to write your expression, using the When function. This assumes that the ExpDate field is a date field. if (IsEmpty($feature.Expdate) return "Expiry Date Unavailable"
var diff = DateDiff($feature.Expdate, Now(), "days");
When(diff <= 0, "Expired",
diff <= 30, "Expires within 30 days",
diff < 100, "Expires between 30 to 100 days",
"Expires in more than 100 days"
);
... View more
a month ago
|
1
|
0
|
196
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 2 | 3 weeks ago | |
| 1 | 4 weeks ago | |
| 1 | 4 weeks ago | |
| 1 | a month ago |
| Online Status |
Online
|
| Date Last Visited |
yesterday
|