Skip to content

Commit 23e60df

Browse files
committed
* Add STACCatalog addon to support POST/PUT/DELETE of catalogs. This close issue jjrom#380
* Update documentation
1 parent 03208d8 commit 23e60df

23 files changed

+2262
-211
lines changed

README.md

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ Or test the API :
2323
* Get catalogs of products classified by continents - https://tamn.snapplanet.io/catalogs/classifications/geographical/continent?_pretty=1
2424
* Get catalogs of products classified by european countries - https://tamn.snapplanet.io/catalogs/classifications/geographical/continent/continent:Europe:6255148?_pretty=1
2525

26-
# Quick startup
26+
# Installation
27+
28+
## TL;DR
29+
The [INSTALLATION.md](./docs/INSTALLATION.md) file provides additional information on the installation process.
2730

2831
## Deploy the service
2932
To launch a default pre-configured resto instance, just type :
@@ -37,39 +40,11 @@ If you're using docker on Mac with apple Silicon M1 chip, be sure to **turn off
3740

3841
When this option is turned on, every calls to PHP preg_match function (which is used by resto) leads to a segmentation fault within php fpm and an HTTP 502 Bad Gateway error in nginx. Why ? I just don't know !
3942

40-
## Ingest a collection
41-
To ingest a collection using the default **ADMIN_USER_NAME** and **ADMIN_USER_PASSWORD** (see [config.env](config.env)) :
42-
43-
# POST a S2 dummy collection
44-
curl -X POST -d@examples/collections/S2.json "http://admin:admin@localhost:5252/collections"
45-
46-
Then get the collections list :
47-
48-
curl "http://localhost:5252/collections"
49-
50-
### Collection aliases
51-
A collection can contain an array of *aliases* (see [./examples/collections/L8.json](./examples/collections/L8.json#L3-L5) for instance). These aliases are alternate names to the collection id. Thus {collectionId} value in /collections/{collectionId}/* endpoints can use the original collection id or one of its aliases.
52-
53-
Note that id and aliases must be unique in the database. As a consequence, you cannot create a new collection or set an alias to an existing collection that as the same value of one of the aliases of an existing collection.
54-
55-
## Ingest a feature
56-
To ingest a feature using the default **ADMIN_USER_NAME** and **ADMIN_USER_PASSWORD** (see [config.env](config.env)) :
57-
58-
# POST a dummy feature inside the S2 collection
59-
curl -X POST -d@examples/features/S2A_MSIL1C_20190611T160901_N0207_R140_T23XMD_20190611T193040.json "http://admin:admin@localhost:5252/collections/S2/items"
60-
61-
# Update a dummy feature inside the S2 collection
62-
curl -X PUT -d@examples/features/testUpdate.json "http://admin:admin@localhost:5252/collections/S2/items/S2A_MSIL1C_20190611T160901_N0207_R140_T23XMD_20190611T193040"
63-
64-
Then get the feature :
65-
66-
curl "http://localhost:5252/collections/S2/items/S2A_MSIL1C_20190611T160901_N0207_R140_T23XMD_20190611T193040"
67-
6843
## Users, groups and rights
69-
See [./USERS.md](./USERS.md)
44+
See [./USERS.md](./docs/USERS.md)
7045

71-
# TL;DR
72-
The [INSTALLATION.md](INSTALLATION.md) file provides additional information on the installation process.
46+
## Collection and catalogs
47+
See [.COLLECTIONS_AND_CATALOGS.md](./docs/COLLECTIONS_AND_CATALOGS.md)
7348

7449
# References
7550

app/resto/core/RestoCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@
548548
* }
549549
* }
550550
* },
551-
* "stac_version": "0.8.0",
551+
* "stac_version": "1.0.0",
552552
* "stac_extensions": {
553553
* "https://stac-extensions.github.io/eo/v1.0.0/schema.json"
554554
* }

app/resto/core/RestoConstants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RestoConstants
2020
// [IMPORTANT] Starting resto 7.x, default routes are defined in RestoRouter class
2121

2222
// resto version
23-
const VERSION = '8.0.1';
23+
const VERSION = '8.0.7';
2424

2525
/* ============================================================
2626
* NEVER EVER TOUCH THESE VALUES

app/resto/core/RestoFeatureCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
* "type": "FeatureCollection",
8686
* "features":{
8787
* {
88-
* "stac_version": "0.8.0",
88+
* "stac_version": "1.0.0",
8989
* "stac_extensions": {
9090
* "https://stac-extensions.github.io/eo/v1.0.0/schema.json"
9191
* },
@@ -230,7 +230,7 @@
230230
* "type": "FeatureCollection",
231231
* "features":{
232232
* {
233-
* "stac_version": "0.8.0",
233+
* "stac_version": "1.0.0",
234234
* "stac_extensions": {
235235
* "https://stac-extensions.github.io/eo/v1.0.0/schema.json"
236236
* },

app/resto/core/RestoRouter.php

Lines changed: 51 additions & 47 deletions
Large diffs are not rendered by default.

app/resto/core/RestoUser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public function hasRightsTo($action, $params = array())
315315
// Only owner of catalog can do this
316316
case RestoUser::DELETE_CATALOG:
317317
case RestoUser::UPDATE_CATALOG:
318-
return $rights[$action] && isset($params['catalog']) && $params['catalog']->owner === $this->profile['id'];
318+
return $rights[$action] && isset($params['catalog']) && $params['catalog']['owner'] === $this->profile['id'];
319319

320320
// Only owner of feature can do this
321321
case RestoUser::DELETE_FEATURE:

app/resto/core/addons/STAC.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
* "title": "Legal notice on the use of Copernicus Sentinel Data and Service Information"
7373
* }
7474
* },
75-
* "stac_version": "0.9.0"
75+
* "stac_version": "1.0.0"
7676
* }
7777
* )
7878
*
@@ -1191,7 +1191,7 @@ private function setThemesLinks()
11911191
*/
11921192
private function setClassificationsLinks($root)
11931193
{
1194-
$facets = $this->stacUtil->getFacets($this->options['minMatch']);
1194+
$facets = $this->stacUtil->getFacetsCount($this->options['minMatch']);
11951195
$target = isset($root) && isset($facets['facets'][$root]) ? $facets['facets'][$root] : $facets['facets'];
11961196

11971197
if (isset($target) && is_array($target)) {

0 commit comments

Comments
 (0)