POST
|
Hey Drew Dowling, Have you seen this support article for downloading services as a FDGB? It was initially written to loop through items located services through gis.content.search(). However, if you have a list of specific items you could use gis.content.get() to loop through the item IDs instead. I'm not certain about the checking on the status of an export job and will have to look into it, but I know the following should work without any corruption issues: itemDes = service.export(service.title + "_" + version, "File Geodatabase") itemDes.download(file path for backup_location) I believe the problem is that the code above will run once itemDes has finished being created, while fgdb = mygis.content.get(itemDes['exportItemId']) instead creates a new variable and exports it regardless of whether the FGDB for itemDes has been fully created. Hope this helps, Nico
... View more
07-30-2020
07:45 PM
|
0
|
0
|
564
|
POST
|
Hi Richard, I believe that the problem is that this code is updating attribute fields, a feature in ArcGIS Online is stored in the following format: {"geometry": {"x": , "y": }, "attributes": {"OBJECTID": , "GlobalID": "", "Field1":, "Field2":}}
Field mapping is going to match the attribute dictionary, but won't add the geometry. This sample notebook goes into adding and updating features from a CSV as well as adding/updating geometry (Cells 18 and 23). The important parts are: input_geometry = {'y':float(matching_row['latitude']), 'x':float(matching_row['longitude'])} output_geometry = geometry.project(geometries = [input_geometry], in_sr = 4326, out_sr = cities_fset.spatial_reference['latestWkid'], gis = gis) # assign the updated values new_feature.geometry = output_geometry[0] I would look at the notebook mentioned above, as it looks like it closely matches your needs. I hope this helps, Nico
... View more
07-30-2020
12:57 PM
|
0
|
0
|
1533
|
POST
|
Hi Merrisha, From what I can tell the OD Matrix function in the Python API requires 2 FeatureSets (one for origins, another for destinations), this is most easily created from a arcgis.features.Feature object in a hosted GIS Portal(whether this is ArcGIS Online or Portal.) The feature sets could be generated from data not hosted from these datatypes, however the challenge would be converting the data to the required formats from the FGDB. I hope this is helpful, Nico
... View more
07-30-2020
08:34 AM
|
0
|
0
|
571
|
POST
|
Hi Mike, In the Python API, you're correct that the usernames are case sensitive. This is different than in the user interface for ArcGIS Online. Thanks, Nico
... View more
07-30-2020
07:36 AM
|
0
|
0
|
444
|
POST
|
Hi Amanda, I found this post that refers to the problem you're running into. Could you try to change: sdItem = gis.content.search("{} AND owner:{}".format(sd_fs_name, user), item_type="Service Definition")[0] To this: sdItem = gis.content.search(query="title:"+ sd_fs_name + " AND owner: " + user, item_type="Service Definition")[0] From what I read the original search string is causing the turn into a boolean, which does not restrict the title to an exact match. This may not be returning the desired item that needs to be overwritten.
... View more
07-16-2020
06:07 AM
|
0
|
0
|
1955
|
Online Status |
Offline
|
Date Last Visited |
10-18-2023
09:03 PM
|