Skip to content

Commit 3901d33

Browse files
author
Tom Augspurger
authored
Merge pull request #30 from rbavery/geoparquet-in-collection
guidance on referencing a STAC Geoparquet Collection in a STAC Collection JSON
2 parents d791973 + 7cac0b0 commit 3901d33

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

spec/stac-geoparquet-spec.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This document specifies how to map a set of [STAC Items](https://github.com/radiantearth/stac-spec/tree/v1.0.0/item-spec) into
66
[GeoParquet](https://geoparquet.org). It is directly inspired by the [STAC GeoParquet](https://github.com/stac-utils/stac-geoparquet)
7-
library, but aims to provide guidance for anyone putting STAC data into GeoParquet.
7+
library, but aims to provide guidance for anyone putting STAC data into GeoParquet.
88

99
## Use cases
1010

@@ -32,7 +32,7 @@ most of the fields should be the same in STAC and in GeoParquet.
3232

3333
* Must be valid GeoParquet, with proper metadata. Ideally the geometry types are defined and as narrow as possible.
3434
* Strongly recommend to only have one GeoParquet per STAC 'Collection'. Not doing this will lead to an expanded GeoParquet schema (the union of all the schemas of the collection) with lots of empty data
35-
* Any field in 'properties' of the STAC item should be moved up to be a top-level field in the GeoParquet.
35+
* Any field in 'properties' of the STAC item should be moved up to be a top-level field in the GeoParquet.
3636
* STAC GeoParquet does not support properties that are named such that they collide with a top-level key.
3737
* datetime columns should be stored as a [native timestamp][timestamp], not as a string
3838
* The Collection JSON should be included in the Parquet metadata. See [Collection JSON](#collection-json) below.
@@ -68,13 +68,32 @@ To take advantage of Parquet's columnar nature and compression, the assets shoul
6868

6969
See [Asset Object][asset] for more.
7070

71-
## Collection JSON
71+
## Including a STAC Collection JSON in a STAC Geoparquet Collection
7272

7373
To make a stac-geoparquet file a fully self-contained representation, you can
7474
include the Collection JSON in the Parquet metadata. If present in the [Parquet
7575
file metadata][parquet-metadata], the key must be `stac:collection` and the
7676
value must be a JSON string with the Collection JSON.
7777

78+
## Referencing a STAC Geoparquet Collections in a STAC Collection JSON
79+
80+
A common use case of stac-geoparquet is to create a mirror of a STAC collection. To refer to this mirror in the original collection, use an [Asset Object](https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#asset-object) at the collection level of the STAC JSON that includes the `application/vnd.apache.parquet` Media type and `collection-mirror` Role type to describe the function of the Geoparquet STAC Collection Asset.
81+
82+
For example:
83+
84+
| Field Name | Type | Value |
85+
|-------------|-----------|-------------------------------------|
86+
| href | string | s3://example/uti/to/file.geoparquet |
87+
| title | string | An example STAC geoparquet. |
88+
| description | string | Example description. |
89+
| type | string | application/vnd.apache.parquet |
90+
| roles | \[string] | [collection-mirror]* |
91+
92+
*Note the IANA has not approved the new Media type `application/vnd.apache.parquet` yet, it's been (submitted for approval)[https://issues.apache.org/jira/browse/PARQUET-1889].
93+
94+
The description should ideally include details about the spatial partitioning method.
95+
96+
7897
## Mapping to other geospatial data formats
7998

8099
The principles here can likely be used to map into other geospatial data formats (GeoPackage, FlatGeobuf, etc), but we embrace Parquet's nested 'structs' for some of the mappings, so other formats will need to do something different. The obvious thing to do is to dump JSON into those fields, but that's outside the scope of this document, and we recommend creating a general document for that.

0 commit comments

Comments
 (0)