You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -6,252 +6,65 @@ A python FastAPI OGC DGGS API implementation
6
6
7
7
https://pydggsapi.readthedocs.io/en/latest/
8
8
9
+
10
+
9
11
## OGC API - Discrete Global Grid Systems
10
12
11
13
https://ogcapi.ogc.org/dggs/
12
14
13
15
OGC API - DGGS specifies an API for accessing data organised according to a Discrete Global Grid Reference System (DGGRS). A DGGRS is a spatial reference system combining a discrete global grid hierarchy (DGGH, a hierarchical tessellation of zones to partition) with a zone indexing reference system (ZIRS) to address the globe. Aditionally, to enable DGGS-optimized data encodings, a DGGRS defines a deterministic for sub-zones whose geometry is at least partially contained within a parent zone of a lower refinement level. A Discrete Global Grid System (DGGS) is an integrated system implementing one or more DGGRS together with functionality for quantization, zonal query, and interoperability. DGGS are characterized by the properties of the zone structure of their DGGHs, geo-encoding, quantization strategy and associated mathematical functions.
14
16
15
17

16
-
## Setup and Dependencies
17
-
18
-
1. setup virtual environment with micromamba file and active it.
In order to use DGGRID, the dggrid executable needs to be available. You can compile it yourself, or install into the conda/micromamba environment from conda-forge:
26
-
27
-
```
28
-
micromamba install -c conda-forge dggrid
29
-
```
30
18
31
-
2. run poetry to install dependencies
32
-
33
-
```
34
-
poetry install
35
-
```
19
+
## Setup
20
+
Please refer to the [Quick Setup](https://pydggsapi.readthedocs.io/en/latest/introduction.html#quick-setup) section from the documentation for details.
36
21
37
-
3. create local .env file from env.sample
22
+
## Configration and implementation details
38
23
39
-
```
40
-
DGGS_API_CONFIG=<Path to TinyDB>
41
-
DGGRID_PATH=<Path to dggrid executable>
42
-
```
43
-
44
-
4. Start the server for development:
45
-
46
-
```
47
-
export POETRY_DOTENV_LOCATION=.env && poetry run python pydggsapi/main.py
48
-
```
24
+
Please refer to the [Configuration](https://pydggsapi.readthedocs.io/en/latest/tinydb_configuration/index.html) section from the documentation for details.
49
25
26
+
## Example notebook
27
+
Please refer to the [Example](https://pydggsapi.readthedocs.io/en/latest/example_notebook/pydggsapi_demo_notebook.html#) section from the documentation for demonstration.
50
28
51
29
## Conformance Classes
52
30
53
-
The API implemented the dggrs-core, zone-query and zone data retrieval conformal class. The following list shows the conformance classes supported by the API. Users can also refer to the [example notebook](https://pydggsapi.readthedocs.io/en/latest/example_notebook/Endpoints_Examples.html) from the pydggsapi documentation for examples of the query endpoints.
31
+
The API implemented the dggrs-core, zone-query and zone data retrieval, conformal class. The following list shows the conformance classes supported by the API. Users can also refer to the [example notebook](https://pydggsapi.readthedocs.io/en/latest/example_notebook/Endpoints_Examples.html) from the pydggsapi documentation for examples of the query endpoints.
### Collections, Collection Providers and DGGRS providers
85
-
86
-
The are two parts of configurations.
87
-
88
-
User Configurations:
89
-
90
-
- Collections : to define a collection with meta data, how to access the data (collection provider) and which dggrs it support (dggrs provider).
91
-
92
-
System configurations:
93
-
94
-
- Collection Providers : Implementation to access the data.
95
-
- DGGRS providers : Implementation to support API endpoint operations for DGGS
96
-
97
-
Each data collection must be already formatted in one of the supported DGGRS implementation (ie. at least one columns to represent the zone ID)
98
-
99
-
#### An example for Collections definition (in TinyDB):
100
-
101
-
The below example shows how a collection is defined :
102
-
103
-
1. The collections ID (suitability_hytruck), it is the key of the collection.
104
-
105
-
2. meta data (title, description)
106
-
107
-
3. collection provider :
108
-
109
-
- providerId : the collection provider id that defined in [collection_providers section](#collection_provider_id)
110
-
- dggrsId : the dggrs ID that defined in [dggrs section](#dggrs_provider_id). It indicate the dggrs that comes with the data.
111
-
- maxzonelevel : the maximum refinement level that is support by the data with the dggrs defined above.
112
-
- getdata_params : it is collections provider specific, It use to provide details parameters for the get_data function implemented by collection providers.
#### An example for Collection Providers definition (in TinyDB):
139
-
140
-
The below example shows how a collection provider is defined :
141
-
142
-
<a name="collection_provider_id"></a>
143
-
144
-
1. collection provider ID : clickhouse (this will be used in the collections config under the collection_provider section)
145
-
146
-
2. classname : ["clickhouse_collection_provider\.ClickhouseCollectionProvider"](pydggsapi/dependencies/collections_providers/clickhouse_collection_provider.py) the implementation of the class (under [dependencies/collections_providers folder](pydggsapi/dependencies/collections_providers))
147
-
148
-
3. initial_params : parameters to initializing the class
- The datasource_id `my_zarr_data` must match with the id that defined in above ZarrCollectionProvider.
198
-
199
-
```
200
-
"collections": {"2":
201
-
{"suitability_hytruck_zarr":
202
-
{"title": "Suitability Modelling for Hytruck for Zarr Data format",
203
-
"description": "Desc",
204
-
"collection_provider": {
205
-
"providerId": "zarr",
206
-
"dggrsId": "igeo7",
207
-
"maxzonelevel": 9,
208
-
"getdata_params": {
209
-
datasource_id: "my_zarr_data",
210
-
"filepath": "<pathtozarrfolder>",
211
-
"zones_grps" : { "4": "res4", "5": "res5"}
212
-
}
213
-
}
214
-
}
215
-
}
216
-
}
217
-
}
218
-
```
219
-
220
-
#### An example for DGGRS providers definition (in TinyDB):
221
-
222
-
The following configuration defines a dggrs provider with :
223
-
224
-
<a name="dggrs_provider_id"></a>
225
-
226
-
1. dggrs provider ID : igeo7 and h3 (this will be used in the collections config under the collection_provider section)
227
-
228
-
2. ogc dggs API required descriptions for dggrs. (ex. title, shapeType etc.)
229
66
230
-
3. classname : "igeo7_dggrs_provider\.IGEO7Provider", "h3_dggrs_provider\.H3Provider" the implementation class info (under [dependencies/dggrs_providers folder](pydggsapi/dependencies/dggrs_providers))
0 commit comments