Skip to content

Commit

Permalink
Fix/add gain gamma readme (#94)
Browse files Browse the repository at this point in the history
* add docs for gain,gamma in readme.md

* better explanation of gain,gamma situation with getMapUrl

* CR: change gain, gamma readme to more clear sentences
  • Loading branch information
zcernigoj authored May 21, 2020
1 parent d52a15e commit 5dcafea
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,25 @@ It is also possible to determine whether a layer supports a specific ApiType:
};
```
Gain and gamma effects are applied by the library (client-side) and are thus only available when the blob is retrieved (`getMap`) and not through the URL (`getMapUrl`).
```javascript
const getMapParamsWithGainAndGamma = {
bbox: bbox,
fromTime: new Date(Date.UTC(2018, 11 - 1, 22, 0, 0, 0)),
toTime: new Date(Date.UTC(2018, 12 - 1, 22, 23, 59, 59)),
width: 512,
height: 512,
format: MimeTypes.JPEG,
gain: 1.2,
gamma: 0.9
};
const imageBlob = await layer.getMap(getMapParamsWithGainAndGamma, ApiType.WMS);
const imageBlob2 = await layer.getMap(getMapParamsWithGainAndGamma, ApiType.PROCESSING);
```
When retrieving an image URL (via `getMapUrl()`) with gain and gamma applied, an error is thrown, because the retrieved URL points directly to the image on the services with no applied effects.
## Searching for data
Searching for the data is a domain either of a _layer_ or its _dataset_ (if available). This library supports different services, some of which (ProbaV and GIBS for example) specify availability dates _per layer_ and not dataset.
Expand Down Expand Up @@ -268,6 +287,8 @@ If we already have a WMS GetMap URL, we can use it directly:
const imageBlob4 = await legacyGetMapFromUrl(fullUrlWithWmsQueryString, ApiType.PROCESSING);
```

Gain and gamma effects are also supported in these two functions as a part of `wmsParams` or `fullUrlWithWmsQueryString`.

## Authentication for Processing API

Requests to Processing API need to be authenticated.
Expand Down

0 comments on commit 5dcafea

Please sign in to comment.