API

 

 

Spacemetric REST API Guide

1. Overview

1.1. HTTP verbs

The Spacemetric API tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP verbs.

Verb Usage

GET

Used to retrieve a resource

POST

Used to create a new resource

PUT

Used to update an existing resource. The complete resource will be overwritten.

PATCH

Used to update an existing resource, including partial updates

DELETE

Used to delete an existing resource

1.2. HTTP status codes

The Spacemetric API tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP status codes.

Status code Usage

200 OK

The request completed successfully

201 Created

New resource has been created successfully

204 No Content

The request has been executed successfully and the answer had no response content in return

400 Bad Request

The request was malformed. The response body will include an error providing further information

401 Unauthorized

The request has not been applied because it lacks valid authentication credentials for the target resource

403 Forbidden

The request has not been applied because the authenticated user does not own or have sufficient rights to view the requested resource

404 Not Found

The requested resource did not exist

500 Internal Server Error

There was an error processing the request on the server side. Please contact support for more information.

501 Not Implemented

The server does not support the functionality required to fulfill the request

2. Images

The Images resources is used to interact with the image catalogue and retrieve image data and metadata.

A GET request to /images will list all of the Keystone Images accessible in the catalogue. These can be further filtered upon by providing request parameters.

2.1.1. Request parameters

Parameter Description

limit

Maximum number of results to return

offset

Number of results to skip before returning

geometry

WKT Coordinate point, line, polygon or multipolygon that image must intersect

crs

The CRS for the geometry. The default CRS when not provided is EPSG:4326

productType

The product type is a label visible with each listing of images. This type is not a hard specific type, but more of a standardized optional tag helpful for narrowing down the results.

maxCloudCoverage

Returns only images with a lower Cloud Coverage than the value. Percentage between 0 and 100

startTime

Returns only images aquired after the parameter value. Value in seconds since the epoch.

stopTime

Returns only images aquired before the parameter. Value in seconds since the epoch.

platformName

Returns only images with the give platform name. String

platformVersion

Returns only images with the give platform version. Usually used in combination with Platform Name. String

sensorElevationLowerBound

 

sensorElevationUpperBound

 

sensorAzmuthLowerBound

 

sensorAzmuthUpperBound

 

2.1.2. Request Fields

The GET request to /images does not have a request content.

2.1.3. Response structure

Path Type Description

warnings

Array

Possible warnings raised during the search. Some of your criteria are likely to have been ignored.

images.[]

Array

An array of images

images.[]id

String

Unique ID of the Image

images.[]node

String

Unique ID of the Keystone Node the image comes from

images.[]name

String

Name of the Image

images.[]productType

String

Type of the Image. Types include VIDEO, …​

images.[]stripInstance

Object

Summary information about the StripInstance of the Image.

images.[]created

Number

Date at which the Image was created in Keystone

images.[]modified

Number

Date at which the Image was last modified in Keystone

2.1.4. Example HTTP request

GET /v1/images?limit=3&offset=12&geometry=POLYGON%20((30%2010,%2040%2040,%2020%2040,%2010%2020,%2030%2010))&crs=3006&productType=OCN&maxCloudCoverage=30&startTime=2016-12-18T13:21:43.700Z&stopTime=2016-12-18T13:21:43.800Z&platformName=SENTINEL%202A&platformVersion=2&sensorElevationLowerBound=0.04208223&sensorElevationUpperBound=0.04208224&sensorAzmuthLowerBound=-102.105&sensorAzmuthUpperBound=-102.095 HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest

2.1.5. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 353

{
  "images" : [ {
    "id" : "I29642",
    "node" : "External-Demo",
    "name" : "S2AT33VVF160614L1C160615165550MSBGRN",
    "productType" : "OCN",
    "stripInstance" : {
      "platformName" : "SENTINEL 2A",
      "platformVersion" : null
    },
    "created" : 1482063703700,
    "modified" : 1482063704700
  } ],
  "warnings" : [ ]
}

2.2. Getting an Image

The Image resource is used to retrieve individual images.

2.2.1. Path parameters

Table 1. /v1/images/{id}
Parameter Description

id

The ID of the image to return metadata for

2.2.2. Response structure

Path Type Description

id

String

Unique ID of the Image

node

String

Unique ID of the Keystone Node the image comes from

name

String

Name of the Image

productType

String

Type of the Image. Types include VIDEO, …​

stripInstance

Object

Summary information about the StripInstance of the Image.

created

Number

Date at which the Image was created in Keystone

modified

Number

Date at which the Image was last modified in Keystone

2.2.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/images/I15' -i
HTTP
GET /v1/images/I15 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

2.2.4. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 263

{
  "id" : "I15",
  "node" : "jh",
  "name" : "myAwesomeTestImage",
  "productType" : "productTypeX",
  "stripInstance" : {
    "platformName" : "myPlatform",
    "platformVersion" : null
  },
  "created" : 1494936127259,
  "modified" : 1494936127259
}

2.3. Retrieving DIMAP metadata for an image

It is possible to request for the metadata of an image in DIMAP format using a GET request. The metadata is returned in the form of a .dim XML file.

2.3.1. Path parameters

Table 2. /v1/images/{id}.dimap
Parameter Description

id

The ID of the image to return dimap metadata for

2.3.2. Example request

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/images/I15.dimap' -i
HTTP
GET /v1/images/I15.dimap HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

2.3.3. Example response

HTTP/1.1 200 OK
content-disposition: attachment; filename=I15.dim
Content-Length: 7377
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8"?>
<Dimap_Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Metadata_Id>
        <METADATA_FORMAT version="1.1">DIMAP</METADATA_FORMAT>
    </Metadata_Id>
    <Dataset_Id>
        <DATASET_NAME>BlueMarble</DATASET_NAME>
    </Dataset_Id>
    <Production>
        <DATASET_PRODUCER_NAME/>
        <DATASET_PRODUCTION_DATE>2012-01-20</DATASET_PRODUCTION_DATE>
        <PRODUCT_TYPE/>
    </Production>
    <Dataset_Use>
        <DATASET_CONTENT/>
    </Dataset_Use>
    <Data_Processing>
        <GEOMETRIC_PROCESSING/>
    </Data_Processing>
    <Coordinate_Reference_System>
        <GEO_TABLES>EPSG</GEO_TABLES>
        <Horizontal_CS>
            <HORIZONTAL_CS_CODE>EPSG:4326</HORIZONTAL_CS_CODE>
            <HORIZONTAL_CS_TYPE>GEOGRAPHIC</HORIZONTAL_CS_TYPE>
            <HORIZONTAL_CS_NAME>WGS 84</HORIZONTAL_CS_NAME>
            <Coordinate_Axis>
                <AXIS1_NAME>Geodetic latitude</AXIS1_NAME>
                <AXIS2_NAME>Geodetic longitude</AXIS2_NAME>
                <AXIS1_ORIENTATION>NORTH</AXIS1_ORIENTATION>
                <AXIS2_ORIENTATION>EAST</AXIS2_ORIENTATION>
            </Coordinate_Axis>
            <Geographic_CS>
                <GEOGRAPHIC_CS_NAME>WGS 84</GEOGRAPHIC_CS_NAME>
                <GEOGRAPHIC_CS_CODE>EPSG:4326</GEOGRAPHIC_CS_CODE>
                <Horizontal_Datum>
                    <HORIZONTAL_DATUM_NAME>World Geodetic System 1984</HORIZONTAL_DATUM_NAME>
                    <HORIZONTAL_DATUM_CODE>EPSG:6326</HORIZONTAL_DATUM_CODE>
                    <Ellipsoid>
                        <ELLIPSOID_NAME>WGS 84</ELLIPSOID_NAME>
                        <ELLIPSOID_CODE>EPSG:7030</ELLIPSOID_CODE>
                        <Ellipsoid_Parameters>
                            <ELLIPSOID_MAJOR_AXIS unit="M">6378137.0</ELLIPSOID_MAJOR_AXIS>
                            <ELLIPSOID_MINOR_AXIS unit="M">6356752.314245</ELLIPSOID_MINOR_AXIS>
                        </Ellipsoid_Parameters>
                    </Ellipsoid>
                    <Prime_Meridian>
                        <PRIME_MERIDIAN_NAME>Greenwich</PRIME_MERIDIAN_NAME>
                        <PRIME_MERIDIAN_CODE>EPSG:8901</PRIME_MERIDIAN_CODE>
                        <PRIME_MERIDIAN_OFFSET unit="DEG">0.0</PRIME_MERIDIAN_OFFSET>
                    </Prime_Meridian>
                </Horizontal_Datum>
            </Geographic_CS>
        </Horizontal_CS>
    </Coordinate_Reference_System>
    <Geoposition>
        <Geoposition_Insert>
            <ULXMAP unit="DEG">-179.9916666667</ULXMAP>
            <ULYMAP unit="DEG">89.99166666667</ULYMAP>
            <XDIM unit="DEG">0.008333327355501</XDIM>
            <YDIM unit="DEG">0.008333327355501</YDIM>
        </Geoposition_Insert>
    </Geoposition>
    <Raster_CS>
        <RASTER_CS_TYPE>POINT</RASTER_CS_TYPE>
    </Raster_CS>
    <Dataset_Frame>
        <Vertex>
            <FRAME_X unit="DEG">-179.9958333333</FRAME_X>
            <FRAME_Y unit="DEG">89.99583333333</FRAME_Y>
            <FRAME_LON unit="DEG">-179.9958333333</FRAME_LON>
            <FRAME_LAT unit="DEG">89.99583333333</FRAME_LAT>
            <FRAME_COL>-0.5</FRAME_COL>
            <FRAME_ROW>-0.5</FRAME_ROW>
        </Vertex>
        <Vertex>
            <FRAME_X unit="DEG">-179.9958333333</FRAME_X>
            <FRAME_Y unit="DEG">-90.00416666667</FRAME_Y>
            <FRAME_LON unit="DEG">-179.9958333333</FRAME_LON>
            <FRAME_LAT unit="DEG">-90.00416666667</FRAME_LAT>
            <FRAME_COL>-0.5</FRAME_COL>
            <FRAME_ROW>21599.5</FRAME_ROW>
        </Vertex>
        <Vertex>
            <FRAME_X unit="DEG">180.0041666667</FRAME_X>
            <FRAME_Y unit="DEG">-90.00416666667</FRAME_Y>
            <FRAME_LON unit="DEG">-179.9958333333</FRAME_LON>
            <FRAME_LAT unit="DEG">-90.00416666667</FRAME_LAT>
            <FRAME_COL>43199.5</FRAME_COL>
            <FRAME_ROW>21599.5</FRAME_ROW>
        </Vertex>
        <Vertex>
            <FRAME_X unit="DEG">180.0041666667</FRAME_X>
            <FRAME_Y unit="DEG">89.99583333333</FRAME_Y>
            <FRAME_LON unit="DEG">-179.9958333333</FRAME_LON>
            <FRAME_LAT unit="DEG">89.99583333333</FRAME_LAT>
            <FRAME_COL>43199.5</FRAME_COL>
            <FRAME_ROW>-0.5</FRAME_ROW>
        </Vertex>
    </Dataset_Frame>
    <Raster_Encoding>
        <NBITS>8</NBITS>
        <DATA_TYPE>BYTE</DATA_TYPE>
        <BYTEORDER>I</BYTEORDER>
    </Raster_Encoding>
    <Data_Access>
        <DATA_FILE_FORMAT>TIFF</DATA_FILE_FORMAT>
        <Data_File>
            <DATA_FILE_PATH href="blueMarble.tif"/>
        </Data_File>
    </Data_Access>
    <Raster_Dimensions>
        <NCOLS>43200</NCOLS>
        <NROWS>21600</NROWS>
        <NBANDS>3</NBANDS>
    </Raster_Dimensions>
    <Image_Interpretation>
        <Spectral_Band_Info>
            <BAND_INDEX>1</BAND_INDEX>
            <BAND_DESCRIPTION>RED</BAND_DESCRIPTION>
            <PHYSICAL_GAIN>1.0</PHYSICAL_GAIN>
            <PHYSICAL_BIAS>0.0</PHYSICAL_BIAS>
            <PHYSICAL_UNIT>unknown</PHYSICAL_UNIT>
        </Spectral_Band_Info>
        <Spectral_Band_Info>
            <BAND_INDEX>2</BAND_INDEX>
            <BAND_DESCRIPTION>GREEN</BAND_DESCRIPTION>
            <PHYSICAL_GAIN>1.0</PHYSICAL_GAIN>
            <PHYSICAL_BIAS>0.0</PHYSICAL_BIAS>
            <PHYSICAL_UNIT>unknown</PHYSICAL_UNIT>
        </Spectral_Band_Info>
        <Spectral_Band_Info>
            <BAND_INDEX>3</BAND_INDEX>
            <BAND_DESCRIPTION>BLUE</BAND_DESCRIPTION>
            <PHYSICAL_GAIN>1.0</PHYSICAL_GAIN>
            <PHYSICAL_BIAS>0.0</PHYSICAL_BIAS>
            <PHYSICAL_UNIT>unknown</PHYSICAL_UNIT>
        </Spectral_Band_Info>
    </Image_Interpretation>
    <Image_Display>
        <Band_Display_Order>
            <RED_CHANNEL>1</RED_CHANNEL>
            <GREEN_CHANNEL>2</GREEN_CHANNEL>
            <BLUE_CHANNEL>3</BLUE_CHANNEL>
        </Band_Display_Order>
        <Special_Value>
            <SPECIAL_VALUE_INDEX>0</SPECIAL_VALUE_INDEX>
            <SPECIAL_VALUE_TEXT>nodata</SPECIAL_VALUE_TEXT>
        </Special_Value>
        <Band_Statistics>
            <BAND_INDEX>1</BAND_INDEX>
            <STX_LIN_MIN>0.0</STX_LIN_MIN>
            <STX_LIN_MAX>256.0</STX_LIN_MAX>
            <STX_STDV>68.91291113195034</STX_STDV>
            <STX_MEAN>49.54412422486459</STX_MEAN>
            <STX_MIN>1.0</STX_MIN>
            <STX_MAX>255.0</STX_MAX>
        </Band_Statistics>
        <Band_Statistics>
            <BAND_INDEX>2</BAND_INDEX>
            <STX_LIN_MIN>0.0</STX_LIN_MIN>
            <STX_LIN_MAX>256.0</STX_LIN_MAX>
            <STX_STDV>65.4696268723783</STX_STDV>
            <STX_MEAN>49.93880117603031</STX_MEAN>
            <STX_MIN>1.0</STX_MIN>
            <STX_MAX>255.0</STX_MAX>
        </Band_Statistics>
        <Band_Statistics>
            <BAND_INDEX>3</BAND_INDEX>
            <STX_LIN_MIN>0.0</STX_LIN_MIN>
            <STX_LIN_MAX>256.0</STX_LIN_MAX>
            <STX_STDV>47.89848827291654</STX_STDV>
            <STX_MEAN>65.61838495019546</STX_MEAN>
            <STX_MIN>1.0</STX_MIN>
            <STX_MAX>255.0</STX_MAX>
        </Band_Statistics>
    </Image_Display>
</Dimap_Document>

2.4. Retrieving a cloudmask

It is possible to request for the cloudmask of an image using a GET request. Cloudmasks usually are returned in the form of a .gml file.

2.4.1. Path parameters

Table 3. /v1/images/{id}/cloudmask
Parameter Description

id

The ID of the image to request the cloudmask for

2.4.2. Example request

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/images/I15/cloudmask' -i
HTTP
GET /v1/images/I15/cloudmask HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

2.4.3. Example response

HTTP/1.1 501 Not Implemented
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 51

Error while requesting cloud mask. Service is null.

2.5. Retrieving an overview

It is possible to request for a georeferenced overview of an image using a GET request. Overviews are typically returned in the form of a GeoTiff file.

2.5.1. Path parameters

Table 4. /v1/images/{id}/overview
Parameter Description

id

The ID of the image to return overview for

2.5.2. Example request

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/images/I15/overview?size=400&crs=4326' -i
HTTP
GET /v1/images/I15/overview?size=400&crs=4326 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

2.5.3. Request parameters

Parameter Description

crs

The coordinate reference system to be used in the overview. Expressed as a 4 digit number (ESPG number). Default value is EPSG:4326

size

The size in pixels of the overview file. The maximal size for overviews is 4000 pixels. Default size is 400

2.5.4. Example response

HTTP/1.1 200 OK
content-disposition: attachment; filename=I15.tif
Content-Length: 5
Content-Type: application/octet-stream

�����

2.6. Retrieving a zoom image tile

It is possible to request for a zoom image tile of an image using a GET request. Image tiles are typically returned as stretched 3 bands png images. The zoomed tiles can be requested for any zoom level and for any position in the image.

2.6.1. Path parameters

Table 5. /v1/images/{id}/zoom/{zoomlevel}/{x}/{y}.png
Parameter Description

id

The ID of the image to return zoom tile for

zoomlevel

Zoom level of the output image. May be decimals. When no decimals are given the value corresponds to the pyramid levels of the image. 0 is full resolution. Negative values enlarges the image. The output resolution can be calculated like this: \$outputResolution=("fullResolution")/(2^"zoomlevel")\$

x

Center column coordinate of output image window. Refers to raw image. Note: is given in the scale of the raw image.

y

Center row coordinate of output image window. Refers to raw image. Note: is given in the scale of the raw image.

2.6.2. Example request

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/images/I15/zoom/0/230/400.png?width=512&height=512&interpolation=CC' -i
HTTP
GET /v1/images/I15/zoom/0/230/400.png?width=512&height=512&interpolation=CC HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

2.6.3. Request parameters

Parameter Description

width

Width of the output image. Maximum width is 1024. Default value is 512

height

Height of the output image. Maximum height is 1024. Default value is 512

interpolation

Interpolation method. Use CC or BICUBIC for Bicubic, use NN or NEAREST for Nearest neighbor and BL or BILINEAR for Bilinear interpolation . Default value is CC

2.6.4. Example response

HTTP/1.1 200 OK
Content-Length: 5
Content-Type: image/png

�����

3. Datasets

Images are organized in datasets. Even though it is possible to browse through the entire catalogue of available images, users will have to use datasets as entry point to create orders. A GET or POST request to /datasets will list all of the Keystone datasets accessible to the user.

3.1.1. Request parameters

There are no request parameters when retrieving a list of available datasets.

3.1.2. Request Fields

There are no request fields when retrieving a list of available datasets.

3.1.3. Response structure

Path Type Description

datasets

Array

Payload of the search

datasets.[]

Array

An array of Dataset resources

3.1.4. Example HTTP request

GET /v1/datasets HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest

3.1.5. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 259

{
  "datasets" : [ {
    "id" : "DefaultConfigPortalDataset",
    "name" : "Portal Default Dataset",
    "descUrl" : "http://spacemetric.com/rest/v1/datasets/DefaultConfigPortalDataset/description",
    "descText" : "Description of the dataset"
  } ]
}

3.2. Getting a specific dataset

The dataset resource is used to retrieve individual datasets and get more information about what products can be ordered from that dataset.

3.2.1. Path parameters

Table 6. /v1/datasets/{id}
Parameter Description

id

Identifier of the dataset to return information for

3.2.2. Response structure

Path Type Description

id

String

Identifier of the Dataset resource

name

String

Human readable name of the Dataset resource

descText

String

Long description of the Dataset resource

descUrl

String

URL pointing to a webpage describing the Dataset resource

3.2.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/datasets/DefaultConfigPortalDataset' -i
HTTP
GET /v1/datasets/DefaultConfigPortalDataset HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

3.2.4. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 224

{
  "id" : "DefaultConfigPortalDataset",
  "name" : "Portal Default Dataset",
  "descUrl" : "http://spacemetric.com/rest/v1/datasets/DefaultConfigPortalDataset/description",
  "descText" : "Description of the dataset"
}

3.3. Browsing the images of a dataset

Each dataset has a list of images, which can be searched by performing a GET or POST request to /datasets/{id}/images. The default search will browse the whole dataset, and searches can be tailored in a similar way as for images request.

3.3.1. Request parameters

Parameter Description

limit

Maximum number of results to return

offset

Number of results to skip before returning

geometry

WKT Coordinate point, line, polygon or multipolygon that image must intersect

crs

The CRS for the geometry. The default CRS when not provided is EPSG:4326

productType

The product type is a label visible with each listing of images. This type is not a hard specific type, but more of a standardized optional tag helpful for narrowing down the results.

maxCloudCoverage

Returns only images with a lower Cloud Coverage than the value. Percentage between 0 and 100

starttime

Returns only images aquired after the parameter value. Value in seconds since the epoch.

stoptime

Returns only images aquired before the parameter. Value in seconds since the epoch.

platformName

Returns only images with the give platform name. String

platformVersion

Returns only images with the give platform version. Usually used in combination with Platform Name. String

sensorElevationLowerBound

 

sensorElevationUpperBound

 

sensorAzmuthLowerBound

 

sensorAzmuthUpperBound

 

3.3.2. Request Fields

There are no request fields when retrieving a list of available images for a dataset.

3.3.3. Response structure

Path Type Description

images

Array

Payload of the search.

images.[]

Array

An array of Image resources

warnings

Array

Possible warnings raised during the search. Some of your criteria are likely to have been ignored.

3.3.4. Example HTTP request

GET /v1/datasets/DefaultConfigPortalDataset/images?limit=3&offset=0&crs=3006&geometry=POLYGON%20((30%2010,%2040%2040,%2020%2040,%2010%2020,%2030%2010))&productType=OCN&maxCloudCoverage=60&starttime=%7Bstarttime)&stoptime=2016-12-18T13:21:43.700Z&platformName=2016-12-18T13:21:43.800Z&platformVersion=SENTINEL%202A&sensorElevationLowerBound=2&sensorElevationUpperBound=0.04208223&sensorAzmuthLowerBound=0.04208224&sensorAzmuthUpperBound=-102.105 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

3.3.5. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 355

{
  "images" : [ {
    "id" : "I29642",
    "node" : "External-Demo",
    "name" : "S2AT33VVF160614L1C160615165550MSBGRN",
    "productType" : "IMAGE",
    "stripInstance" : {
      "platformName" : "SENTINEL 2A",
      "platformVersion" : null
    },
    "created" : 1494936123634,
    "modified" : 1494936124634
  } ],
  "warnings" : [ ]
}

3.4. Retrieve a single image of a dataset

Each dataset has a list of images, which you can get additional information for performing a GET or POST request to /datasets/{dataset_id}/images/{image_id}. The call will only return information in case the image belongs to the selected dataset. Results are very similar to generic image searches. image searches.

3.4.1. Response structure

Path Type Description

id

String

Unique ID of the Image

node

String

Unique ID of the Keystone Node the image comes from

name

String

Name of the Image

productType

String

Type of the Image. Types include VIDEO, …​

stripInstance

Object

Summary information about the StripInstance of the Image.

created

Number

Date at which the Image was created in Keystone

modified

Number

Date at which the Image was last modified in Keystone

3.4.2. Path parameters

Table 7. /v1/datasets/{dataset}/images/{image}
Parameter Description

dataset

Identifier of the dataset to return information for

image

Identifier of the image to return metadata for

3.4.3. Example HTTP request

GET /v1/datasets/DefaultConfigPortalDataset/images/I29642 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

3.4.4. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 289

{
  "id" : "I29642",
  "node" : "External-Demo",
  "name" : "S2AT33VVF160614L1C160615165550MSBGRN",
  "productType" : "IMAGE",
  "stripInstance" : {
    "platformName" : "SENTINEL 2A",
    "platformVersion" : null
  },
  "created" : 1494936121469,
  "modified" : 1494936121469
}

4. Orders

The Orders resources is used to interact with the product orders and retrieve their state and generated products. The orders section requires authentication to determine the owner of the orders.

A GET request to /orders will list all of the Keystone Orders accessible to the authenticated user.

4.1.1. Request parameters

Parameter Description

limit

Maximum number of results to return

offset

Number of results to skip before returning

4.1.2. Request Fields

The GET request to /orders does not have a request content.

4.1.3. Response structure

Path Type Description

orders.[]

Array

An array of orders

orders.[].id.id

String

The ID that identifies the order

orders.[].id.node

String

The catalogue ID, which also serves as the second part of a universal unique id.

orders.[].status

String

State of the order

4.1.4. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/orders?offset=12&limit=3' -i -H 'Content-Type: application/json'
HTTP
GET /v1/orders?offset=12&limit=3 HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest

4.1.5. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 174

{
  "orders" : [ {
    "id" : {
      "id" : "orderID",
      "node" : "myNodeName"
    },
    "name" : "myOrder",
    "status" : "Open",
    "items" : null
  } ]
}

4.2. Creating a new product order

A POST request to /orders will allow an authenticated user to create a new order.

The type of orders that can be created depend on the datasets in which the Product Orders are defined. Through datasets one can find the different orderable product types (/datasets/{id}/orderTypes) as well as which source imagery is eligible for the specific product types (/datasets/{id}/images). The order type is uniquely identified through productOrderOptionsId and the type itself is found in orderType.

Items of different types can still be ordered as part of a single order. Each item provided with an order is of one of the following types:

  • PRODUCT_ORDER (Image Collection) An Image collection type product is the default. Most image products will belongs to this category unless you would like to create a Mosaic product. The Image product type requires you to provide the following extra parameter:

    • imageID: This is the ID of the image (often the same as the name) used to derive the product from.

  • MOSAIC_ORDER A product based on a mosaic requires a user to have created a mosaic first in /mosaics. It then expects the following parameters:

    • mosaicID: This is the ID of the mosaic used as a source to create the product.

    • wktPolygon: The polygon or multi-polygon in well known text format, used to indicate the boudaries of the mosaic product.

Contrary to creating Mosaics, a new order is created complete with all items in one go. The reason is that one an order has been created successfully, it is queued for execution immediately.

4.2.1. Request parameters

There are no request (path) parameters for the create-order request.

4.2.2. Request Fields

The following request fields are required to create an Image based order.

Path Type Description

name

String

Name given to the order.

items.[]

Array

An array of requested products as separate items

items.[].imageID

String

Image Product: The ID from the image that is being processed.

items.[].productOrderOptionsId

String

The dataset specific product type id chosen to be created.

items.[].values.[]

Object

An array of key-value parameters specific to the order options ID

items.[].portalDataset

String

The portaldataset from which the specific order will be created. Sometimes it´s possible a similar product exists for multuple datasets.

Creating an order based on a mosaic requires the following request fields.

Path Type Description

name

String

Name given to the order.

items.[]

Array

An array of requested products as separate items

items.[].wktPolygon

String

Mosiac Product: A Well Known Text polygon or multipolygon that describes the bounds of the product.

items.[].mosaicID

String

Mosaic Product: The ID from the mosaic that is being processed.

items.[].productOrderOptionsId

String

The dataset specific product type id chosen to be created.

items.[].values.[]

Object

An array of key-value parameters specific to the order options ID

items.[].portalDataset

String

The portaldataset from which the specific order will be created. Sometimes it´s possible a similar product exists for multuple datasets.

  Please note that the supplied wktPolygon is used in most cases to derive a bounding box and cut the resulting product on the borders of this bounding box. Depending on the chosen dataset and product combination however, the application of the wktPolygon may vary in some cases.

4.2.3. Response structure

When an order has been successfully created, the response will contain the Id and Node of the order, which can be used to track the status of the order using the link /orders/{id}.

Path Type Description

id

String

ID of the newly created order.

node

String

Node Identity of the catalogue on which the order is placed.

4.2.4. Example requests

CURL

Image Collection request example:

$ curl 'https://swea.rymdstyrelsen.se/rest/v1/orders' -i -X POST -H 'Content-Type: application/json' -d '{
  "id" : null,
  "name" : "myOrder",
  "status" : null,
  "username" : null,
  "info" : [ "" ],
  "items" : [ {
    "id" : null,
    "name" : null,
    "status" : null,
    "productResourceAddress" : null,
    "info" : null,
    "image" : null,
    "imageName" : null,
    "productOrderOptionsId" : "Sentinel2StandardProduct",
    "values" : [ {
      "value" : "RGB",
      "optionId" : "S2POO_productType"
    } ],
    "layer" : null,
    "wktGeometry" : null,
    "listPrice" : 0.0,
    "currency" : null,
    "finalPrice" : 0.0,
    "portalDataset" : "PDS1",
    "imageID" : "ImageID1"
  }, {
    "id" : null,
    "name" : null,
    "status" : null,
    "productResourceAddress" : null,
    "info" : null,
    "image" : null,
    "imageName" : null,
    "productOrderOptionsId" : "Sentinel2StandardProduct",
    "values" : [ {
      "value" : "RGB",
      "optionId" : "S2POO_productType"
    } ],
    "layer" : null,
    "wktGeometry" : null,
    "listPrice" : 0.0,
    "currency" : null,
    "finalPrice" : 0.0,
    "portalDataset" : "PDS1",
    "imageID" : "ImageID2"
  } ]
}'

Mosaic request example:

$ curl 'https://swea.rymdstyrelsen.se/rest/v1/orders' -i -X POST -H 'Content-Type: application/json' -d '{
  "id" : null,
  "name" : "myOrder",
  "status" : null,
  "username" : null,
  "info" : [ "" ],
  "items" : [ {
    "id" : {
      "id" : "BI85",
      "node" : "myNode"
    },
    "name" : null,
    "status" : "Defined",
    "productResourceAddress" : "http://www.spacemetric.com/example/product/path/product_result.tif",
    "info" : null,
    "image" : {
      "id" : "I32",
      "node" : "myNode"
    },
    "imageName" : null,
    "productOrderOptionsId" : "Sentinel2StandardMosaicProduct",
    "values" : [ {
      "value" : "RGB",
      "optionId" : "S2POO_productType"
    }, {
      "value" : "övrig",
      "optionId" : "POO_FieldOfUse"
    }, {
      "value" : "industri",
      "optionId" : "POO_UserCategory"
    }, {
      "value" : "",
      "optionId" : "POO_AlterProductName"
    } ],
    "layer" : null,
    "wktGeometry" : null,
    "listPrice" : 0.0,
    "currency" : "EUR",
    "finalPrice" : 0.0,
    "portalDataset" : "PDS2",
    "mosaicID" : "MosaicID1",
    "wktPolygon" : "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"
  }, {
    "id" : {
      "id" : "BI85",
      "node" : "myNode"
    },
    "name" : null,
    "status" : "Defined",
    "productResourceAddress" : "http://www.spacemetric.com/example/product/path/product_result.tif",
    "info" : null,
    "image" : {
      "id" : "I33",
      "node" : "myNode"
    },
    "imageName" : null,
    "productOrderOptionsId" : "Sentinel2StandardMosaicProduct",
    "values" : [ {
      "value" : "RGB",
      "optionId" : "S2POO_productType"
    }, {
      "value" : "övrig",
      "optionId" : "POO_FieldOfUse"
    }, {
      "value" : "industri",
      "optionId" : "POO_UserCategory"
    }, {
      "value" : "",
      "optionId" : "POO_AlterProductName"
    } ],
    "layer" : null,
    "wktGeometry" : null,
    "listPrice" : 0.0,
    "currency" : "EUR",
    "finalPrice" : 0.0,
    "portalDataset" : "PDS2",
    "mosaicID" : "MosaicID2",
    "wktPolygon" : "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"
  } ]
}'
HTTP

Image Collection request example:

POST /v1/orders HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest
Content-Length: 1131

{
  "id" : null,
  "name" : "myOrder",
  "status" : null,
  "username" : null,
  "info" : [ "" ],
  "items" : [ {
    "id" : null,
    "name" : null,
    "status" : null,
    "productResourceAddress" : null,
    "info" : null,
    "image" : null,
    "imageName" : null,
    "productOrderOptionsId" : "Sentinel2StandardProduct",
    "values" : [ {
      "value" : "RGB",
      "optionId" : "S2POO_productType"
    } ],
    "layer" : null,
    "wktGeometry" : null,
    "listPrice" : 0.0,
    "currency" : null,
    "finalPrice" : 0.0,
    "portalDataset" : "PDS1",
    "imageID" : "ImageID1"
  }, {
    "id" : null,
    "name" : null,
    "status" : null,
    "productResourceAddress" : null,
    "info" : null,
    "image" : null,
    "imageName" : null,
    "productOrderOptionsId" : "Sentinel2StandardProduct",
    "values" : [ {
      "value" : "RGB",
      "optionId" : "S2POO_productType"
    } ],
    "layer" : null,
    "wktGeometry" : null,
    "listPrice" : 0.0,
    "currency" : null,
    "finalPrice" : 0.0,
    "portalDataset" : "PDS1",
    "imageID" : "ImageID2"
  } ]
}

Mosaic request example:

POST /v1/orders HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest
Content-Length: 2079

{
  "id" : null,
  "name" : "myOrder",
  "status" : null,
  "username" : null,
  "info" : [ "" ],
  "items" : [ {
    "id" : {
      "id" : "BI85",
      "node" : "myNode"
    },
    "name" : null,
    "status" : "Defined",
    "productResourceAddress" : "http://www.spacemetric.com/example/product/path/product_result.tif",
    "info" : null,
    "image" : {
      "id" : "I32",
      "node" : "myNode"
    },
    "imageName" : null,
    "productOrderOptionsId" : "Sentinel2StandardMosaicProduct",
    "values" : [ {
      "value" : "RGB",
      "optionId" : "S2POO_productType"
    }, {
      "value" : "övrig",
      "optionId" : "POO_FieldOfUse"
    }, {
      "value" : "industri",
      "optionId" : "POO_UserCategory"
    }, {
      "value" : "",
      "optionId" : "POO_AlterProductName"
    } ],
    "layer" : null,
    "wktGeometry" : null,
    "listPrice" : 0.0,
    "currency" : "EUR",
    "finalPrice" : 0.0,
    "portalDataset" : "PDS2",
    "mosaicID" : "MosaicID1",
    "wktPolygon" : "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"
  }, {
    "id" : {
      "id" : "BI85",
      "node" : "myNode"
    },
    "name" : null,
    "status" : "Defined",
    "productResourceAddress" : "http://www.spacemetric.com/example/product/path/product_result.tif",
    "info" : null,
    "image" : {
      "id" : "I33",
      "node" : "myNode"
    },
    "imageName" : null,
    "productOrderOptionsId" : "Sentinel2StandardMosaicProduct",
    "values" : [ {
      "value" : "RGB",
      "optionId" : "S2POO_productType"
    }, {
      "value" : "övrig",
      "optionId" : "POO_FieldOfUse"
    }, {
      "value" : "industri",
      "optionId" : "POO_UserCategory"
    }, {
      "value" : "",
      "optionId" : "POO_AlterProductName"
    } ],
    "layer" : null,
    "wktGeometry" : null,
    "listPrice" : 0.0,
    "currency" : "EUR",
    "finalPrice" : 0.0,
    "portalDataset" : "PDS2",
    "mosaicID" : "MosaicID2",
    "wktPolygon" : "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"
  } ]
}

4.2.5. Example response

HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 48

{
  "id" : "B1234",
  "node" : "myNodeName"
}

4.3. Getting an Order

The Order resource is used to retrieve individual orders.

4.3.1. Response structure

Path Type Description

name

String

Name given to the order.

status

String

State of the order

items.[]

Array

An array of requested products as separate items

items.[].imageID

String

Image Product: The ID from the image that is being processed.

items.[].id.id

String

The generated ID that identifies the order’s basketItem

items.[].id.node

String

The catalogue ID, which also serves as the second part of a universal unique id.

items.[].name

Null

Name of the order item.

items.[].productOrderOptionsId

String

The dataset specific product type id chosen to be created.

items.[].portalDataset

String

The portaldataset from which the specific order will be created. Sometimes it´s possible a similar product exists for multuple datasets.

items.[].status

String

The status of the individual item.

items.[].productResourceAddress

String

Download link to the resulting product once the processing has reached status completed

items.[].info

Null

Status information concerning the ETA of the order produced by the server.

4.3.2. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/orders/B85' -i
HTTP
GET /v1/orders/B85 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

4.3.3. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 496

{
  "id" : {
    "id" : "B85",
    "node" : "myNodeName"
  },
  "name" : "myOrder",
  "status" : "Open",
  "items" : [ {
    "id" : {
      "id" : "BI333",
      "node" : "myNode"
    },
    "name" : null,
    "status" : "Defined",
    "productResourceAddress" : "http://www.spacemetric.com/example/product/path/product_result.tif",
    "info" : null,
    "productOrderOptionsId" : "Sentinel2StandardProduct",
    "portalDataset" : "PDS1",
    "imageID" : "imageName1"
  } ]
}

4.4. Order Items

It is also possible to request the order items straight away.

4.4.1. Example requests

CURL

Example requesting all items inside an order:

$ curl 'https://swea.rymdstyrelsen.se/rest/v1/orders/B85/items' -i

Example requesting a single item inside an order:

$ curl 'https://swea.rymdstyrelsen.se/rest/v1/orders/B85/items/BI555' -i
HTTP

Example requesting all items inside an order:

GET /v1/orders/B85/items HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

Example requesting a single item inside an order:

GET /v1/orders/B85/items/BI555 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

4.4.2. Example response

An example response after requesting multiple order items:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 848

{
  "items" : [ {
    "id" : {
      "id" : "BI444",
      "node" : "myNode"
    },
    "name" : null,
    "status" : "Defined",
    "productResourceAddress" : "http://www.spacemetric.com/example/product/path/product_result.tif",
    "info" : null,
    "image" : {
      "id" : "I15",
      "node" : "myNodeName"
    },
    "productOrderOptionsId" : "Sentinel2StandardProduct",
    "values" : [ {
      "value" : "RGB",
      "optionId" : "S2POO_productType"
    }, {
      "value" : "övrig",
      "optionId" : "POO_FieldOfUse"
    }, {
      "value" : "industri",
      "optionId" : "POO_UserCategory"
    }, {
      "value" : "",
      "optionId" : "POO_AlterProductName"
    } ],
    "listPrice" : 0.0,
    "currency" : "EUR",
    "finalPrice" : 0.0,
    "portalDataset" : "PDS1",
    "imageID" : null
  } ]
}

An example response after requesting a single order items:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 762

{
  "id" : {
    "id" : "BI555",
    "node" : "myNode"
  },
  "name" : null,
  "status" : "Defined",
  "productResourceAddress" : "http://www.spacemetric.com/example/product/path/product_result.tif",
  "info" : null,
  "image" : {
    "id" : "I15",
    "node" : "myNodeName"
  },
  "productOrderOptionsId" : "Sentinel2StandardProduct",
  "values" : [ {
    "value" : "RGB",
    "optionId" : "S2POO_productType"
  }, {
    "value" : "övrig",
    "optionId" : "POO_FieldOfUse"
  }, {
    "value" : "industri",
    "optionId" : "POO_UserCategory"
  }, {
    "value" : "",
    "optionId" : "POO_AlterProductName"
  } ],
  "listPrice" : 0.0,
  "currency" : "EUR",
  "finalPrice" : 0.0,
  "portalDataset" : "PDS1",
  "imageID" : null
}

5. Mosaics

The mosaics resources is used to interact with Mosaics. Mosaics are created from stacks of images placed in a predefined order.

5.1. Listing mosaics

A GET request to /mosaics will list all of the Keystone mosaics accessible to the current user.

5.1.1. Request parameters

There are no request parameters when retrieving a list of available mosaics.

5.1.2. Request Fields

There are no request fields when retrieving a list of available mosaics.

5.1.3. Response structure

Path Type Description

mosaics

Array

Payload of the search

mosaics.[]

Array

An array of Mosaic resources

5.1.4. Example HTTP request

GET /v1/mosaics HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest

5.1.5. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 255

{
  "mosaics" : [ {
    "id" : "M01",
    "node" : "PRODUCTION-NODE",
    "name" : "Mosaic of Landsat 8 images over Zwolle, 2016",
    "owner" : "Julien Lengrand-Lambert",
    "modified" : null,
    "creator" : null,
    "elements" : [ ]
  } ]
}

5.2. Getting a Mosaic

The Mosaic resource is used to retrieve individual mosaics.

5.2.1. Path parameters

Table 8. /v1/mosaics/{id}
Parameter Description

id

The ID of the mosaic to return information about

5.2.2. Response structure

Path Type Description

id

String

Unique ID of the Mosaic

node

String

Unique Node of the Keystone Node the mosaic comes from

name

String

Name of the Mosaic

creator

String

Creator of the Mosaic

modified

Number

Date at which the mosaic was last modified in the system

owner

String

User that has admin rights over the Mosaic

elements

Array

Elements of the mosaic

elements.[]

Array

An array of Mosaic element resources

5.2.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/mosaics/M01' -i
HTTP
GET /v1/mosaics/M01 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

5.2.4. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 393

{
  "id" : "M01",
  "node" : "PRODUCTION-NODE",
  "name" : "Mosaic of Landsat 8 images over Zwolle, 2016",
  "owner" : "Julien Lengrand-Lambert",
  "modified" : 1494936129868,
  "creator" : "Julien Lengrand-Lambert",
  "elements" : [ {
    "id" : "M01I1",
    "node" : "External-Demo",
    "imageIdAndNode" : {
      "id" : "I29642",
      "node" : "External-Demo"
    }
  } ]
}

5.3. Creating a Mosaic

Mosaics can be created by performing a POST request to /mosaics

5.3.1. Path parameters

There are no path parameters when creating a new mosaic.

5.3.2. Response structure

Path Type Description

id

String

Unique ID of the created Mosaic

node

Null

Unique Node of the Keystone Node the mosaic was created on

5.3.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/mosaics' -i -X POST -H 'Content-Type: application/json' -d '{
  "oid" : 0,
  "name" : "A test mosaic",
  "rescale" : false,
  "mosaicImages" : [ ],
  "backgroundLayers" : [ ]
}'
HTTP
POST /v1/mosaics HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest
Content-Length: 122

{
  "oid" : 0,
  "name" : "A test mosaic",
  "rescale" : false,
  "mosaicImages" : [ ],
  "backgroundLayers" : [ ]
}

5.3.4. Example response

HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 38

{
  "id" : "M01",
  "node" : null
}

5.4. Deleting a Mosaic

Mosaics can be delete by performing a DELETE request to /mosaics/{id}

5.4.1. Path parameters

Table 9. /v1/mosaics/{id}
Parameter Description

id

The ID of the mosaic to delete.

5.4.2. Response structure

Deleting a Mosaic successfully will result in a 204 No Content and hence there is no content response structure.

5.4.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/mosaics/M01' -i -X DELETE
HTTP
DELETE /v1/mosaics/M01 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

5.4.4. Example response

HTTP/1.1 204 No Content
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

5.5. Getting Elements of a Mosaic

A mosaic is composed of elements. Those elements refer to catalogue images, but also contain additional elements such as specific processing parameters. A GET request to /mosaics/{id/}/elements will list all of the Keystone elements from a given mosaic.

5.5.1. Path parameters

Table 10. /v1/mosaics/{id}/elements
Parameter Description

id

The ID of the mosaic to return elements for

5.5.2. Response structure

Path Type Description

elements

Array

Payload of the search

elements.[]

Array

An array of Mosaic element resources

5.5.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/mosaics/M01/elements' -i
HTTP
GET /v1/mosaics/M01/elements HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

5.5.4. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 172

{
  "elements" : [ {
    "id" : "M01I1",
    "node" : "External-Demo",
    "imageIdAndNode" : {
      "id" : "I29642",
      "node" : "External-Demo"
    }
  } ]
}

5.6. Getting a Mosaic element

It is possible to retrieve a single element from a Mosaic by performing a GET request to /mosaics/{mosaic_id/}/elements/{element_id}.

5.6.1. Path parameters

Table 11. /v1/mosaics/{mosaic_id}/elements/{element_id}
Parameter Description

mosaic_id

The ID of the mosaic to return information about

element_id

The ID of the element to return information about

5.6.2. Response structure

Path Type Description

id

String

Unique ID of the Mosaic

node

String

Unique Node of the Keystone Node the mosaic comes from

imageIdAndNode

Object

Unique ID and node of the image the element is attached to

5.6.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/mosaics/M01/elements/MI1' -i
HTTP
GET /v1/mosaics/M01/elements/MI1 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

5.6.4. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 133

{
  "id" : "M01I1",
  "node" : "External-Demo",
  "imageIdAndNode" : {
    "id" : "I29642",
    "node" : "External-Demo"
  }
}

5.7. Adding an element to a mosaic

It is possible to add an element to a Mosaic by performing a POST request to /mosaics/{mosaic_id/}/elements.

5.7.1. Path parameters

Table 12. /v1/mosaics/{id}/elements
Parameter Description

id

The ID of the mosaic to add an element to

5.7.2. Request Fields

Path Type Description

imageIdAndNode

Object

Unique identifier of the catalogue image the element will refer to

5.7.3. Response structure

Path Type Description

id

String

Unique ID of the Element that has been attached to the mosaic

node

String

Unique Node of the Keystone Node the Element was created on

5.7.4. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/mosaics/M01/elements' -i -X POST -H 'Content-Type: application/json' -d '{
  "oid" : 0,
  "imageIdAndNode" : {
    "id" : "I29642",
    "node" : "External-Demo"
  },
  "rescale" : false,
  "strictNodata" : false,
  "shiftX" : 0.0,
  "shiftY" : 0.0,
  "shiftCrs" : 0
}'
HTTP
POST /v1/mosaics/M01/elements HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest
Content-Length: 205

{
  "oid" : 0,
  "imageIdAndNode" : {
    "id" : "I29642",
    "node" : "External-Demo"
  },
  "rescale" : false,
  "strictNodata" : false,
  "shiftX" : 0.0,
  "shiftY" : 0.0,
  "shiftCrs" : 0
}

5.7.5. Example response

HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 51

{
  "id" : "M01I1",
  "node" : "External-Demo"
}

5.8. Deleting a Mosaic element

It is possible to delete a single element from a Mosaic by performing a DELETE request to /mosaics/{mosaic_id/}/elements/{element_id}.

5.8.1. Path parameters

Table 13. /v1/mosaics/{id}/elements/{element_id}
Parameter Description

id

The ID of the mosaic to interact with.

element_id

The ID of the mosaic element to delete.

5.8.2. Response structure

Deleting a Mosaic element successfully will result in a 204 No Content and hence there is no content response structure.

5.8.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/mosaics/M01/elements/External-Demo:M01I1' -i -X DELETE
HTTP
DELETE /v1/mosaics/M01/elements/External-Demo:M01I1 HTTP/1.1
Host: https://swea.rymdstyrelsen.se/rest

5.8.4. Example response

HTTP/1.1 204 No Content
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

6. Subscriptions

A subscription is a user-created interest notion for new imagery. It is stored in the form of a query that will single out any new incoming imagery that satisfies the criteria of the user, such that he or she can be notified of it.

6.1. Retrieving all available subscriptions

A GET request to /subscriptions will list all of the Keystone Subscriptions accessible to the authenticated user.

6.1.1. Request parameters

There are no request parameters when retrieving a user´s list of subscriptions.

6.1.2. Request Fields

There are no request fields when retrieving a user´s list of subscriptions.

6.1.3. Response structure

Path Type Description

subscriptions.[]

Array

An array of subscriptions

subscriptions.[].id

String

The ID that identifies the subscription

subscriptions.[].name

String

Name given to the subscription by the user

subscriptions.[].description

String

Description of the query exectured as part of the subscription

subscriptions.[].user

String

The user, or owner, of the subscription. Will be filled in automatically when omitted.

subscriptions.[].created

Number

Date on which the subscription was created in

6.1.4. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/subscriptions' -i -H 'Content-Type: application/json'
HTTP
GET /v1/subscriptions HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest

6.1.5. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 236

{
  "subscriptions" : [ {
    "id" : "myNodeName:subscriptionId",
    "name" : "subscriptionName",
    "description" : "A description of the subscription (query)",
    "user" : "myUserName",
    "created" : 1479222470219
  } ]
}

6.2. Retrieving a single subscription

A GET request to /subscriptions/:id will retrieve a single subscription, as long as it belongs to the requesting user.

6.2.1. Path parameters

Table 14. /v1/subscriptions/{id}
Parameter Description

id

The ID of the subscription to return information for

6.2.2. Request Fields

There are no request fields when retrieving a single subscriptions.

6.2.3. Response structure

Path Type Description

id

String

The ID that identifies the subscription

name

String

Name given to the subscription by the user

created

Number

Date on which the subscription was created in

description

String

Description of the query exectured as part of the subscription

user

String

The user, or owner, of the subscription. Will be filled in automatically when omitted.

query

Object

The query being criteria an image should adhere to for it to be selected by the subscription

notification

Boolean

Whether the user will be nodified that an image is available

dataset

Null

Optional dataset associated to the subscription

created

Number

Date on which the subscription was created in

query.id

String

The id assigned to the Query on which the subscription is based.

query.crs

String

The projection of the search polygon

query.polygon

String

The polygon indicating the area of interest to which a user is subscribed

6.2.4. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/subscriptions/S006' -i -H 'Content-Type: application/json'
HTTP
GET /v1/subscriptions/S006 HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest

6.2.5. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 1586

{
  "id" : "S006",
  "name" : "subscriptionName",
  "description" : "A description of the subscription (query)",
  "user" : "myUserName",
  "order" : {
    "id" : "O007",
    "node" : "myNodeName"
  },
  "query" : {
    "startTime" : 1365336137749,
    "stopTime" : 1494936137749,
    "acquisitionWindow" : 1500,
    "tags" : null,
    "tagLogic" : null,
    "crs" : "EPSG:4326",
    "polygon" : "POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2))",
    "ordering" : null,
    "project" : null,
    "platformName" : null,
    "platformVersion" : null,
    "instrumentName" : null,
    "minAltitude" : null,
    "maxAltitude" : null,
    "sceneModelVersion" : null,
    "keywords" : null,
    "owner" : null,
    "sceneInstance" : null,
    "sceneId" : null,
    "modifiedBefore" : null,
    "modifiedAfter" : null,
    "createdBefore" : null,
    "createdAfter" : null,
    "maxCloudCoverage" : null,
    "images" : null,
    "imageNames" : [ "ImageName1", "ImageName2" ],
    "startTimeOfYear" : 1,
    "stopTimeOfYear" : 200,
    "resolutionLowerBound" : 20.0,
    "resolutionUpperBound" : 5000.0,
    "sensorAzimuthUpperBound" : null,
    "sensorAzimuthLowerBound" : null,
    "sensorElevationUpperBound" : null,
    "sensorElevationLowerBound" : null,
    "mosaic" : null,
    "id" : "abcde12345",
    "user" : null,
    "maxHits" : 20000,
    "description" : null,
    "queryName" : null,
    "portalDataset" : null,
    "queryType" : null
  },
  "notification" : false,
  "dataset" : null,
  "created" : 1494936137664
}

6.3. Creating a new subscription

A POST request to /subscriptions will create a new Keystone Subscriptions accessible to the authenticated user.

6.3.1. Request parameters

Parameter Description

6.3.2. Request Fields

Path Type Description

name

String

Name given to the subscription by the user

description

String

Description of the query exectured as part of the subscription

user

String

The user, or owner, of the subscription. Will be filled in automatically when omitted.

notification

Boolean

Whether the user will be nodified that an image is available

query

Object

The query being criteria an image should adhere to for it to be selected by the subscription

query.id

String

The id assigned to the Query on which the subscription is based.

query.crs

String

The projection of the search polygon

query.polygon

String

The polygon indicating the area of interest to which a user is subscribed

6.3.3. Response structure

Path Type Description

id

String

ID of the completely replaced subscription.

6.3.4. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/subscriptions' -i -X POST -H 'Content-Type: application/json' -d '{
  "oid" : 0,
  "id" : "SAnything",
  "name" : "subscriptionName",
  "description" : "A description of the subscription (query)",
  "user" : "myUserName",
  "order" : {
    "id" : "O007",
    "node" : "myNodeName"
  },
  "query" : {
    "oid" : 1337,
    "id" : "abcde12345",
    "maxHits" : 20000,
    "acquisitionWindow" : 1500,
    "crs" : "EPSG:4326",
    "polygon" : "POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2))",
    "requireImageFile" : false,
    "requireImageFileOrQuicklook" : false,
    "strictPolygon" : false,
    "showInternal" : false,
    "imageNames" : [ "ImageName1", "ImageName2" ],
    "startTimeOfYear" : 1,
    "stopTimeOfYear" : 200,
    "resolutionLowerBound" : 20.0,
    "resolutionUpperBound" : 5000.0,
    "reducedResolution" : 500
  },
  "notification" : false,
  "created" : "2016-11-16T11:54:01.109Z"
}'
HTTP
POST /v1/subscriptions HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest
Content-Length: 875

{
  "oid" : 0,
  "id" : "SAnything",
  "name" : "subscriptionName",
  "description" : "A description of the subscription (query)",
  "user" : "myUserName",
  "order" : {
    "id" : "O007",
    "node" : "myNodeName"
  },
  "query" : {
    "oid" : 1337,
    "id" : "abcde12345",
    "maxHits" : 20000,
    "acquisitionWindow" : 1500,
    "crs" : "EPSG:4326",
    "polygon" : "POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2))",
    "requireImageFile" : false,
    "requireImageFileOrQuicklook" : false,
    "strictPolygon" : false,
    "showInternal" : false,
    "imageNames" : [ "ImageName1", "ImageName2" ],
    "startTimeOfYear" : 1,
    "stopTimeOfYear" : 200,
    "resolutionLowerBound" : 20.0,
    "resolutionUpperBound" : 5000.0,
    "reducedResolution" : 500
  },
  "notification" : false,
  "created" : "2016-11-16T11:54:01.109Z"
}

6.3.5. Example response

HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 39

{
  "id" : "S007",
  "node" : null
}

6.4. Updating a subscription

A subscription can be either completely replaced using a PUT request to /subscriptions/:id, or partially updated by providing limited fields using a PATCH request to /subscriptions/:id.

6.4.1. Request parameters

There are no request parameters when updating a subscription.

6.4.2. Request Fields

Complete update format

Path Type Description

name

String

Name given to the subscription by the user

description

String

Description of the query exectured as part of the subscription

user

String

The user, or owner, of the subscription. Will be filled in automatically when omitted.

notification

Boolean

Whether the user will be nodified that an image is available

query

Object

The query being criteria an image should adhere to for it to be selected by the subscription

query.id

String

The id assigned to the Query on which the subscription is based.

query.crs

String

The projection of the search polygon

query.polygon

String

The polygon indicating the area of interest to which a user is subscribed

Partial update format

Path Type Description

name

String

Name given to the subscription by the user

description

String

Description of the query exectured as part of the subscription

user

String

The user, or owner, of the subscription. Will be filled in automatically when omitted.

notification

Boolean

Whether the user will be nodified that an image is available

query

Object

The query being criteria an image should adhere to for it to be selected by the subscription

query.id

String

The id assigned to the Query on which the subscription is based.

query.crs

String

The projection of the search polygon

query.polygon

String

The polygon indicating the area of interest to which a user is subscribed

6.4.3. Response structure

For both complete and partial updates

Path Type Description

id

String

ID of the completely replaced subscription.

6.4.4. Example requests

CURL

Complete update

$ curl 'https://swea.rymdstyrelsen.se/rest/v1/subscriptions/S007' -i -X PUT -H 'Content-Type: application/json' -d '{
  "oid" : 0,
  "id" : "S007",
  "name" : "subscriptionName",
  "description" : "A description of the subscription (query)",
  "user" : "myUserName",
  "order" : {
    "id" : "O007",
    "node" : "myNodeName"
  },
  "query" : {
    "oid" : 1337,
    "id" : "abcde12345",
    "maxHits" : 20000,
    "acquisitionWindow" : 1500,
    "crs" : "EPSG:4326",
    "polygon" : "POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2))",
    "requireImageFile" : false,
    "requireImageFileOrQuicklook" : false,
    "strictPolygon" : false,
    "showInternal" : false,
    "imageNames" : [ "ImageName1", "ImageName2" ],
    "startTimeOfYear" : 1,
    "stopTimeOfYear" : 200,
    "resolutionLowerBound" : 20.0,
    "resolutionUpperBound" : 5000.0,
    "reducedResolution" : 500
  },
  "notification" : false,
  "created" : "2016-11-16T11:54:01.109Z"
}'

Partial update

$ curl 'https://swea.rymdstyrelsen.se/rest/v1/subscriptions/S123' -i -X PATCH -H 'Content-Type: application/json' -d '{
  "oid" : 0,
  "id" : "S123",
  "name" : "newSubscriptionName",
  "description" : "A description of the subscription (query)",
  "user" : "myUserName",
  "order" : {
    "id" : "O007",
    "node" : "myNodeName"
  },
  "query" : {
    "oid" : 1337,
    "id" : "abcde12345",
    "maxHits" : 20000,
    "acquisitionWindow" : 1500,
    "crs" : "EPSG:1111",
    "polygon" : "POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2))",
    "requireImageFile" : false,
    "requireImageFileOrQuicklook" : false,
    "strictPolygon" : false,
    "showInternal" : false,
    "imageNames" : [ "ImageName1", "ImageName2" ],
    "startTimeOfYear" : 1,
    "stopTimeOfYear" : 200,
    "resolutionLowerBound" : 20.0,
    "resolutionUpperBound" : 5000.0,
    "reducedResolution" : 500
  },
  "notification" : false,
  "created" : "2016-11-16T11:54:01.109Z"
}'
HTTP

Complete update

PUT /v1/subscriptions/S007 HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest
Content-Length: 870

{
  "oid" : 0,
  "id" : "S007",
  "name" : "subscriptionName",
  "description" : "A description of the subscription (query)",
  "user" : "myUserName",
  "order" : {
    "id" : "O007",
    "node" : "myNodeName"
  },
  "query" : {
    "oid" : 1337,
    "id" : "abcde12345",
    "maxHits" : 20000,
    "acquisitionWindow" : 1500,
    "crs" : "EPSG:4326",
    "polygon" : "POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2))",
    "requireImageFile" : false,
    "requireImageFileOrQuicklook" : false,
    "strictPolygon" : false,
    "showInternal" : false,
    "imageNames" : [ "ImageName1", "ImageName2" ],
    "startTimeOfYear" : 1,
    "stopTimeOfYear" : 200,
    "resolutionLowerBound" : 20.0,
    "resolutionUpperBound" : 5000.0,
    "reducedResolution" : 500
  },
  "notification" : false,
  "created" : "2016-11-16T11:54:01.109Z"
}

Partial update

PATCH /v1/subscriptions/S123 HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest
Content-Length: 873

{
  "oid" : 0,
  "id" : "S123",
  "name" : "newSubscriptionName",
  "description" : "A description of the subscription (query)",
  "user" : "myUserName",
  "order" : {
    "id" : "O007",
    "node" : "myNodeName"
  },
  "query" : {
    "oid" : 1337,
    "id" : "abcde12345",
    "maxHits" : 20000,
    "acquisitionWindow" : 1500,
    "crs" : "EPSG:1111",
    "polygon" : "POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2))",
    "requireImageFile" : false,
    "requireImageFileOrQuicklook" : false,
    "strictPolygon" : false,
    "showInternal" : false,
    "imageNames" : [ "ImageName1", "ImageName2" ],
    "startTimeOfYear" : 1,
    "stopTimeOfYear" : 200,
    "resolutionLowerBound" : 20.0,
    "resolutionUpperBound" : 5000.0,
    "reducedResolution" : 500
  },
  "notification" : false,
  "created" : "2016-11-16T11:54:01.109Z"
}

6.4.5. Example response

For both complete and partial updates

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 39

{
  "id" : "S007",
  "node" : null
}

6.5. Removing a subscription

A DELETE request to /subscriptions/:id will remove the specific Keystone Subscription if it belongs to the authenticated user.

6.5.1. Path parameters

Table 15. /v1/subscriptions/{id}
Parameter Description

id

The ID of the subscription to delete

6.5.2. Request Fields

There are no request fields for the delete request

6.5.3. Response structure

The 204 No Content status is returned on successful deletion, which has therefore no response structure.

6.5.4. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/subscriptions/S006' -i -X DELETE -H 'Content-Type: application/json'
HTTP
DELETE /v1/subscriptions/S006 HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest

6.5.5. Example response

HTTP/1.1 204 No Content
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

6.6. Viewing images marked by the subscription

Each subscription contains a query which will select imagery that falls under the interest criteria defined. Issuing a GET request to subscriptions/:id/images will list all of the Keystone Images that would qualify for this subscription query.

6.6.1. Request parameters

Parameter Description

limit

Maximum number of results to return

offset

Number of results to skip before returning

6.6.2. Request Fields

There are no additional request fields when retrieving a list of available images belonging to a subscription.

6.6.3. Response structure

Path Type Description

warnings

Array

Possible warnings raised during the search. Some of your criteria are likely to have been ignored.

images.[]

Array

An array of images

images.[]id

String

Unique ID of the Image

images.[]node

String

Unique ID of the Keystone Node the image comes from

images.[]name

String

Name of the Image

images.[]productType

String

Type of the Image. Types include VIDEO, …​

images.[]stripInstance

Object

Summary information about the StripInstance of the Image.

images.[]created

Number

Date at which the Image was created in Keystone

images.[]modified

Number

Date at which the Image was last modified in Keystone

6.6.4. Example HTTP request

GET /v1/subscriptions/S222/images?limit=3&offset=12 HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest

6.6.5. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 668

{
  "images" : [ {
    "id" : "I29642",
    "node" : "External-Demo",
    "name" : "S2AT33VVF160614L1C160615165550MSBGRN",
    "productType" : "IMAGE",
    "stripInstance" : {
      "platformName" : "SENTINEL 2A",
      "platformVersion" : null
    },
    "created" : 1480089753654,
    "modified" : 1480089754654
  }, {
    "id" : "I29643",
    "node" : "External-Demo",
    "name" : "S2AT33VVF160614L1C160615165550MSBGRN",
    "productType" : "IMAGE",
    "stripInstance" : {
      "platformName" : "SENTINEL 2A",
      "platformVersion" : null
    },
    "created" : 1480089753654,
    "modified" : 1480089754654
  } ],
  "warnings" : [ ]
}

6.7. Getting a specific Subscription Image

Just like viewing images it is possible to retrieve the details of a single Image. When retrieving these details through a GET request to subscriptions/:id/images/:id will only return the image details when it would qualify as part of the subscription’s query constraints.

6.7.1. Path parameters

Table 16. /v1/subscriptions/{subscriptionId}/images/{imageId}
Parameter Description

subscriptionId

The ID of the subscription

imageId

The ID of the image to return metadata for

6.7.2. Response structure

Path Type Description

id

String

Unique ID of the Image

node

String

Unique ID of the Keystone Node the image comes from

name

String

Name of the Image

productType

String

Type of the Image. Types include VIDEO, …​

stripInstance

Object

Summary information about the StripInstance of the Image.

created

Number

Date at which the Image was created in Keystone

modified

Number

Date at which the Image was last modified in Keystone

6.7.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/subscriptions/S333/images/I2468' -i -H 'Content-Type: application/json'
HTTP
GET /v1/subscriptions/S333/images/I2468 HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest

6.7.4. Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 272

{
  "id" : "I2468",
  "node" : "NodeName",
  "name" : "S2AT33VV1234567890ABCDEFG",
  "productType" : "IMAGE",
  "stripInstance" : {
    "platformName" : "SENTINEL 2A",
    "platformVersion" : null
  },
  "created" : 1480337150908,
  "modified" : 1480337151908
}

7. Harvesters

The harvesters resources is used to interact with Keystone Harvesters. Harvesters are systems that control which data is fetched into the system from other sources. Operations on harvesters are admin level operations and are not accessible without authentication and authorization.

7.1. Creating a Harvest State Item

Harvest state items can be added to a Harvester and one of its states by by performing a POST request to /harvesters/{id}/state/{id}/item.

7.1.1. Path parameters

Table 17. /v1/harvesters/{harvester}/states/{harvesterState}/items
Parameter Description

harvester

The name of the harvester.

harvesterState

The name of the state object for the previously defined harvester.

7.1.2. Response structure

There is no response to a request to create a harvester state item

7.1.3. Example requests

CURL
$ curl 'https://swea.rymdstyrelsen.se/rest/v1/harvesters/harv/states/harvstate/items' -i -X POST -H 'Content-Type: application/json' -d '{
  "priority" : "1",
  "value" : "value of the new harvest state item object",
  "status" : {
    "fullName" : "com.spacemetric.product.harvester.landsat8.HarvestAwsLandsat8Task$AwsLandsat8ItemStatus#NEW"
  },
  "properties" : {
    "prop1" : "propvalue"
  }
}'
HTTP
POST /v1/harvesters/harv/states/harvstate/items HTTP/1.1
Content-Type: application/json
Host: https://swea.rymdstyrelsen.se/rest
Content-Length: 270

{
  "priority" : "1",
  "value" : "value of the new harvest state item object",
  "status" : {
    "fullName" : "com.spacemetric.product.harvester.landsat8.HarvestAwsLandsat8Task$AwsLandsat8ItemStatus#NEW"
  },
  "properties" : {
    "prop1" : "propvalue"
  }
}
Var denna artikel till hjälp?
0 av 0 tyckte detta var till hjälp
Har du fler frågor? Skicka en förfrågan

Kommentarer

0 kommentarer

logga in för att lämna en kommentar.