Skip to content

Create API.md #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extra:

nav:
- Home: index.md
- API: API.md
- Development - Contributing: contributing.md
- Release notes: release-notes.md
- Performance Benchmarks: benchmark.html
Expand Down
67 changes: 67 additions & 0 deletions docs/src/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# API Specification

## API Specification for /tiles/x/y/z Endpoint

## Endpoint Description

`GET /tiles/{x}/{y}/{z}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abarciauskas-bgse I think we should try to follow the OGC specification here and use something like

GET /collections/{collection_id}/tiles/{x}/{y}/{z}

we will also add

GET /collections/
GET /collections/{collection_id}


This endpoint provides tiled data for specific geographical locations and times. Tiles are defined by their x, y, and z coordinates.

## Parameters

- **Path Parameters:**
- `x` (integer): The x coordinate of the tile.
- `y` (integer): The y coordinate of the tile.
- `z` (integer): The zoom level of the tile.

- **Query Parameters:**
- `collection_concept_id` (string, required): The concept ID of the collection.
- `variable` (string, required): The variable of interest.
- `timestamp` (string, required): The time for which data is requested, in ISO 8601 format.
- `colormap` (string, optional): The name of the colormap to apply.
- `rescale` (string, optional): The rescale range in the format `min,max`.

## Request Example

GET /tiles/1/2/3?collection_concept_id=C0000000000-YOCLOUD&variable=temperature&timestamp=2024-01-16T00:00:00Z&colormap=viridis&rescale=0,100


## Responses

- **200 OK:**
- Description: Successful response with tile data.
- Content type: `image/png`
- Body: [Binary Data]

- **400 Bad Request:**
- Description: The request is invalid. This can happen with missing required parameters or invalid parameter values.
- Content type: `application/json`
- Body:
```json
{
"error": "Invalid request parameters."
}
```

- **404 Not Found:**
- Description: No data found for the specified parameters.
- Content type: `application/json`
- Body:
```json
{
"error": "No data found for the provided coordinates and time."
}
```

- **500 Internal Server Error:**
- Description: Generic server error message for when an error has occurred on the server.
- Content type: `application/json`
- Body:
```json
{
"error": "Internal server error."
}
```