POST
|
The way to do this is to use Create Replica with returnAttachments set to false and dataFormat set to "filegdb" - in the Python API, this will correspond to SyncManager's Create method: arcgis.features.managers module | ArcGIS API for Python. Of course, in order to do this you will need to have the sync capability enabled (which I assume it is if you are doing offline field collection). You can find sample code that shows how to create a replica here: Sync overview | ArcGIS API for Python
... View more
02-23-2024
07:25 AM
|
1
|
1
|
167
|
POST
|
Hi @JillianStanford , It looks like that property isn't there by default. You can try hydrating each item object ahead of time as this seems to set the required size property. So, you would do something like this first: for item in items:
item._hydrate()
... View more
02-20-2024
03:40 PM
|
0
|
1
|
200
|
POST
|
I'm not sure why this doesn't work for you? I can reproduce your original issue and the fix works on my end. You can also try df = pd.DataFrame([{"id": item.id, "size": item.size, "type": item.type} for item in items]) This also works for me. My version of the python api is 2.3.0; the version of pandas is 2.0.2.
... View more
02-15-2024
01:27 PM
|
1
|
0
|
303
|
POST
|
items is a list of objects - sometimes this will work, sometimes not. The dictionary representation of the data is more reliable. There are many ways to fix this, but the most straightforward is probably to do: df = pd.DataFrame([vars(item) for item in items], columns=["id", "size", "type"]) vars() is just a handy function that returns the __dict__ attribute on each item object.
... View more
02-15-2024
12:42 PM
|
0
|
2
|
308
|
POST
|
Hi, Have you tried using df.spatial.to_featureset() instead? I'm not sure if you'll encounter the same issue, but if all you need "point_features" for is to update "item1" then there's not much point in publishing the intermediate data.
... View more
02-02-2024
12:29 PM
|
0
|
0
|
328
|
POST
|
Hi, this small update should work well for your needs: l = 0
for layer in webmap_obj.layers:
l += 1
print(l, layer.title)
if hasattr(layer, "layers"):
for sublayer in layer.layers:
print("\t", sublayer.title)
... View more
02-02-2024
06:58 AM
|
0
|
1
|
254
|
POST
|
Can you try WebMap.add_table()? It works basically the same way, but it's intended for tables. You'll need to change your code a bit and use the id for the table instead.
... View more
01-26-2024
12:33 PM
|
0
|
0
|
252
|
POST
|
There are two ways you can do this. Both rely on typeKeywords. When you create a View, I believe a type keyword is automatically attached to it (this is true in the UI, at least). You can do something like this with your query string to filter out views: the_query = "NOT typekeywords:View Service AND owner:youruser" Or, in your loop you can use Item.typeKeywords to isolate views if you need to do further manipulations. The typeKeywords property for a view should be equal to a list like so: ['ArcGIS Server',
'Data',
'Feature Access',
'Feature Service',
'Service',
'Singlelayer',
'Hosted Service',
'View Service'] So, you can do: if "View Service" in item.typeKeywords do this or that.
... View more
01-18-2024
01:34 PM
|
0
|
0
|
173
|
POST
|
I think this one can be logged as a bug. The reference list is: layer_types = [
"ArcGISTiledMapServiceLayer",
"ArcGISImageServiceLayer",
"ArcGISImageServiceVectorLayer",
"ArcGISMapServiceLayer",
"ArcGISTiledImageServiceLayer",
"ArcGISVectorTileLayer",
] But the layerType attribute is set to "VectorTileLayer." From a quick glance at the source, it looks like "ArcGISVectorTileLayer" is only defined in arcgis/mapping/_types.py so I think the types are either incorrect or the logic needs to be updated to properly map to the types.
... View more
12-20-2023
02:02 PM
|
0
|
1
|
353
|
POST
|
I think I had to do this once. I'm not positive, but I think the process was something like this: Use Create Replica to download the data Run Append with the "Preserve Global IDs" environment setting. The limitation is going to be with #2. I believe eGDB appended to FGDB doesn't work, but not sure about FGDB to eGDB. You may need to experiment with a test case.
... View more
12-18-2023
02:59 PM
|
0
|
0
|
200
|
POST
|
You can do something like this: from arcgis.gis import GIS
gis = GIS("https://yourportal.com/portal", "portaladmin", "password")
hosting_server = gis.admin.servers.get(role="HOSTING_SERVER")[0] And then use hosting_server.system, which is a System Manager. The web_adaptors property, for example, returns: {'webAdaptors': [{'machineName': 'machine',
'machineIP': '10.29.77.176',
'webAdaptorURL': 'https://machine.domain.com/server',
'id': '4y0f8a80-01as-4e0e-bc6d-3d1234873c5',
'description': '',
'httpPort': -1,
'httpsPort': 443,
'refreshServerListInterval': 1,
'reconnectServerOnFailureInterval': 1,
'isAdminEnabled': True}]} Some other things you may find useful are "unregister_webadaptor" and "update_web_adaptors_configuration"
... View more
12-07-2023
06:06 AM
|
0
|
0
|
145
|
POST
|
In the past, I remember to_featureclass failing if you had any Python lists in your dataframe. I'm not sure if this is a problem in your case (only noting it because I see lists in the screen).
... View more
12-05-2023
10:52 AM
|
1
|
0
|
273
|
POST
|
Hey, your calc_expression value should be: {"field": "assetid", "sqlExpression": "CONCAT('NNTREE-', OBJECTID)"}
... View more
12-04-2023
07:13 AM
|
0
|
1
|
203
|
POST
|
I believe you can identify which records intersect one another with a spatial join. In my small test case, this works and returns the expected records: from arcgis import GIS
from arcgis.features import FeatureLayer
gis = GIS("https://machine.domain.com/portal", "user", "pass")
fl_url = "https://src.domain.com/server/rest/services/test/FeatureServer/0"
fl = FeatureLayer(fl_url, gis)
df = fl.query(as_df=True)
joined = df.spatial.join(
df.copy(),
how="left",
op="intersects",
left_tag="left",
right_tag="right"
)
intersecting_records = joined.loc[joined.OBJECTID_left != joined.OBJECTID_right] Hope this helps! This was a really good question that I'm sure many will get value from.
... View more
12-01-2023
12:21 PM
|
0
|
0
|
195
|
POST
|
As far as I can tell, everything seems to be in order. It's not really advertised, but you can do same-portal clones (I used to do this quite a bit for similar reasons). Some other things you can try are exporting the data or creating a replica. From there, you can prepare the data as you wish locally and then publish as usual. If it fails to do either one of those, maybe there will be an error that provides more insight.
... View more
12-01-2023
10:54 AM
|
2
|
0
|
209
|
Title | Kudos | Posted |
---|---|---|
1 | 02-23-2024 07:25 AM | |
1 | 02-15-2024 01:27 PM | |
1 | 01-06-2023 10:19 AM | |
1 | 12-23-2022 06:11 AM | |
1 | 12-05-2023 10:52 AM |