操作方法

操作方法:从 REST 端点下载包含附件的大型托管要素服务

Last Published: May 30, 2024

摘要

In some cases, downloading a hosted feature service with attachments by exporting the service to a file geodatabase fails because the file size is too big. However, when downloading from the REST endpoint, the file is merely too big to be downloaded at once. In this case, it is possible to split the features and download the features in batches. For example, if the file contains 10,000 features, split the file by creating a replica with the first 5000 Object IDs as the first batch, and the next 5000 Object IDs as the second batch.

The instructions provided describe how to download a large hosted feature service with attachments from a REST endpoint.

过程

  1. Navigate to the ArcGIS REST Services Directory page of the hosted feature service, scroll to the bottom of the page, and click Create replica.
    Operation Create Replica
  2. Set the following options for the replica:
    1. Under LayerQueries:
    {"0":{"where":"OBJECTID<=5000"}}
    Note:
    This creates a replica with the first 5000 Object IDs from LayerID 0. The value of OBJECTID may vary depending on the user's data.
  1. Return Attachments: True
  2. Create Replica Asynchronously: True
  3. Sync Model: None
  4. Attachments Sync Direction: bidirectional
  5. Data Format: FILEGDB.
Create Replica
  1. Keep the rest of the settings to default and, click Create Replica. A 'statusURL' displays at the bottom of the screen. Click the URL.
User-added image
  1. Click the Result URL to download the zip file.
User-added image
Note:
Repeat the process for all the subsequent records, only, the OBJECTID keeps changing. For example, the following query creates a replica with the Object ID from 5001 to 10,000.

{"0":{"where":"OBJECTID>5000 AND OBJECTID<=10000"}}

ObjectID fields are sequential and start with the number 1 for geodatabase data. If there is any discrepancy in the hosted feature service data, the number of features downloaded may be less than the number of Object IDs set in the query. For example, if there is no feature with the Object ID 1000 in the feature service, the total feature downloaded is 4999 instead of 5000.
For more information on how to create a replica in ArcGIS REST API, refer to the following ArcGIS Web Help page: Create replica.

文章 ID: 000014156

接收通知并查找新问题或常见问题的解决方案

从我们全新的 AI 聊天机器人中获得简明答案和视频解决方案。

下载 Esri 支持应用程序

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项