操作方法

操作方法:使用 ArcGIS API for Python 在 ArcGIS Online 中标识项目的使用情况

Last Published: June 23, 2020

摘要

在 ArcGIS Online 中,通过访问项目详细信息页面,然后单击使用情况选项卡,可以标识任何项目的使用情况。

“使用情况详细信息”窗口的图像

针对 Portal for ArcGIS,还可以使用 ArcGIS API for Python 以编程方式确定项目的使用情况。

过程

以下步骤将介绍如何在门户中标识内容项目的使用情况:

  1. 导入所需的模块。
from arcgis.gis import GIS
  1. 连接到 ArcGIS Online。
gis = GIS("https://arcgis.com", "user_name") print("connected")
  1. 搜索内容,然后对项目进行排序。
content = gis.content.search(query="", sort_field="title", sort_order="asc", max_items=2) content
  1. 对项目进行迭代,然后根据所需时间框来打印使用情况。
for item in content: print (item.homepage) print (item.usage ('24H')) print (item.usage ('7D')) print (item.usage ('14D')) print (item.usage ('30D')) print (item.usage ('60D')) print (item.usage ('6M')) print (item.usage ('1Y'))

以下屏幕截图显示了项目的使用情况。

示例结果的图像

文章 ID:000021762

从 ArcGIS 专家处获得帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项

相关信息

发现关于本主题的更多内容