Skip to content

Commit ae90bd4

Browse files
authored
Stac harvester example (#9114)
* add test * use example as online resource * thanks to lhbruneton, add stac doc
1 parent 4ed38c9 commit ae90bd4

File tree

7 files changed

+425
-0
lines changed

7 files changed

+425
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Simple URL harvesting (STAC Collection)
2+
3+
The STAC collection harvester, via a simple URL, allows for reading collections from a STAC catalog and generating metadata records with a "series" hierarchy level for each collection.
4+
5+
The elements being read are the following:
6+
7+
id => uuid
8+
9+
self link => online resource
10+
11+
href => linkage
12+
13+
collection/id => name
14+
15+
“STAC Collection” => protocole
16+
17+
items link : online resource
18+
19+
href => linkage
20+
21+
collection/id => name
22+
23+
“STAC Items” => protocole
24+
25+
example link => online resource
26+
27+
href => linkage
28+
29+
title => name
30+
31+
description => description
32+
33+
“WWW:LINK-1.0-http--link” => protocole
34+
35+
title => title
36+
37+
assets/thumbnail => graphic overview
38+
39+
extent/spatial => extent as geographic element
40+
41+
extent/temporal => extent as spatial element
42+
43+
contact => contact as point of contact
44+
45+
license => legal constraints as other
46+
47+
keywords => keywords
48+
49+
description => abstract
50+
51+
sci:doi
52+
53+
identifier
54+
55+
sci:doi => code with anchor
56+
57+
For example, a “sci:doi” of "10.5281/zenodo.15489231" will produce “<gcx:Anchor xlink:href="https://doi.org/10.18167/GEODE/8429">10.18167/GEODE/8429</gcx:Anchor>”
58+
59+
“doi.org” => code space
60+
61+
“Digital Object Identifier (DOI)” => description
62+
63+
online resource
64+
65+
same URL as the one forged for the code anchor => linkage
66+
67+
“DOI” => protocole
68+
69+
“Digital Object Identifier (DOI)” => name
70+
71+
72+
## Adding a simple URL harvester
73+
74+
Follow exactly the same steps as other **Simple URL** harvesters.

docs/manual/docs/user-guide/harvesting/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The following sources can be harvested:
2121
- [WFS GetFeature Harvesting](harvesting-wfs-features.md)
2222
- [SFTP Server Harvesting](harvesting-sftp.md)
2323
- [Database Harvesting](harvesting-database.md)
24+
- [Simple URL harvesting (STAC Collection)](harvesting-stac.md)
2425

2526
## Mechanism overview
2627

docs/manual/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ nav:
312312
- user-guide/harvesting/harvesting-webdav.md
313313
- user-guide/harvesting/harvesting-wfs-features.md
314314
- user-guide/harvesting/harvesting-database.md
315+
- user-guide/harvesting/harvesting-stac.md
315316
- user-guide/export/index.md
316317
- 'Administration':
317318
- administrator-guide/index.md

schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/convert/stac-to-iso19115-3.xsl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,30 @@
372372
</cit:CI_OnlineResource>
373373
</mrd:onLine>
374374
</xsl:for-each>
375+
<xsl:for-each select="links[rel = 'example']">
376+
<mrd:onLine>
377+
<cit:CI_OnlineResource>
378+
<cit:linkage>
379+
<gco:CharacterString>
380+
<xsl:value-of select="href" />
381+
</gco:CharacterString>
382+
</cit:linkage>
383+
<cit:protocol>
384+
<gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
385+
</cit:protocol>
386+
<cit:name>
387+
<gco:CharacterString>
388+
<xsl:value-of select="title" />
389+
</gco:CharacterString>
390+
</cit:name>
391+
<cit:description>
392+
<gco:CharacterString>
393+
<xsl:value-of select="description" />
394+
</gco:CharacterString>
395+
</cit:description>
396+
</cit:CI_OnlineResource>
397+
</mrd:onLine>
398+
</xsl:for-each>
375399
<xsl:if test="sci_doi">
376400
<mrd:onLine>
377401
<cit:CI_OnlineResource>

schemas/iso19115-3.2018/src/test/java/org/fao/geonet/schema/StacConversionTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public void biomassAnWood() throws Exception {
5757
transformAndCompare("convert/stac-to-iso19115-3.xsl", "biomass-and-wood-input.xml", "biomass-and-wood-output.xml");
5858
}
5959

60+
@Test
61+
public void sigma0Orthorectified() throws Exception {
62+
transformAndCompare("convert/stac-to-iso19115-3.xsl", "sigma0-orthorectified-input.xml", "sigma0-orthorectified-output.xml");
63+
}
64+
65+
6066
private void transformAndCompare(String scriptName, String inputFileName, String expectedFileName) throws Exception {
6167
Path xslFile = getResourceInsideSchema(scriptName);
6268
Path xmlFile = getResource("stacHarvester/" + inputFileName);
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<record>
3+
<extent>
4+
<spatial>
5+
<bbox>
6+
<array>-74.09588341465607</array>
7+
<array>-9.134063464712527</array>
8+
<array>106.9388018263829</array>
9+
<array>51.451182205314446</array>
10+
</bbox>
11+
</spatial>
12+
<temporal>
13+
<interval>
14+
<array>2016-01-07T21:43:09.979297Z</array>
15+
<array>2025-10-31T06:16:45.767000Z</array>
16+
</interval>
17+
</temporal>
18+
</extent>
19+
<license>etalab-2.0</license>
20+
<stac_version>1.1.0</stac_version>
21+
<assets>
22+
<QL>
23+
<roles>thumbnail</roles>
24+
<description>quicklook</description>
25+
<href>https://i.ibb.co/RDZ0xzf/sentinel-1-quicklook.png</href>
26+
<type>image/png</type>
27+
</QL>
28+
</assets>
29+
<description>Sentinel-1 sigma0 orthorectified images produced at the MTD Geospatial Data Center</description>
30+
<links>
31+
<rel>items</rel>
32+
<href>https://stacapi-cdos.apps.okd.crocc.meso.umontpellier.fr/collections/s1-grd-sigma0-ortho/items</href>
33+
<type>application/geo+json</type>
34+
</links>
35+
<links>
36+
<rel>parent</rel>
37+
<href>https://stacapi-cdos.apps.okd.crocc.meso.umontpellier.fr/</href>
38+
<type>application/json</type>
39+
</links>
40+
<links>
41+
<rel>root</rel>
42+
<href>https://stacapi-cdos.apps.okd.crocc.meso.umontpellier.fr/</href>
43+
<type>application/json</type>
44+
</links>
45+
<links>
46+
<rel>self</rel>
47+
<href>https://stacapi-cdos.apps.okd.crocc.meso.umontpellier.fr/collections/s1-grd-sigma0-ortho</href>
48+
<type>application/json</type>
49+
</links>
50+
<links>
51+
<rel>items</rel>
52+
<href>https://api.stac.teledetection.fr/collections/s1-grd-sigma0-ortho/items</href>
53+
<type>application/geo+json</type>
54+
</links>
55+
<links>
56+
<rel>http://www.opengis.net/def/rel/ogc/1.0/queryables</rel>
57+
<href>https://api.stac.teledetection.fr/collections/s1-grd-sigma0-ortho/queryables</href>
58+
<type>application/schema+json</type>
59+
<title>Queryables</title>
60+
</links>
61+
<links>
62+
<example_language>HTML</example_language>
63+
<rel>example</rel>
64+
<description>A single page application to visualize STAC assets</description>
65+
<href>https://browser.stac.teledetection.fr/collections/s1-grd-sigma0-ortho</href>
66+
<example_container>true</example_container>
67+
<type>text/html</type>
68+
<title>Open the collection in STAC-Browser</title>
69+
</links>
70+
<links>
71+
<rel>http://www.opengis.net/def/rel/ogc/1.0/queryables</rel>
72+
<href>https://stacapi-cdos.apps.okd.crocc.meso.umontpellier.fr/collections/s1-grd-sigma0-ortho/queryables</href>
73+
<type>application/schema+json</type>
74+
<title>Queryables</title>
75+
</links>
76+
<id>s1-grd-sigma0-ortho</id>
77+
<type>Collection</type>
78+
<title>Sentinel-1 sigma0 ortho</title>
79+
<stac_extensions>https://stac-extensions.github.io/mgrs/v1.0.0/schema.json</stac_extensions>
80+
<stac_extensions>https://stac-extensions.github.io/product/v0.1.0/schema.json</stac_extensions>
81+
<stac_extensions>https://stac-extensions.github.io/projection/v1.1.0/schema.json</stac_extensions>
82+
<stac_extensions>https://stac-extensions.github.io/timestamps/v1.1.0/schema.json</stac_extensions>
83+
<stac_extensions>https://forge.inrae.fr/teledec/stac-extensions/schemas/-/raw/main/production/v1.1.0/schema.json</stac_extensions>
84+
<stac_extensions>https://stac-extensions.github.io/processing/v1.2.0/schema.json</stac_extensions>
85+
<stac_extensions>https://stac-extensions.github.io/sentinel-1/v0.2.0/schema.json</stac_extensions>
86+
<stac_extensions>https://stac-extensions.github.io/sat/v1.0.0/schema.json</stac_extensions>
87+
<stac_extensions>https://stac-extensions.github.io/raster/v1.1.0/schema.json</stac_extensions>
88+
<stac_extensions>https://stac-extensions.github.io/sar/v1.0.0/schema.json</stac_extensions>
89+
<stac_extensions>https://stac-extensions.github.io/sentinel-2/v1.0.0/schema.json</stac_extensions>
90+
<stac_extensions>https://stac-extensions.github.io/contacts/v0.1.1/schema.json</stac_extensions>
91+
<stac_extensions>https://stac-extensions.github.io/example-links/v0.0.1/schema.json</stac_extensions>
92+
<contacts>
93+
<organization>INRAE</organization>
94+
<name>Loic Lozach</name>
95+
</contacts>
96+
<uuid>s1-grd-sigma0-ortho</uuid>
97+
<apiUrl>https://stacapi-cdos.apps.okd.crocc.meso.umontpellier.fr/collections</apiUrl>
98+
<nodeUrl>https://stacapi-cdos.apps.okd.crocc.meso.umontpellier.fr</nodeUrl>
99+
</record>

0 commit comments

Comments
 (0)