Git Product home page Git Product logo

wtss-spec's Introduction

Web Time Series Service - Specification

Software License Software Life Cycle Release Join us at Discord

About

Web Time Series Service (WTSS) is a lightweight web service for handling time series data from remote sensing imagery. Given a location and a time interval you can retrieve the according time series as a JSON array of numbers.

In WTSS a coverage is a three dimensional array associate to spatial and temporal reference systems.

WTSS is based on three operations:

  • list_coverages: returns the list of all available coverages in the service.
  • describe_coverage: returns the metadata of a given coverage.
  • time_series: query the database for the list of values for a given location and time interval.

There are free and open source implementations based on this specification:

  • wtss-server: is a WTSS web server implemented in Python.
  • wtss.py: is a client API for Python.
  • wtss: is a client API for R.

Repository Organization

Overview of Service Operations

list_coverages

The list_coverages operation can be used as follow:

http://myserver/

It will return a JSON document such as:

{
    "wtss_version": "2.0.0",
    "links": [
        {
            "rel": "service-docs",
            "title": "Documentation for WTSS",
            "href": "http://myserver/docs"
        },
        {
            "rel": "data",
            "title": "S2-SEN2COR_10_16D_STK-1",
            "href": "http://myserver/S2-SEN2COR_10_16D_STK-1"
        },
        {
            "rel": "data",
            "title": "CB4_64_16D_STK-1",
            "href": "http://myserver/CB4_64_16D_STK-1"
        }
    ]
}

describe_coverage

If you need the metadata of a given coverage you can use the describe_coverage operation as follow:

http://myserver/<CollectionId>

The result of describe_coverage operation is a JSON document such as:

{
    "name": "S2-SEN2COR_10_16D_STK",
    "version": 1,
    "fullname": "S2-SEN2COR_10_16D_STK-1",
    "description": "This datacube was generated with all available surface reflectance images processed using Sen2cor (ilumination corrections on). The data is provided with 10 meters of spatial resolution, reprojected and cropped to BDC_SM grid, considering a temporal compositing function of 16 days using the best pixel approach (Stack).",
    "title": "Sentinel-2 - MSI - Sen2cor - Cube Stack 16 days - v001",
    "timeline": [
        "2020-12-18",
        "2020-12-02",
        "2020-11-16"
    ],
    "bands": [
        {
            "name": "B01",
            "common_name": "coastal",
            "scale": 0.0001,
            "nodata": -9999.0,
            "data_type": "int16",
            "resolution_x": 10.0,
            "resolution_y": 10.0,
            "min_value": 0.0,
            "max_value": 10000.0
        },
        {
            "name": "B02",
            "common_name": "blue",
            "scale": 0.0001,
            "nodata": -9999.0,
            "data_type": "int16",
            "resolution_x": 10.0,
            "resolution_y": 10.0,
            "min_value": 0.0,
            "max_value": 10000.0
        },
        {
            "name": "B03",
            "common_name": "green",
            "scale": 0.0001,
            "nodata": -9999.0,
            "data_type": "int16",
            "resolution_x": 10.0,
            "resolution_y": 10.0,
            "min_value": 0.0,
            "max_value": 10000.0
        }
    ],
    "extent": {"type": "Polygon", "coordinates": []},
    "bdc:crs": "+proj=aea +lat_0=-12 +lon_0=-54 +lat_1=-2 +lat_2=-22 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +units=m +no_defs ",
    "grs_name": "BDC_SM",
    "raster_size": {
        "x": 16806,
        "y": 10986
    }
}

time_series

You can retrieve the time series for a given location through the time_series:

http://myserver/S2-SEN2COR_10_16D_STK-1/timeseries

With body:

{
    "attributes": [
        "NDVI"
    ],
    "start_datetime": "2017-01-01T00:00:00Z",
    "end_datetime": "2017-01-16T23:00:00Z",
    "geom": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    -54.0,
                    -12.0
                ],
                [
                    -54.0,
                    -11.99
                ],
                [
                    -53.99,
                    -11.99
                ],
                [
                    -53.99,
                    -11.99
                ],
                [
                    -54.0,
                    -12.0
                ]
            ]
        ]
    }
}

The result of time_series is a JSON document such as:

{
    "result": {
        [
            {
                "pixel_center": {
                    "type": "Point",
                    "coordinates": [
                        -53.99998107263968,
                        -11.989973727535231
                    ]
                },
                "time_series": {
                    "timeline": [
                        "2017-01-01",
                        "2017-01-17"
                    ],
                    "values": {
                        "NDVI": [
                            7919,
                            8457
                        ]
                    }
                }
            }
        ]
    },
    "query": {
        "collectionId": "S2-SEN2COR_10_16D_STK-1",
        "attributes": [ "red", "nir" ],
        "geom": {
            "type": "Polygon",
            "coordinates": [
                [
                    [
                        -54.0,
                        -12.0
                    ],
                    [
                        -54.0,
                        -11.99
                    ],
                    [
                        -53.99,
                        -11.99
                    ],
                    [
                        -53.99,
                        -11.99
                    ],
                    [
                        -54.0,
                        -12.0
                    ]
                ]
            ]
        },
        "start_datetime": "2017-01-01T00:00:00Z",
        "end_datetime": "2017-01-16T23:00:00Z",
    }
}

Building the Documentation

Requirements

The build system for the REST API documentation relies on the Node.js run-time environment:

  • Node.js (Version 8+).
  • ReDoc: generates HTML reference documentation from an OpenAPI specification file.

Build

If you have Node.js installed, please, execute the following command to install the ReDoc dependency:

$ npm install

After that, generate the documentation:

$ npm run build

The above command will create a folder named dist with the bundled file index.html. You may open it in your web browser or may serve it with an HTTP Server.

For Python developers, you can serve the HTMl with:

python3 -m http.server 8080 --directory dist

License

Copyright (C) 2022 INPE.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

wtss-spec's People

Contributors

abnerernaniadsfatec avatar gqueiroz avatar raphaelrpl avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wtss-spec's Issues

Release version 0.7.0

Tasks:

  • Inform the right version in: api/wtss.yaml
  • Create a branch named: b-0.7.
  • Review the CHANGES.rst.
  • Review links in the documentation for the stable version (README.rst).
  • From the branch b-0.7, create a tag named: v0.7.0.
  • Merge branch b-0.7.0 into master.
  • In the master branch increase version in api/wtss.yaml to 0.8.0
  • Notify to the community the release of a new version.

Missing start_date and end_date in the section time_series - README.rst

The query object is not matching with request parameters.

http://myserver/wtss/time_series?coverage=mod13q1&attributes=red,nir&longitude=-54.0&latitude=-5.0&start_date=2000-02-18&end_date=2000-03-21

"query": {
        "coverage": "mod13q1",
        "attributes": [ "red", "nir" ],
        "longitude": -54,
        "latitude": -5
}

should be:

"query": {
        "coverage": "mod13q1",
        "attributes": [ "red", "nir" ],
        "longitude": -54,
        "latitude": -5,
        "start_date": "2000-02-18",
        "end_date": "2000-03-21"
}

Release Version 0.8.0

Tasks:

  • Inform the right version in: api/wtss.yaml
  • Create a branch named: b-0.8.
  • Review the CHANGES.rst.
  • Review links in the documentation for the stable version (README.rst).
  • From the branch b-0.8, create a tag named: v0.8.0.
  • Merge branch b-0.8 into master.
  • In the master branch increase version in api/wtss.yaml to 0.9.0
  • Notify to the community the release of a new version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.