Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projection Extension #485

Merged
merged 56 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6ba4911
projection extension
Jun 7, 2019
8356be7
Merge remote-tracking branch 'upstream/dev' into projection
Jun 8, 2019
13c5a75
add recommended
Jun 9, 2019
dbc6eef
update crs fields
Jun 9, 2019
3799a23
Merge branch 'dev' into projection
Jun 10, 2019
b387331
change proj required fields
Jun 11, 2019
7a9a1f9
attributes on in Item Properties
Jun 11, 2019
0266e31
Merge branch 'dev' into projection
cholmes Jun 17, 2019
83706db
Merge branch 'dev' into projection
Jun 17, 2019
7d23542
add constraint to -180 180
Jun 17, 2019
4ac928c
Merge branch 'projection' of github.com:philvarner/stac-spec into pro…
Jun 17, 2019
bb9b745
Merge branch 'dev' into projection
Jun 20, 2019
bf32ab4
fix constraints on extent and centroid values
Jun 20, 2019
51a622a
rename extent to bbox
Jun 20, 2019
8f18bcd
Merge branch 'dev' into projection
joshfix Jun 21, 2019
fe2902d
Merge branch 'dev' into projection
Jun 21, 2019
70ba5b2
Merge branch 'dev' into projection
Jun 21, 2019
7e953c3
Merge branch 'dev' into projection
Jul 9, 2019
6fe837c
Merge branch 'dev' into projection
Jul 24, 2019
eaff656
update changelog and add extension to list in readme
Jul 24, 2019
2a939bd
move projection entry in changelog
Jul 24, 2019
309a172
Merge branch 'dev' into projection
Jul 30, 2019
7b0452a
redefine centroid
Jul 30, 2019
a0b93c9
Inherit from Item JSON Schema
m-mohr Jul 31, 2019
db491b5
Fixed JSON Schema
m-mohr Jul 31, 2019
ad3652b
Changed maxItems back to 3
m-mohr Jul 31, 2019
a7d48d8
Fixed example
m-mohr Jul 31, 2019
0bc10cf
remove asset projection example, clarify language, update schema
Aug 1, 2019
f40cc2c
Merge branch 'dev' into projection
cholmes Aug 1, 2019
e7458cd
Merge branch 'dev' into projection
Oct 30, 2019
848195d
Merge remote-tracking branch 'upstream/dev' into projection
Oct 31, 2019
d7e3229
Merge branch 'dev' into projection
Nov 7, 2019
855a29b
update field names to remove colon prefixes
Nov 7, 2019
c68891d
Merge branch 'projection' of github.com:philvarner/stac-spec into pro…
Nov 7, 2019
fc02958
Merge branch 'dev' into projection
Dec 2, 2019
4581cc0
cleanup changelog
Dec 2, 2019
a580b5a
update projection
Dec 2, 2019
a4a61ec
Merge branch 'dev' into projection
matthewhanson Dec 3, 2019
594c433
Merge branch 'dev' into projection
matthewhanson Dec 17, 2019
a7cc6f1
remove 'eo' prefix from epsg, add wkt2 and projjson fields
Dec 17, 2019
ca78722
Merge branch 'dev' into projection
Dec 17, 2019
ab1d97d
remove eo:epsg in favor of proj:epsg
Dec 17, 2019
3f28136
update changelog with projection info
Dec 17, 2019
688faf3
proj minor updates
Dec 17, 2019
c0c66c4
Merge branch 'dev' into projection
Dec 17, 2019
a00d1ed
fix projection projjson null or object
Dec 17, 2019
1a26c36
Merge branch 'projection' of github.com:philvarner/stac-spec into pro…
Dec 17, 2019
7417553
proj constraints on centroid lat and lon
Dec 18, 2019
fe6e476
projection: remove recommended from fields
Dec 18, 2019
a8b51d5
projection: add to bbox definition 3D descriptions
Dec 18, 2019
4842a63
projection: geometry is Polygon or MultiPolygon
Dec 18, 2019
1b1087e
projection geometry can only be Polygon
Dec 18, 2019
2e2bf00
projection: add example and readme links
Dec 18, 2019
cdef610
add projection extension definition to items that use it
Dec 18, 2019
f22ac65
make projection example valid STAC Item
Dec 18, 2019
9be47e9
Merge branch 'dev' into projection
matthewhanson Dec 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions extensions/projection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Projection Extension Specification (`proj`)

**Extension [Maturity Classification](../README.md#extension-maturity): Proposal**

This document explains the fields of the STAC Projection (`proj`) Extension to a STAC Item. Here `proj` is short
for "projection", and not a reference to the use of the PROJ format for the CRS attribute.

The field names defined herein should be added as fields in the Item's Properties object.

When specified on an Item, the values are assumed to apply to all Assets in that Item. For example, an Item may have several related Assets each representing a band for the Item, all of which are in the same native CRS, e.g., a UTM Zone. However, there may also be assets intended for display, like a preview image or thumbnail, that have been reprojected to a different CRS, e.g., Web Mercator, to better accommodate that use case. This case of differing projections per Asset is not currently handled by this extension.

## Item Properties fields

| Field Name | Type | Description |
| ---------------- | ------------------------ | ----------- |
| proj:epsg | integer\|null | **Required** [EPSG code](http://www.epsg-registry.org/) of the datasource |
| proj:crs | string \|null | Recommended. PROJ string representing the Coordinate Reference System (CRS) that the `proj:geometry` and `proj:extent` fields represent |
| proj:geometry | Polygon Object | Recommended. Defines the footprint of this item. |
| proj:extent | [number] | Recommended. Bounding box of the item or asset in the native CRS |
| proj:centroid | [number] | Recommended. Coordinates representing the centroid of the item or asset in the native CRS |

**proj:epsg** - A Coordinate Reference System (CRS) is the native reference system (sometimes called a
'projection') used by the data, and can usually be referenced using an [EPSG code](http://epsg.io).
If the data does not have a CRS, such as in the case of non-rectified imagery with Ground Control
Points, proj:epsg should be set to null. It should also be set to null if a CRS exists, but for which
there is no valid EPSG code.

**proj:crs** - A Coordinate Reference System (CRS) is the native reference system (sometimes called a
'projection') used by the data. This value is a PROJ string.
If the data does not have a CRS, such as in the case of non-rectified imagery with Ground Control
Points, proj:crs should be set to null. It should also be set to null if a CRS exists, but for which
a PROJ string does not exist.

**proj:geometry** - A Polygon object representing the footprint of this item, formatted according the Polygon object format specified in [RFC 7946, sections 3.1.6](https://tools.ietf.org/html/rfc7946), except not necessarily in EPSG:4326 as required by RFC7946. Specified based on the `proj:crs` field (not necessarily EPSG:4326). Ideally, this will be represented by a Polygon with five coordinates, as the item in the native CRS should be a square aligned to the CRS grid. It is recommended that either or both of `proj:geometry` and `proj:extent` be defined.

**proj:extent** - Bounding box of the asset represented by this item in the native CRS. Specified as four coordinates based on the CRS defined in the `proj:epsg` and `proj:crs` fields. First two numbers are coordinates of the lower left corner, followed by coordinates of upper right corner, e.g., \[west, south, east, north]. It is recommended that either or both of `proj:geometry` and `proj:extent` be defined.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does saying

e.g., [west, south, east, north]

imply a certain class of CRSs? Perhaps "[xmin, ymin, xmax, ymax]" instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the issue with min/max terminology is that for antimeridian-crossing boxes, that xmin is actually greater than xmax, which doesn't have the same implication with west/east

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about a CRS (e.g. EPSG:22182) where positive X is "northing"? I'd worry about mistakes being made if coordinates have to be flipped in the expression of extent.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this align with the bbox definition in the item spec? In the spec its defined as [lower_left_corner, upper_right_corner]. From my experience, [xmin,ymin,xmax,ymax] is a modification of the traditional bounding box expression with corner coordinates. It is more intuitive and almost always correct (with the exception of antimeridian crossings as Phil mentions) but is less clear than the corner expression in my opinion.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should strictly follow the Item and Collection spec, which are following the GeoJSON and WFS3 spec. I think we should not diverge from that.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with following the GeoJSON spec (I don't know about WFS3) is that the CRS is assumed to be 4326, so north is positive Y, east is positive X, etc.

A GeoJSON object MAY have a member named "bbox" to include information on the coordinate range for its Geometries, Features, or FeatureCollections. The value of the bbox member MUST be an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. The "bbox" values define shapes with edges that follow lines of constant longitude, latitude, and elevation.

At least that's how I'm interpreting the above.... so feel free to correct me.

No such assumption can be made of arbitrary CRSs. You'd have to project back into 4326 (or similar) to fully comply with the spec, completely negating the purpose of this extension spec.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @geospatial-jeff meant that the extension fields should at least match in name to the GeoJSON terms. In other words, bbox is used at the GeoJSON feature level to describe the bbox, so if the proj extension provides the bounding box in a different CRS it should follow the same naming convention.
It also avoids confusion with the "extent" field which is used at the collection level and has a quite different meaning (the bbox of the convex hull containing all member Items).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have named this bbox instead of extent if that's used in collection. I'm also okay leaving this out if it's too ill-defined outside of 4326.


**proj:centroid** - Coordinates representing the centroid of the item in the native coordinate system. Coordinates defined as \[lat,lon], even if the native coordinate system does not use lat/long.

## Examples
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please make this a complete example and add it to the examples folder so that it can be used for validation etc?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if centroid should live next to the top level bbox? Projections seems very specific, and centroid seems more like a quick lookup in a standardized way if you are specifying that is has to be lat long (WGS84 I assume as well?)


```
{
"id": "LC81530252014153LGN00",
"type": "Feature",
...
"properties": {
"proj:epsg": 32614,
"proj:crs": "+proj=utm +zone=14 +datum=WGS84 +units=m +no_defs ",
"proj:geometry": {
"coordinates": [
[
[
169200.0,
3712800.0
],
[
403200.0,
3712800.0
],
[
403200.0,
3951000.0
],
[
169200.0,
3951000.0
],
[
169200.0,
3712800.0
]
]
],
"type": "Polygon"
},
"proj:extent": [ 169200.0, 3712800.0, 403200.0, 3951000.0 ],
"proj:centroid": [ 34.595302781575604, -101.34448382627504 ]
},
"assets" :{
"B1": {
"href": "http://example.com/L8/153/025/LC81530252014153LGN00/LC81530252014153LGN00_B1.TIF",
"type": "image/vnd.stac.geotiff",
"eo:bands": [0]
},
"thumbnail": {
"href": "http://example.com/L8/153/025/LC81530252014153LGN00/LC81530252014153LGN00_thumbnail.jpg",
"type": "image/jpeg",
"proj:crs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs ",
"proj:epsg": 3857,
"proj:geometry": {
"coordinates": [
[
[
169200.0,
3712800.0
],
[
403200.0,
3712800.0
],
[
403200.0,
3951000.0
],
[
169200.0,
3951000.0
],
[
169200.0,
3712800.0
]
]
],
"type": "Polygon"
},
"proj:extent": [ 169200.0, 3712800.0 403200.0, 3951000.0 ],
"proj:centroid": [ 34.595302781575604, -101.34448382627504 ],
},
...
}
}
```
48 changes: 48 additions & 0 deletions extensions/projection/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"title": "Projection Extension",
"type": "object",
"description": "STAC Projection Extension",
"additionalProperties": true,
"properties": {
"properties": {
"type": "object",
"required": [
"proj:epsg"
],
"properties": {
"proj:epsg": {
"title": "EPSG code",
"type": "integer"
},
"proj:crs": {
"title": "Coordinate Reference System in PROJ format",
"type": "string"
},
"proj:geometry": {
"title": "Geometry",
"type": "object"
},
"proj:extent": {
"title": "Extent",
"type": "array",
"minItems": 4,
"maxItems": 6,
"items": {
"type": "number"
}
},
"proj:centroid": {
"title": "Centroid",
"type": "array",
"minItems": 2,
"maxItems": 3,
"items": {
"type": "number"
}
}
}
}
}
}