IDEA
|
Hi Joseph, thanks for this approach it's a really useful suggestion for me. I think you might be missing a line after your template dictionary? Something like: update_dict = {"templates": [template_tbl_to_update]} Or something like ## Template definition(s) for updating
template_to_update = {
"name" : "Template Name",
"description" : "",
"drawingTool" : "esriFeatureEditToolNone",
"prototype" : {
"attributes" : {
"field_name" : "coded_value_1",
"notes" : None
}
}
}
update_dict = {"templates": [template_to_update]}
... View more
09-20-2023
10:51 PM
|
0
|
0
|
803
|
POST
|
Just edited my above code to cope with coordinate values >999,999, and <10,000 (padding '0's using text(x, '00000'). I'm using floor to round down, so returned grid reference is the containing 1m square for the centroid point (not the 1m square with the closest x-min, y-min corner).
... View more
11-11-2022
06:27 AM
|
0
|
0
|
870
|
POST
|
Hi Kazzie, I've written a version in Arcade that will work for any grid square (provided your data layer is in BNG). You could make it shorter by removing any of the LU dictionary key value pairs you don't need. var LU = {
"4,12": "HP",
"3,11": "HT",
"4,11": "HU",
"1,10": "HW",
"2,10": "HX",
"3,10": "HY",
"4,10": "HZ",
"0,9": "NA",
"1,9": "NB",
"2,9": "NC",
"3,9": "ND",
"0,8": "NF",
"1,8": "NG",
"2,8": "NH",
"3,8": "NJ",
"4,8": "NK",
"0,7": "NL",
"1,7": "NM",
"2,7": "NN",
"3,7": "NO",
"1,6": "NR",
"2,6": "NS",
"3,6": "NT",
"4,6": "NU",
"1,5": "NW",
"2,5": "NX",
"3,5": "NY",
"4,5": "NZ",
"5,5": "OV",
"2,4": "SC",
"3,4": "SD",
"4,4": "SE",
"2,3": "SH",
"3,3": "SJ",
"4,3": "SK",
"1,2": "SM",
"2,2": "SN",
"3,2": "SO",
"4,2": "SP",
"1,1": "SR",
"2,1": "SS",
"3,1": "ST",
"4,1": "SU",
"0,0": "SV",
"1,0": "SW",
"2,0": "SX",
"3,0": "SY",
"4,0": "SZ",
"5,4": "TA",
"5,3": "TF",
"6,3": "TG",
"5,2": "TL",
"6,2": "TM",
"5,1": "TQ",
"6,1": "TR",
"5,0": "TV",
}
// Centroid x and y of feature
var x = centroid($feature).x
var y = centroid($feature).y
// Create a key for Look-Up (LU) dictionary
var xKey = floor(x/100000)
var yKey = floor(y/100000)
var key = xKey + "," + yKey
// key NOT found in LU dictionary
if(!HasKey(LU, key)){return "Invalid"}
return LU[key] + text(floor(x),'00000') + text(floor(y),'00000')
... View more
11-11-2022
05:21 AM
|
0
|
2
|
875
|
POST
|
Hi Kazzie If you want to use BNG it's under Projected Coordinate System > National Grids > Europe > British National Grid, though you can just say same as the layer or map if they are already in BNG To put Grid Refs straight into an attribute table field using Python in Calculate Field, I use this (I'm only interested in SU, SP, TQ and TL squares, so needs modifying to handle other grid squares). Will only work if your layer is in BNG already. # EXPRESSION - put in upper box
tenFigGR(!shape!)
# CODE BLOCK - lower large box
def tenFigGR(myPoint):
# round X and Y to nearest 1 meter
# for 10 fig GRs
X = str(round(myPoint.trueCENTROID.X,0))
Y = str(round(myPoint.trueCENTROID.Y,0))
GRStr = "Invalid"
if (X[:1]=="4"):
if (Y[:1] == "1"):
GRStr = "SU"
elif (Y[:1]=="2"):
GRStr = "SP"
elif(X[:1]=="5"):
if(Y[:1]=="1"):
GRStr = "TQ"
elif(Y[:1]=="2"):
GRStr ="TL"
GRStr = GRStr + X[1:6] + Y[1:6]
return GRStr hope this helps
... View more
11-11-2022
04:05 AM
|
0
|
4
|
898
|
POST
|
Ok, thanks for that tip-off Jeff. That'd be a deal breaker for me, so I might never apply this after all!
... View more
07-21-2020
08:30 AM
|
0
|
0
|
569
|
POST
|
Hi Jeffrey, might be more reassuring to hear from someone who has more experience than me, but thought I'd just chip in by saying that when I tried it out on a test dataset it didn't effect the data within the service. To be honest, I've not got round to applying the fix more widely on our data, even though it's quick and easy to apply - am intending to, though moving away from ArcMAp has made it seem a little less pressing than previous. What I don't know, and would be useful to hear from somebody about, is that when the service gets updated whether the fix needs to be reapplied everytime, or if it sticks when done once. Cheers, Andy.
... View more
07-21-2020
02:59 AM
|
0
|
2
|
569
|
POST
|
Hi Andy, I don't know how you would do this with the Smart Editor, but it it possible with the standard editor widget. First ensure this behaviour is enabled in the Editor widget settings, then you should see the Cut (scissors) icon at the bottom of the Editor window (see screen shots). To use, select a polygon (can use the 'New selection' black arrowhead for this), click the Cut button, then either draw a line that passes right the way through your polygon to cut it, or, to make a donut hole, draw an internal line where the start and end of the line cross over. Hope that helps. Cheers, Andy.
... View more
05-09-2020
04:15 AM
|
0
|
0
|
1211
|
POST
|
Thanks David - your example has made clear my simple mistake - I was missing the query part of the url. So in my example changing: https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0 to https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0/query does the trick. Thanks again, Andy.
... View more
12-11-2019
02:17 AM
|
0
|
2
|
480
|
POST
|
Thanks for that Peter. Somehow I'd either forgotten or had managed to miss the fact that you can configure search in Web Maps. I've always just done this in apps. So this has already been very useful and will give me some more options to have a play around with. In my very quick test in web app builder it seemed that the search widget doesn't see calculated fields, so my less than ideal work around was to just duplicate my layer with non-editable version, just to use for searching. But if the map search can be configured to work with calculated fields then that sounds like a much better option. Thanks, Andy.
... View more
12-10-2019
02:02 AM
|
1
|
1
|
957
|
POST
|
Thanks for sharing David - this has hopefully set me off down a useful path. However, when I've been experimenting, I'm not getting any .features in my response, so the For loop on line 51 in your snippet is going to hit problems for me. I get the fields no problem (for previous For loop on 38), but no features. Simplified test example below, be grateful if anyone has some advice. Cheers, Andy. var url = "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0";
var query = {
responseType: "json",
query:
{
f: "json",
where:"1=1",
returnCountOnly: false,
outFields: "*",
resultRecordCount: "1000"
}
}
esriRequest(url, query).then(function(response) {
console.log(response);
});
... View more
12-07-2019
02:35 AM
|
0
|
4
|
2244
|
POST
|
Thanks for the response Peter - I had a quick go on the Experience Builder (looks interesting), but I couldn't actually find a search widget in there at the moment. Might have missed it, I'd be interested to hear if you have any luck. Thanks, Andy.
... View more
11-27-2019
02:35 AM
|
0
|
3
|
957
|
POST
|
I'm using the search widget to search a hosted feature layer present in the map. I don't get suggestions / partial matches if the widget is configured to search a field that has a list (domain/drop-down list). I've tested with a couple of different layers and fields and this seems to be consistent behaviour - if there is a list present on the field suggestions/partials don't work, switching to search on a different field without a list and they work again. Generally speaking, as the most useful field for us to search on is also the one we'll need to constrain to a list of set values, this is a little frustrating. Does anyone know of a workaround? Unless anyone has already done so already, I'll also raise this as an idea. Thanks.
... View more
11-13-2019
03:39 AM
|
0
|
5
|
1135
|
POST
|
Switching the date formats to something else then back to what I actually wanted worked for me - thanks for the tip Previn! (I did this in the data visualization tab of the layer, and also in the map the web app uses - not sure if necessary to do it in both places...) Andy.
... View more
08-28-2019
08:10 AM
|
0
|
0
|
1789
|
IDEA
|
Hi, I think this does what you're after, in web apps created using builder on AGOL at least. https://community.esri.com/ideas/13937-select-copy-and-paste-feature-in-webapp-builder?commentID=74587#comment-74587
... View more
08-22-2019
07:51 AM
|
0
|
0
|
3577
|
POST
|
Thanks Lee. This worked as you said - haven't noticed any difference from deleting all that stuff, except that all the layers now load in ArcMap via Add data button as you said. Cheers, Andy.
... View more
05-21-2019
09:08 AM
|
0
|
0
|
2342
|
Title | Kudos | Posted |
---|---|---|
1 | 04-06-2016 08:45 AM | |
1 | 06-05-2013 11:31 PM | |
1 | 08-03-2017 04:05 AM | |
2 | 04-06-2017 10:34 AM | |
25 | 11-25-2016 03:43 AM |
Online Status |
Offline
|
Date Last Visited |
12-12-2023
02:57 AM
|