Hi Arun

This should be possible using REST calls to first create a coverage store 
(Coverage stores — GeoServer 2.23.x User 
Manual<https://docs.geoserver.org/latest/en/user/rest/api/coveragestores.html>) 
and then a coverage within it (Coverages — GeoServer 2.23.x User 
Manual<https://docs.geoserver.org/latest/en/user/rest/api/coverages.html>).

The easiest way of getting the definitions for these calls is to first create a 
store and layer in the UI then looking at the definitions using the REST 
interface e.g. 
/geoserver/rest/workspaces/<workspaceName>/coveragestores/<storeName>.xml and 
/geoserver/rest/workspaces/<worspaceName>/coveragestores/<storeName>/coverages/<coverageName>.xml.

Minimal example of coverage store

<coverageStore>
<name>Example_Coverage_Store</name>
<type>GeoTIFF</type>
<enabled>true</enabled>
<workspace>
<name>workspaceName</name>
</workspace>
<metadata>
<entry key="CogSettings.Key">
<cogSettings>
<useCachingStream>false</useCachingStream>
<rangeReaderSettings>HTTP</rangeReaderSettings>
</cogSettings>
</entry>
</metadata>
<__default>false</__default>
<url>cog://https://example.blob.core.windows.net/cogs/example_cog.tif</url>
</coverageStore>

Minimal example of coverage

<coverage>
<name>example_cog</name>
<nativeName>example_cog</nativeName>
<namespace>
<name>namespaceName</name>
</namespace>
<title>Example COG</title>
<enabled>true</enabled>
<advertised>true</advertised>
<store class="coverageStore">
<name>namespaceName:Example_Coverage_Store</name>
</store>
<nativeCoverageName>example_cog</nativeCoverageName>
</coverage>

Hope this helps

Tom




From: Arun Govind <arun.us...@gmail.com>
Sent: 06 March 2023 02:52
To: GeoServer Mailing List List <geoserver-users@lists.sourceforge.net>
Subject: [Geoserver-users] Automate COGs in GCS bucket-folder

Hi,
I have COGs in folders of a bucket in Google Cloud Storage (GCS) that I like to 
access and style (using a SLD) and publish automatically. Is it possible to 
somehow automate this with GeoServer and Python (geoserver-rest, gsconfig, 
etc.)?

If I understand correctly, with the recent GeoServer updates one can directly 
read COGs from GCS buckets.

COGs are data exported from GEE.

The plan is to have a bucket for each user, and folders within the bucket (e.g. 
each folder is a subscription of the user).

Please advise. Thank you.
Arun
Sganiwyd y neges hon am bob feirws hysbys wrth iddi adael Llywodraeth Cymru. 
Mae Llywodraeth Cymru yn cymryd o ddifrif yr angen i ddiogelu eich data. Os 
cysylltwch â Llywodraeth Cymru, mae ein hysbysiad 
preifatrwydd<”https://gov.wales/about/welsh-government-privacy-notice/?lang=cy”>
 yn esbonio sut rydym yn defnyddio eich gwybodaeth a sut rydym yn diogelu eich 
preifatrwydd. Rydym yn croesawu gohebiaeth yn Gymraeg. Byddwn yn anfon ateb yn 
Gymraeg i ohebiaeth a dderbynnir yn Gymraeg ac ni fydd gohebu yn Gymraeg yn 
arwain at oedi. On leaving the Welsh Government this email was scanned for all 
known viruses. The Welsh Government takes the protection of your data 
seriously. If you contact the Welsh Government then our Privacy 
Notice<https://gov.wales/about/welsh-government-privacy-notice/?lang=en> 
explains how we use your information and the ways in which we protect your 
privacy. We welcome receiving correspondence in Welsh. Any correspondence 
received in Welsh will be answered in Welsh and corresponding in Welsh will not 
lead to a delay in responding.
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to