python 从ArcGIS Online上的要素图层集合中搜索,选择和生成pandas DataFrame。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 从ArcGIS Online上的要素图层集合中搜索,选择和生成pandas DataFrame。相关的知识,希望对你有一定的参考价值。

import pandas as pd
from arcgis.gis import GIS

# Login to AGOL
gis = GIS()

# For other login methods see: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/
# use for logging in within active ArcGIS Pro session
# gis = GIS('pro')

# Create a function that returns a list of feature layer collections for a search
def agolSearch(term):
    item_list = []
    items = gis.content.search(term, item_type="Feature Layer Collection")
    for item in items:
        item_list.append(item)
    return item_list
  
results = agolSearch('search terms')
results_select = results[0] # select the index postions at which the item you want is positione. This example selects the first result.
# Create dataframe from selected dataset
results_select_df = results_select.layers[0].query().df

# Check out the first 5 records of the new DataFrame
results_select_df.head()

以上是关于python 从ArcGIS Online上的要素图层集合中搜索,选择和生成pandas DataFrame。的主要内容,如果未能解决你的问题,请参考以下文章

arcgis python 使用光标和内存中的要素类将数据加载到要素集

arcgis分割不用用捕捉

如何从 ArcGIS Online 地图中抓取数据?

arcgis python图形信息

ArcGis Python脚本——批量对影像要素类定义投影

ArcGIS 应用Python中arcpy模块