Create a spatial service API

Updated at:

You can publish various types of spatial data as industry-standard spatial service APIs to simplify API calls and reduce resource management costs. This topic describes how to create a spatial service API.

Prerequisites

Create an application. For more information, see Create Application.

Procedure

  1. Log on to the Data Resource Platform console.

  2. In the upper-left corner of the page, click the 导航图标 icon and select Collaboration.

  3. In the top navigation bar, click the 选择工作组 icon, select the target workgroup, and then click Asset Processing.

  4. In the left-side navigation pane, click the API icon and choose API Development > spatial service API.

  5. On the spatial service API page, click Proxy Service Management.

  6. In the upper-right corner of the Spatial Proxy Service API page, click Create API.

  7. On the Spatial Proxy Service API-Create page, configure the API.

    1. Configure the basic information for the API.

      Parameter

      Description

      API Name

      A custom name for the API.

      Application

      The application to which the API belongs. You can create a new application in the system settings module or on the API creation page. For more information, see Create Application.

      Service type

      Multiple service types are supported.

      • OGC WFS service: A map or geospatial data service that conforms to the Open Geospatial Consortium (OGC) Web Feature Service (WFS) specification.

      • OGC WMS service: A map or image service that conforms to the OGC Web Map Service (WMS) specification.

      • OGC WMTS service: A map or image service that conforms to the OGC Web Map Tile Service (WMTS) specification.

      • SuperMap REST service: A SuperMap map service that uses SuperMap workspace data.

      • ArcGIS REST service: A map service.

      • Other GIS services: GIS services other than the preceding types.

      Service URL

      Contact the service provider to obtain the URL.

      Note

      Example URL: http://example.com/login

      API Path

      The fixed path that is displayed when the API is called. A path is automatically generated by default.

      Authentication method

      Two methods are available: simple authentication and encrypted authentication. For more information, see Authentication Methods.

      • Simple authentication: Suitable for API calls within a workgroup, for testing, and in other similar scenarios. For calls within a workgroup, use the AppCode of the application to which the API belongs.

      • Encrypted authentication: Provides higher security. To call the API, you calculate a signature by using an encryption algorithm and include the signature in the request header. This method is suitable for application development after an API is shared.

      Tag

      Optional. Add custom tags.

      Description

      Required. A custom description of the API.

      Spatial Metadata

      Coordinate system

      The coordinate system for the API.

      Projection Type

      Supported projection types include Mercator, Gauss-Krüger, Web Mercator, UTM, Latitude/Longitude, and others.

      Coverage

      Optional. The geographic coverage of the API. Options include Global, National, Provincial, City/County, and others.

      Data Range

      Top-left Longitude

      Enter the top-left longitude coordinate.

      Top-left Latitude

      Enter the top-left latitude coordinate.

      Bottom-right Longitude

      Enter the bottom-right longitude coordinate.

      Bottom-right Latitude

      Enter the bottom-right latitude coordinate.

      Service Provider Information

      Information about the service provider.

    2. In the Parameter Configuration section, configure the API parameters.

      Parameter

      Description

      Service resource group

      Select a service resource group. After the API is published, tests and calls consume resources from this group. Select a group based on its specifications and current usage.

      Filter

      (Optional) Enable the Filter switch to configure the visibility of information modules. For more information, see API Result Filter.

    3. Click Start Test to test the API and verify the response.

    4. Configure the API traffic control.

      Parameter

      Description

      Maximum QPS for API

      The maximum queries per second (QPS) for the API must be a positive integer no greater than 10,000. If Service Resource Group is set to Public Resource Group, the maximum QPS for the API can only be 1. For more information, see Parameters for API throttling.

      Timeout Configuration

      Select the response timeout period for a single API call. If Service Resource Group is set to Public Resource Group, the maximum response timeout period is 10s.

      Enable Cache

      Turn on the Enable Cache switch. API calls will then request the cache.

      Cache Duration

      After you enable the cache, you can manually set the cache expiration time. The maximum cache duration is 3,600 seconds.

  8. After you configure the API parameters, click Save or Save and Publish.

    The new API appears in the API resource list.

Related operations

Actions

Description

Edit

In the API resource list, find the target API and click Edit in the Actions column. You can modify the API in the edit wizard.

Note

When editing cloud computing resources, changes to fields that are identical to the previous configuration may not be applied.

Copy

In the API resource list, find the target API and choose More > Copy in the Actions column. This action creates a new API draft. To modify the draft, click Edit in the Actions column.

Delete

  • Delete a single API: In the API resource list, find the API and choose More > Delete in the Actions column. In the Delete dialog box, click OK.

  • Batch delete: In the API resource list, select the APIs and click Batch Delete at the bottom of the list. In the Batch Delete dialog box, click OK.

Note

Published APIs cannot be deleted.

What to do next

After you create an API, you must publish it to make it available for use. For more information, see Publish an API.