-
Notifications
You must be signed in to change notification settings - Fork 7
Add geometry conformance #6
Changes from 8 commits
f6650f4
37878c7
8641950
021ef37
3dd7f17
7e4f849
c6e14e2
f687062
27cef90
9098401
0c3790a
8d324bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ http://cfconventions.org/cf-conventions/cf-conventions.html[CF Conventions docum | |
If there are any discrepencies between the two, the | ||
conventions document is the ultimate authority. | ||
|
||
* This document will updated as required to correct mistakes or add new | ||
* This document will be updated as required to correct mistakes or add new | ||
material required for completeness or clarity. | ||
|
||
|
||
|
@@ -239,7 +239,7 @@ required to express the value. | |
|
||
*Requirements:* | ||
|
||
* The **`axis`** attribute may only be attached to a coordinate variable. | ||
* The **`axis`** attribute may only be attached to coordinate variables and geometry node coordinate variables (Chapter 7). | ||
* The only legal values of axis are **`X`**, **`Y`**, **`Z`**, and **`T`** (case insensitive). | ||
* The **`axis`** attribute must be consistent with the coordinate type deduced | ||
from **`units`** and **`positive`**. | ||
|
@@ -539,6 +539,51 @@ attributes, they must agree with those of its associated variable. | |
* A climatology variable must not have **`_FillValue`** or **`missing_value`** | ||
attributes. | ||
|
||
[[geometries]] | ||
=== 7.5 Geometries | ||
|
||
*Requirements:* | ||
|
||
* One of the dimensions of the data variable with geometry must be the number of | ||
geometries to which the data applies. | ||
* The type of the **`geometry`** attribute is a string whose value is the name of | ||
a geometry container variable. The variable name must exist in the file. | ||
* The geometry container variable must hold **`geometry_type`** and | ||
**`node_coordinates`** attributes. | ||
* The only legal values of geometry_type are **`point`**, **`line`**, | ||
and **`polygon`** (case insensitive). | ||
* For a line **`geometry_type`**, each geometry must have a minimum of two node coordinates. | ||
* For a polygon **`geometry_type`**, each geometry must have a minimum of three node coordinates. | ||
* The type of the **`node_coordinates`** attribute is a string whose value is a | ||
blank separated list of variable names. All specified variable names | ||
must exist in the file. | ||
* The geometry node coordinate variables must each have an **`axis`** attribute. | ||
* A geometry container variable must not have more than one node coordinate variable with a | ||
particular value of the **`axis`** attribute. | ||
* The **`grid_mapping`** and **`coordinates`** attributes can be carried by the | ||
geometry container variable provided they are also carried by the data variables | ||
associated with the container. | ||
* If a **`coordinates`** attribute is carried by the geometry container variable or its parent data | ||
variable, then those coordinate variables which correspond to node coordinate variables must have a | ||
**`bounds`** attribute that names the corresponding node coordinate. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following the conclusion of the "nodes" discussion, this check needs updating. How about:
|
||
* The geometry node coordinate variables must all have the same single dimension, | ||
which is the total number of nodes in all the geometries. | ||
* Nodes for polygon exterior rings must be put in anticlockwise order (viewed from above) | ||
and polygon interior rings in clockwise order. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The above two rules concerning the order of nodes are not checkable, so shouldn't they be omitted from the conformance requirements? These points are already made in chapter 7. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That one is uncheckable. I agree with omitting it.
This one can be checked. Here's a checker in Python. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's good for me. Thanks for the link to your geometry code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the uncheckable rule. You can find the latest version here: |
||
* The single dimension of the part node count variable should equal the total number | ||
of parts in all the geometries. | ||
* When more than one geometry instance is present and the **`node_count`** attribute on the geometry | ||
container is missing, the geometry type must be **`point`** and the node coordinate dimension size | ||
must be the same as the number of geometry instances. | ||
* If a **`part_node_count`** variable and a **`node_count`** variable are present for a given geometry | ||
container, then the sum of **`part_node_count`** values must equal the sum of **`node_count`** values. | ||
* If the **`interior_ring`** attribute is present on the geometry container, then the **`part_node_count`** | ||
attribute must also be present on the geometry container. | ||
* The interior ring variable must contain the value 0 to indicate an exterior ring | ||
polygon and 1 to indicate an interior ring polygon. | ||
* The single dimension of the interior ring variable must be the same dimension as | ||
that of the part node count variable. | ||
|
||
[[section-20]] | ||
|
||
[[packed-data]] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't "three" be "two", in which case, we could merge two rules into one:
geometry_type
, each geometry must have a minimum of two node coordinates.E.g. In Example 7.16. (Polygons with holes), we have only two node coordinates. (https://github.com/twhiteaker/cf-conventions/blob/master/ch07.adoc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referring to the size of the node dimension, not the number of node coordinate variables. Is this rule clearer?
geometry_type
, each geometry must have a minimum of two nodes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - I see - my mistake! I think the original text is fine. I had confused "node coordinates" with "node coordinate variables". it is clear in chapter 7, so I think that it is OK here, too.