|
POST
|
I'm wondering how I can use the Python API to query a feature layer and retrieve the feature and attachment storage separately. The feature layer property 'size' returns the combined feature and attachment size. I'd like to be able to break the feature and attachment storage separately to better align with the reports generated by AGO.
... View more
06-15-2023
02:14 PM
|
3
|
4
|
3316
|
|
POST
|
Found this post and am wondering if there are any ideas on the disparity I see when querying the size of the attachments through the Python API versus what is shown on the item page...? If I query the attachments through the Python API for a feature layer of interest, I get 1.35GB. However, if I look at the item page, it shows 3.3GB. Python API query --- bytes converted to GB Item page
... View more
06-15-2023
01:23 PM
|
0
|
1
|
3150
|
|
IDEA
|
I'm using Pro 3.1.2 Yes, I can define the precision and scale when using the Field view, but when using the interface below this seems like extra steps. I'd like the precision and scale to be options when creating a new feature class by right-clicking on a database connection and selecting New | Feature Class. Circled in green is the area where I'd like to see the precision and scale be options. If you create a text field through this interface you can define the max characters...something similar for double fields would be nice, in my opinion.
... View more
06-01-2023
01:57 PM
|
0
|
0
|
4520
|
|
POST
|
6 years later and haven't had issues. Pretty sure I mention this in my reply, but be sure to test this workflow first!
... View more
06-01-2023
06:00 AM
|
1
|
0
|
4283
|
|
IDEA
|
When adding a "double" field type in ArcGIS Pros Feature Class Wizard, please allow precision and scale to be defined if using an enterprise geodatabase. For example: if I add a double field to an enterprise geodatabase dataset within the wizard, the precision and scale can not be defined, and this results in them being 38,8. In most of our use cases this far exceeds any precision and scale we'd use and bloats the table. If I want to alter the precision and scale, I have to manually do it through the database interface like SSMS.
... View more
05-30-2023
07:41 AM
|
22
|
27
|
6206
|
|
POST
|
One thing I have noticed is that is takes much longer to connect to a portal on the machine where we re-installed the pywin32 module. My normal work machine was silently updated to 3.1.1 with no issues. If I do a simple timing of how long it takes to establish a connection, it takes 3 to 4 times longer on the machine where we did the re-install. I know this is nit-picking over a few seconds, but I'm wondering if there's a reason for this...? The first screenshot below is for my work machine (slient update, no issues), and the second is for the machine where we re-installed the pywin32 module. The connection parameters are the same (url, username, password).
... View more
05-24-2023
09:37 AM
|
0
|
0
|
5615
|
|
POST
|
Had the same issue ... updated from Pro 2.9.x to 3.1.1 and could not execute any scripts that used the arcgis module. Uninstalled and reinstalled the pywin32 module and it seems like things are back on track. Thanks a lot for this!
... View more
05-24-2023
08:40 AM
|
0
|
0
|
5631
|
|
POST
|
This issue seemed to be our version of Pro/arcgis module. We recently upgraded from Pro 2.9.5 to 3.1.1 (arcgis module version 2.1.0.2) and the script above is now returning our Pro licensing running on our Portal.
... View more
05-10-2023
10:50 AM
|
1
|
0
|
1159
|
|
POST
|
When trying to get our Pro licensing information from our Enterprise, nothing (NoneType) is returned, even though the majority of our Pro licenses are configured to use our Enterprise accounts. Is this a known limitation of Enterprise? Is it due to our Enterprise version (10.9.1)? Is it due to the arcgis module version (1.9.1)? Below is the code I'm using, and based on the Python API documentation the way I read it, this should be doable in both ArcGIS Online and Enterprise. I've tested the same code below on our AGO Organization and it works as expected. import arcgis
portal_url = '...portal url...'
portal_user = '...user name...'
portal_pwd = '...user password...'
# connect to portal
p = arcgis.GIS(portal_url, portal_user, portal_pwd)
# get pro licensing
pro_licenses = p.admin.license.get('ArcGIS Pro')
print(pro_licenses)
# verify pro licensing is returned
if pro_licenses:
a = pro_licenses.all()
for u in a:
print(u) When I run the code above on our Enterprise, line 12 returns: None
... View more
05-05-2023
09:03 AM
|
0
|
2
|
1216
|
|
POST
|
Please allow for a default unit to be selected when using measurement within the Draw widget
... View more
05-03-2023
08:17 AM
|
4
|
0
|
422
|
|
IDEA
|
Please have the all the operational layers within a web map returned when using "layers" of a Web Map item. It seems that any layers within a Group Layer are skipped, meaning the user has to check whether the layer is a group layer and then further iterate over the layers within the group to truly retrieve all layers within the web map. Below is an example. The grouped layers are expanded to show all the layers within the web map: In the code below, the layers within the "PLSS", "Annotation", and "Political Township" group layers are not returned. import arcgis
# portal connection variables
portal_url = r'...portal url...'
portal_user_name = '...user name...'
portal_user_password = '...user password...'
# target web map
web_map_id = '...web map id...'
# connect to portal
p = arcgis.GIS(portal_url, portal_user_name, portal_user_password)
# set web map item
item = p.content.get(web_map_id)
# set web map item
web_map = arcgis.mapping.WebMap(item)
# get operational layers
layers = web_map.layers
for l in layers:
layer_name = l.get('title')
layer_type = l.get('layerType')
print(f'{layer_name} ({layer_type})') None of the layers within the group layers (green line) are returned. It would be nice if they were returned without having to iterate through each group layer object.
... View more
04-24-2023
09:52 AM
|
3
|
1
|
1509
|
|
POST
|
After some testing, this does seem doable using the Python API. Below is some sample code that others may find useful. import arcgis
# connect to portal
portal = arcgis.GIS(...your authentication method...)
# set item
item = portal.content.get('...item id...')
# get layers and tables (in my case I was targeting a table)
layers = item.layers
tables = item.tables
# target layer or table
fl = tables['x'] # x is the index of the layer or table
# create attribute index json/dictionary
idx = {'name': '...name of index...',
'fields': 'Field1, Field2, Field3, etc...',
'isAscending': True,
'isUnique': False, # only set to True if layer or table has unique values
'description': '...description of index...'}
# add index to layer/table definition --- seems that whether there is 1 or multiple indexes you are adding, the object must be a list
r = fl.manager.add_to_definition({"indexes": [idx]})
# check result
print(r)
... View more
04-11-2023
07:46 AM
|
1
|
0
|
1272
|
|
POST
|
If I view the properties of a layer or table within a hosted feature layer, I'm able to view the existing indexes as a dictionary object. Is it possible to create an attribute index on a hosted feature layer using the Python API? If so, are there any examples available? I can't find any in the Python API docs.
... View more
04-10-2023
01:33 PM
|
0
|
1
|
1304
|
|
POST
|
Is it possible to use the Python API to update the basemap layers of an existing web map to those of another web map? For example, I have a template web map that has the base map configured as desired, and I'd like to use the Python API to iterate over several existing web maps and update the base map using the template web map. Below is the code I've tried, but doesn't seem to do anything to the target web map: import arcgis
# set web map ids
wmIDTarget = '...id1...'
wmIDTemplate = '...id2...'
# connect to portal
p = arcgis.GIS('https://www.arcgis.com/', 'user_name', 'user_password')
# create web map items
wmItemTarget = arcgis.mapping.WebMap(p.content.get(wmIDTarget))
wmItemTemplate = arcgis.mapping.WebMap(p.content.get(wmIDTemplate))
# get template base map layer information
templateBase = wmItemTemplate.basemap.get('baseMapLayers')
# update target web map base map layers
wmItemTarget.basemap.update({'baseMapLayers':templateBase})
wmItemTarget.basemap.update({'title':'Basemap Updated'})
... View more
03-21-2023
07:38 AM
|
1
|
2
|
1758
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-09-2025 07:06 AM | |
| 1 | 01-16-2025 11:33 AM | |
| 1 | 01-13-2025 06:12 AM | |
| 1 | 01-13-2025 06:08 AM | |
| 1 | 03-19-2021 09:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|