Create a spatial service API
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
-
Log on to the Data Resource Platform console.
In the upper-left corner of the page, click the
icon and select Collaboration.In the top navigation bar, click the
icon, select the target workgroup, and then click Asset Processing.In the left-side navigation pane, click the
icon and choose API Development > spatial service API.On the spatial service API page, click Proxy Service Management.
In the upper-right corner of the Spatial Proxy Service API page, click Create API.
On the Spatial Proxy Service API-Create page, configure the API.
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.
NoteExample 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.
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.
Click Start Test to test the API and verify the response.
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.
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 |
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.