上传照片返回“项目类型无效”。

问题描述 投票:0回答:0

我正在尝试使用以下基于 ArcGIS Python API 的代码上传照片:

def handle_attachments_api(
    portal_domain: str,
    portal_username: str,
    portal_password: str,
    data_type: str = None,
    data_url: str = None,
    filename: str = None,
    type_keywords: str = None,
    description: str = None,
    title: str = None,
    url: str = None,
    text: str = None,
    tags: str = None,
    snippet: str = None,
    extent: str = None,
    spatial_reference: str = None,
    access_information: str = None,
    license_info: str = None,
    culture: str = None,
    comments_enabled: bool = True,
    access: str = None,
    overwrite: bool = False,
    data: str = None,
    thumbnail: str = None,
    metadata: str = None,
    owner: str = None,
    folder: str = None,
    item_id: guid = None,
):
gis = GIS(
    url=f"https://{portal_domain}/portal",
    username=portal_username,
    password=portal_password
)

item_properties = {
    "type": data_type,
    "dataUrl": data_url,
    "filename": filename,
    "typeKeywords": type_keywords,
    "description": description,
    "title": title,
    "url": url,
    "text": text,
    "tags": tags,
    "snippet": snippet,
    "extent": extent,
    "spatialReference": spatial_reference,
    "accessInformation": access_information,
    "licenseInfo": license_info,
    "culture": culture,
    "commentsEnabled": comments_enabled,
    "access": access,
    "overwrite": overwrite,
}

gis.content.add(
    item_properties=item_properties,
    data=data,
    thumbnail=thumbnail,
    metadata=metadata,
    owner=owner,
    folder=folder,
    item_id=item_id
)

但是当我使用“jpg”作为项目类型时,我看到以下错误:

......\AppData\Local\ESR

python api arcgis
© www.soinside.com 2019 - 2024. All rights reserved.