Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Add geometry conformance #6

Merged
merged 12 commits into from
Jul 17, 2019
Merged

Conversation

twhiteaker
Copy link
Contributor

Add conformance rules for geometries. See trac ticket 164 and CF conventions pull request 115 for geometries discussion.

…mendation of first-last node equivalence for polygons
* Geometry_Conformance:
  require axis on coordinate vars
  Remove case sensitive requirement for geometry type, and remove recommendation of first-last node equivalence for polygons
  Clarify that *nodes* for polygon rings must be in a certain order.
  add geomery requirements
@@ -552,6 +552,8 @@ a geometry container variable. The variable name must exist in the file.
**`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.

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:

  • For a line or polygon 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)

Copy link
Contributor Author

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?

  • For a line geometry_type, each geometry must have a minimum of two nodes.

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.

the **`axis`** attribute.
* 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.
* The geometry node coordinate variables must all have the same single dimension,
which is the total number of nodes in all the geometries.
* The nodes must be stored consecutively for each geometry and in the order of the
geometries, and within each multipart geometry the nodes must be stored
consecutively for each part and in the order of the parts.
* Nodes for polygon exterior rings must be put in anticlockwise order (viewed from above)
and polygon interior rings in clockwise order.

Choose a reason for hiding this comment

The 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. ​

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • The nodes must be stored consecutively for each geometry...

That one is uncheckable. I agree with omitting it.

  • Nodes for polygon exterior rings must be put in anticlockwise order...

This one can be checked. Here's a checker in Python.

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the uncheckable rule. You can find the latest version here:
https://github.com/cf-convention/Conformance/pull/6/files

conformance.adoc Outdated
@@ -568,9 +568,6 @@ variable, then those coordinate variables which correspond to node coordinate va
**`bounds`** attribute that names the corresponding node coordinate.

Choose a reason for hiding this comment

The 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:

  • If a coordinate variable named by a coordinates attribute carried by the geometry container variable or its parent data variable has a nodes attribute, then the nodes attribute must be a string whose value is a single variable name. The specified variable must be a node coordinate variable that exists in the file.

When node_count attribute is missing, require the dimension of the node coordinate variables to be one of the dimensions of the data variable.
@dblodgett-usgs
Copy link
Contributor

Given that cf-convention/cf-conventions#158 has been merged. I'm going to go ahead and merge this too.

@dblodgett-usgs dblodgett-usgs merged commit 7778af1 into cf-convention:master Jul 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants