POST
|
Hi Fran, also worth looking at doing this with the API for Python, as it is makes it very easy to automate all sorts of processes in AGOL/Portal. Accessing and managing users | ArcGIS for Developers You can even quite easily check to see if users have content, and if so reassign to another user etc, which you can see in the examples on the page I linked.
... View more
07-29-2020
12:01 PM
|
1
|
0
|
320
|
POST
|
No worries! I did a little playing because I was curious and it also seems quite important for you (COVID and all). If in AGOL content you go Create->Feature Layer->From URL and put in the url to the JHU service, it should create an exact replica but empty. Then I've written a little script using the ArcGIS API for Python that should update the data for you as long as the schemas match; if you have access to either ArcGIS Notebooks or ArcGIS Pro then the following should work to update the data for you: from arcgis . gis import GIS #gis = GIS("home") uncomment this if you run it from notebook in AGOL #gis = GIS("pro")uncomment this if running from pro id1 = "" #AGOL ItemID of JHU service item id2 = "" #AGOL ItemID of your replica service item1 = gis . content . get ( id1 ) item2 = gis . content . get ( id2 ) flayer1 = item1 . layers [ 0 ] # assuming there is only one layer in the service? flayer2 = item2 . layers [ 0 ] print ( "Querying JHU feature service" ) fset = flayer1 . query ( where = "1=1" , out_fields = "*" , return_all_records = True ) print ( "{} features returned" . format ( len ( fset . features ) ) print ( "Deleting features in replica JHU service" ) flayer2 . delete_features ( where = "1=1" ) # clearing out previous data print ( "Adding features to replica JHU service" ) flayer2 . edit_features ( adds = fset ) # adding new data This is very rudimentary and also not the most sensible way to solve it, as I'm nuking and appending all data instead of just taking changes from the last day etc., but it should do the trick.
... View more
07-28-2020
10:24 AM
|
0
|
2
|
240
|
POST
|
I don't think that is possible, and you are right - it does specify that you have to own both of the items to run this tool. In which case I would imagine creating a hosted feature with the same schema as JHU, and then have either an automated or manual process for updating your hosted feature service, may be the best solution. I can't really see any better way of achieving what you're hoping to achieve!
... View more
07-28-2020
06:40 AM
|
0
|
4
|
240
|
POST
|
Hi Anna, Have you looked into the "Join Features" analysis tool in ArcGIS Online? Join Features—ArcGIS Online Help | Documentation I believe it makes a view layer joining two hosted feature services, and if you create the join based on a shared attribute (instead of a spatial join) then it will automatically update as changes are made to the two underlying services. Create results as hosted feature layer view allows the data to stay up to date as the source data changes. Hosted feature layer views containing joins will be read-only and do not consume credits for analysis and storage. If statistics are included as part of the output, the hosted feature layer view will contain an extra table layer in the view with the statistics. Attachments on the target layer will be preserved if the target layer has attachments enabled and a GlobalID field. For more information on hosted feature layer views, see Limitations . Might very well be the best solution in this case.
... View more
07-28-2020
06:23 AM
|
0
|
6
|
240
|
POST
|
Hi Bert, You can simply add the line "return $feature.verharding" to the else clause, which means for all other values it will just return the existing value. Note, a better way to do this would be to use the IIF arcade function detailed here: Logical Functions | ArcGIS for Developers to do it in one line!
... View more
07-28-2020
01:24 AM
|
1
|
0
|
308
|
POST
|
Hi, When configuring the script parameter, did you check the box for "Multiple values"? When you do so it returns a list, which is what the function in that metadata script requires as an input (as it is using the input in a for loop). The error message you're getting is a generic Python error which occurs when trying to loop over something that can't be looped.
... View more
07-24-2020
07:50 AM
|
0
|
0
|
27
|
POST
|
Easy then! from arcgis . gis import GIS from arcgis . mapping import WebMap gis = GIS ( 'pro' ) # if running this from Notebook for ArcGIS in AGOL/Enterprise, replace this line with gis = GIS('home') wmItemId = "" #put the id of the webmap in here wmItem = gis . content . get ( wmItemId ) wm = WebMap ( wmItem ) for lyr in wm . layers : print ( lyr . title ) I wrote that to be run from the Python window in Pro, but see my note in line 3 about using it in ArcGIS Notebook. Just put the ID of the web map item into line 4 and it should print out all the layers for the given webmap.
... View more
07-09-2020
08:04 AM
|
2
|
2
|
204
|
POST
|
Do you have access to ArcGIS Pro or ArcGIS Notebook (in AGOL or enterprise)? If so this can be done using the ArcGIS API for Python pretty easily!
... View more
07-09-2020
07:53 AM
|
1
|
4
|
204
|
POST
|
I realise that should be "NADR_GID" not "NADR_ID", where are you putting that line of code? It should be in the box below the code block, and the code block should be empty! If that fails, I'd be happy to take another look at the error message it gives. Also I realised in your previous screenshot it's running as Python9.3, try the above line or my original solution with "Python" as the expression type just in case!
... View more
07-09-2020
04:45 AM
|
0
|
0
|
19
|
Online Status |
Offline
|
Date Last Visited |
12-20-2020
08:40 AM
|