|
POST
|
I'm not sure what kind of information is stored, but the way you would get a list of invitations is like so: from arcgis.gis import GIS
gis = GIS("https://www.arcgis.com", "user", "pass")
invitations = gis.users.invitations.list()
... View more
08-02-2024
11:17 AM
|
0
|
0
|
744
|
|
POST
|
Seems like there's a hiccup in the logic there at least for your case. Apparently, data["version"] is a string that needs to be parsed into an integer for that comparison to work. The first thing you can do is log an issue here with a description of your problem pretty much exactly as you posted: Issues · Esri/arcgis-python-api · GitHub Next, if you are comfortable doing a bit of troubleshooting you can create a test conda environment (so you don't mess up your production environment) and tweak the source to see if it fixes your problem. You can try making this change in the indicated file at line 4563: if data["version"]:
if int(data["version"]) >= 24:
webmap_ids = _DashboardDefinition._get_webmap_ids_v24(data)
... View more
08-02-2024
10:51 AM
|
0
|
0
|
2411
|
|
POST
|
It seems like you're mixing up the REST API with the ArcGIS API for Python based on the mixed usage in the sample code. What you are trying to do is documented here: Sync overview | ArcGIS API for Python You have to start with a FeatureLayerCollection object. From there, you get the list of replicas using get_list() and use the results to later run unregister.
... View more
08-01-2024
09:44 AM
|
0
|
0
|
704
|
|
POST
|
Sorry, with respect to documentation REST API documentation IS NOT 1-to-1 with ArcGIS API for Python documentation. REST API parameters follow camel case, while ArcGIS API for Python follows snake case (as is convention for Python). Notwithstanding, as the Python API is a wrapper for the REST API it is useful to refer to the REST API documentation in cases where more details are needed on a parameter's usage. My apologies if that wasn't clear before. You do have to do a bit of translation yourself or else have access to a good IDE that will point out such problems. As for you layer query, I might have missed what the problem was earlier. You don't even have to include queryOption for your case if all you need is a where clause. You can just do: {"0":{"where": "IMPORTED = No"}}
... View more
08-01-2024
06:53 AM
|
0
|
1
|
607
|
|
POST
|
For creating replicas, the REST API documentation is probably a bit more helpful as it's more complete: https://developers.arcgis.com/rest/services-reference/enterprise/create-replica/ It looks like for #1 the problem is your layerQuery. I think you may need to set queryOption to "all" As for the attachments, I believe in recent versions they make you set the attachment sync direction as well. Try: return_attachments=True, attachments_sync_direction="bidirectional"
... View more
07-31-2024
09:43 AM
|
0
|
3
|
1151
|
|
POST
|
I don't know of any specific examples, but you can get a quick overview here: Sync overview | ArcGIS API for Python I forgot to mention that for this to work, you would need to turn on the sync capability.
... View more
07-29-2024
06:25 AM
|
0
|
1
|
1192
|
|
POST
|
Okay, thanks for clarifying. I would say continuing on your path may be more trouble than it's worth, but doable. In order to do it, you would need some unique identifier in the data (besides GlobalID as I assume that is going to change). If you have that, then you can: Iterate through your new features with AttachmentManager.search() Download them or maybe use them directly via file stream Match up the local records and add attachments with arcpy. Personally, I think the better approach is like this: Use SyncManager.create() to create a replica of the new feature data. You can query for new data using a layer query. Besides that, you would simply set the return_attachments parameter to True and set your data_format parameter to filegdb. So, with this approach you are essentially downloading the exact data you need in its complete form. As such, you may need to think about cleanup if the replicas are large in size. Once you've got your replica, you simply use arcpy to append to your local data.
... View more
07-26-2024
01:54 PM
|
0
|
3
|
1251
|
|
POST
|
In simple terms, what is it you're trying to achieve? It seems like the goal is to copy certain features (along with their attachments) from one Feature Service to another? I'm assuming because you say you are scraping, you do not own/manage the source data and have no way to export?
... View more
07-26-2024
11:44 AM
|
0
|
5
|
1278
|
|
POST
|
Hey sorry, We may be overcomplicating things here. How about you add this import: from arcgis.features import FeatureSet and then try to parse your data with one of the below. I think you may be able to parse your original geojson with "from_geojson" FeatureSet.from_dict()
FeatureSet.from_geojson()
FeatureSet.from_json() Supply the result to the "adds" param.
... View more
07-22-2024
08:08 AM
|
0
|
0
|
436
|
|
POST
|
Ah, for map to map this is a simple fix: import json
from arcgis import GIS
gis = GIS("https://www.arcgis.com", "user", "pass")
map_a_id = "iusdhjfuihjsdiojmg23423432klkklj"
map_b_id = "opo9o0pokszxcvbnmopjkwer87923459"
map_a = gis.content.get(map_a_id)
map_b = gis.content.get(map_b_id)
data = map_a.get_data()
item_properties = {"text": json.dumps(data)}
map_b.update(item_properties)
... View more
07-08-2024
02:02 PM
|
1
|
1
|
3293
|
|
POST
|
Remember it's expecting a list so it has to be adds=[temp_line]
... View more
07-03-2024
01:41 PM
|
0
|
0
|
1876
|
|
POST
|
Just to simplify things further, how about if you just remove all the extra stuff and send in this? {
"geometry": {
"paths": [
[
[
40.77248,
-111.8377
],
[
40.77254,
-111.83776
],
[
40.7728,
-111.83804
],
[
40.7728,
-111.83804
],
[
40.77248,
-111.8377
]
]
]
}
} I think you had some nesting going on before.
... View more
07-03-2024
11:59 AM
|
0
|
0
|
1884
|
|
POST
|
Possibly? It looks like it might be getting confused about the tuples in your coordinates: [[(40.77248, -111.8377)... Replace all parentheses with the corresponding open/closing square bracket and I think you should be close.
... View more
07-03-2024
11:36 AM
|
0
|
1
|
1886
|
|
POST
|
Ah, sorry I think I missed before that you were appending GeoJSON features. I believe you have to convert to esri json format. Something like this: [
{
"attributes": {
"a": 1,
"b": 1970.0,
"c": 1.0,
},
"geometry": {
"paths": [ [ [-97.06138, 32.837], [-97.06133, 33.836], [-98.2, 34.834], [-97, 40] ] ], "spatialReference": {"wkid": 4326}
} }, ... ] You may refer to this documentation to get a sense of the geometry format you need: Geometry objects | ArcGIS REST APIs | ArcGIS Developers
... View more
07-03-2024
09:47 AM
|
0
|
3
|
1896
|
|
POST
|
You are passing in a string when you use json.dumps. Try this instead and see if it makes a difference: feature_layer.edit_features(adds=geojson_features)
... View more
07-03-2024
06:03 AM
|
0
|
5
|
1911
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 01-18-2024 01:34 PM | |
| 1 | 09-13-2023 06:48 AM | |
| 1 | 09-23-2022 09:04 AM | |
| 1 | 06-14-2024 01:14 PM | |
| 2 | 09-24-2019 08:22 AM |