dataset


URI

  1. <datasets_uri>/name/{datasetName}[.<format>]
  2. <datasets_uri>/index/{datasetIndex}[.<format>]
  3. <datasets_uri>/{datasetName}[.<format>]
  4. <datasets_uri>/{datasetIndex}[.<format>]

Supported methods

GET, PUT, DELETE, HEAD

Parent resource

datasets

Child resources

features, fields, domain, gridValues, gridValue, imageValues, imageValue

Introduction

The dataset resource represents a dataset. By implementing the GET request on the dataset resource, you can get the descriptive information about the dataset ({datasetName} or {datasetIndex}). The PUT and DELETE requests are used to modify and delete a dataset. When the dataset resource specified does not exist on the server, the PUT request creates a dataset on the server.

Note: 1. The dataset resource supports the above 4 ways of URIs, URI1 and URI3 uses dataset name to identify resources, URI2 and URI4 uses dataset index identify resource; 2. When <datasource_uri> in <datasets_uri> uses URI1 or URI2, dataset can only use URI2 or URI2, When <datasource_uri> in <datasets_uri> uses URI3 or URI4, dataset can only use URI3 or URI4.

Supported Methods:

Supported output formats: rjson, json, html, xml.

Resource hierarchy

根资源 data datasources.htm datasets.htm datasource.htm dataset.htm

HTTP request methods

Execute HTTP request on the following URI, using the rjson output format as an example, where supermapiserver is the server name, World is a datasource on the server, and Countries is a vector dataset in the datasource.

http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Countries.rjson

GET request

Gets the information about the dataset.

Request parameter

None.

Response structure

When executing the GET request on the dataset resource, the representation of the resource returned is included in the entity body of the response message, as shown below:

Field Type Description
datasetInfo DatasetInfo The information about the dataset.
childUriList List<String> The child resource list.

The structure of DatasetInfo is as follows:

Field Type Description
name String The dataset name, used to uniquely identify a dataset. The dataset name is not case-sensitive.
description String The description information of the dataset.
type DatasetType

The dataset type.
The dataset type supported by current version includes vector datasets (DatasetVector) like tabular datasets, point datasets, EPS point datasets, line datasets, EPS line datasets, region datasets, EPS region datasets, text datasets, EPS text datasets and CAD datasets, grid datasets (DatasetGrid), image datasets (DatasetImage) and network datasets (DatasetNetwork).

bounds Rectangle2D The dataset bounds.
For a vector dataset, the bounds of the dataset is the minimum bounding box of all features in the dataset. For a raster dataset, the bounds of the dataset is the geographical extent of the grid or image dataset.
dataSourceName String The name of the datasource in which the dataset resides.
encodeType EncodeType The encoding modes for dataset compression
isReadOnly boolean Whether the dataset is readonly.
prjCoordSys PrjCoordSys the projection information of the dataset.
tableName String The name of the table.
For database datasources, it represents the data table name corresponding to this dataset in the database; for file datasources, it represents the table name of this dataset used to store the attributes (files of file datasources store spatial data by .udb files and store attribute data by .udd files).
charset Charset The charset of the vector dataset. For vector dataset only.
isFileCache boolean Whether to enable file caches. For vector dataset only.
recordCount int The number of records of the vector dataset. For vector dataset only.
blockSize int The size of a block while storing in pixel blocks. For image or grid dataset only.
height int The height of the data. For image or grid dataset only.
width int The width of the data. For image or grid dataset only.
pixelFormat PixelFormat The pixel format for data storage. For image or grid dataset only.
isMultiBand boolean Whether the image dataset has multiple bands. For image dataset only.
palette List<java.awt.Color> The color palette of the image data. For image dataset only.

Example usage

Execute the GET request on the sample dataset resource with http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Countries.rjson and get the representation of the Countries dataset (vector dataset) in rjson format.

{

    "childUriList": [

        "http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Countries/fields",

        "http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Countries/features"

    ],

    "datasetInfo": {

        "bounds": {

            "bottom": -90,

            "left": -180,

            "leftBottom": {

                "x": -180,

                "y": -90

            },

            "right": 180,

            "rightTop": {

                "x": 180,

                "y": 83.62359619140626

            },

            "top": 83.62359619140626

        },

        "charset": "GB18030",

        "dataSourceName": "World",

        "description": "",

        "encodeType": "NONE",

        "isFileCache": false,

        "isReadOnly": false,

        "name": "Countries",

        "prjCoordSys": {

            "coordSystem": {

                "datum": {

                    "name": "D_WGS_1984",

                    "spheroid": {

                        "axis": 6378137,

                        "flatten": 0.0033528107,

                        "name": "WGS_1984",

                        "type": "SPHEROID_WGS_1984"

                    },

                    "type": "DATUM_WGS_1984"

                },

                "name": "GCS_WGS_1984",

                "primeMeridian": {

                    "longitudeValue": 0,

                    "name": "Greenwich",

                    "type": "PRIMEMERIDIAN_GREENWICH"

                },

                "spatialRefType": "SPATIALREF_EARTH_LONGITUDE_LATITUDE",

                "type": "GCS_WGS_1984",

                "unit": "DEGREE"

            },

            "coordUnit": "DEGREE",

            "distanceUnit": "METER",

            "epsgCode": 1,

            "name": "Longitude / Latitude Coordinate System---GCS_WGS_1984",

            "projection": null,

            "projectionParam": null,

            "type": "PCS_EARTH_LONGITUDE_LATITUDE"

        },

        "recordCount": 247,

        "tableName": "Countries",

        "type": "REGION"

    }

}

Execute the GET request on the sample dataset resource with http://localhost:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Capitals.kml to get the response in kml format (the kml representation of point, line, and region datasets supported only), as shown below:

<?xml version="1.0" encoding="utf-8" standalone="no" ?>

<kml>

  <Document>

    <NetworkLink>

      <Link>

        <href>http://localhost:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Capitals/features.kml</href>

      </Link>

    </NetworkLink>

  </Document>

</kml>

Access http://localhost:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Capitals.kml in GoogleEarth to get the response as shown below:

Above is the default display effect. Please refer to %SuperMap iServer Java_HOME%\WEB-INF\lib\iserver-all-{version}.jar\config\kml\styles\default.xml for default xml display style.

Users can customize their own display styles for the kml representation of the dataset. Please see Managing Services>Configuring KML Styles.

PUT request

Creates or modifies the information about the dataset (only vector dataset supported currently). create when the specified datasource doesn't exist; otherwise, modify.

Request parameter

If the dataset resource doesn't exist, a dataset will be created when executing the PUT request on a new URI. Parameters need to be included in the request body are as follows:

Name Type Description
datasetName String The dataset name.
Please make sure that is is consistent with {datasetName} in the URI.
datasetType DatasetType The dataset type.
The dataset type. The supported types includes: point, line, region, text, CAD and tabular dataset.
isFileCache boolean Whether to enable file caches. For vector dataset only.

If the dataset resource exists, the dataset information will be modified by executing the PUT request on the dataset resource. Parameters need to be included in the request body are as follows:

Name Type Description
description String The description information of the dataset.
prjCoordSys PrjCoordSys the projected coordinate system.
charset enum the vector dataset charset.
[Optional]Transferred if the dataset is a vector dataset. The encoding mode will remain unchanged if null value is transferred.
palette java.util.List<Color> the color palette of the image dataset.
[Optional]Transferred if the dataset is an image dataset.
noValue double The value of pixles with noData.
[Optional]Transferred if the dataset is an grid dataset.

Response structure

The returned resource representation structure is as follows if executing PUT request on the dataset resource (resource representation is in the entity body of the response message):

Field Type Description
succeed boolean Whether the operation is successful.
newResourceLoaction String The URI of the newly created dataset. Not exist if the PUT request implements the modify operation.
error HttpError Error message. If the creation is successful, this field will be absent.

Example usage

When you execute the PUT request on the dataset resource that doesn't exist, the PUT request creates a dataset. For example, if you execute the PUT request on http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/World1.rjson, however, there is no World1 in World, a new dataset named World1 will be created in the World datasource.

The request body for executing the PUT request on http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/World1.rjson is as follows:

{"datasetType":"POINT","datasetName":"World1"}

The response in json format is as follows:

{

    "newResourceLocation": "http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/World1",

    "succeed": true

}

If you execute the PUT request on http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/World1.rjson, and there is World1 in World, World1 will be modified. Parameters transferred in the request body when executing the PUT request on the URI are as follows:

{

    "isFileCache": "true",

    "description": "123",

    "prjCoordSys": {

        "coordUnit": "MILE",

        "name": "Tokyo UTM 51",

        "epsgCode": 3902,

        "projection": null,

        "coordSystem": null,

        "type": "PCS_USER_DEFINED",

        "distanceUnit": null,

        "projectionParam": null

    },

    "charset": "GB18030"

}

The response in json format is as follows:

{"succeed": true}

DELETE request

Delete the dataset. As to the sample dataset resource, or the URI, the DELETE request deletes the Countries dataset in the World datasource.

Request parameter

None.

Response structure

When executing the DELETE request on the dataset resource to delete a dataset, the response is as follows:

Field Type Description
succeed boolean Whether the delete operation is successful.
error HttpError Error message. If successful, the field will not exist.

Example usage

Execute the Delete request on the sample dataset resource with http://supermapiserver:8090/iserver/services/data-world/rest/data/datasources/name/World/datasets/name/Countries.rjson to delete the Countries dataset and get the response in rjson format.

{"succeed": true}

HEAD request

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.

The HEAD request helps check the existence of the dataset resource and whether it can be accessed by the client. By sending the HEAD request on the URI, with .<format> appended to the end, we can quickly get to know whether the dataset resource supports the representation in <format> or not.

See