opengeospatial/ogcapi-features

Schemas: oneOf null/single/multi geometry ?

jerstlouis opened this issue · 4 comments

I am updating our schemas to match the latest Schemas draft and wondering about whether / how to declare the possibility that a geometry might be null?

Requirement 2 A says:

Each property SHALL include a "type" member, except for spatial properties.

So I am wondering if it should be like this:

"rec.geom" : {
   "oneOf" : [
      { "type" : "null" },
      { "format" : "geometry-linestring" },
      { "format" : "geometry-multilinestring" }
   ],
   "x-ogc-role" : "primary-geometry"
}

Or if that "type" inside the "oneOf" is disallowed by that requirement?

Or if null is implicitly understood as a possible value for the primary geometry, unless "rec.geom" would be in "required"?

Thanks!

cc @cportele @pvretano

@jerstlouis

Yes, null is implicitly understood as a possible value for the primary geometry, unless "rec.geom" would be in "required". If "null" or a missing value is used will depend on the format.

However, currently "oneOf" is not allowed to keep it simple. If 2 or more geometry types are allowed, you would use "geometry-any".

"rec.geom" : {
    "format" : "geometry-any",
   "x-ogc-role" : "primary-geometry"
}

Thanks @cportele

However, currently "oneOf" is not allowed to keep it simple. If 2 or more geometry types are allowed, you would use "geometry-any".

This is very problematic for us, in terms of commonly having collections supporting the single vs. multi geometry types (which we treat exactly the same in our data stores).

Meeting 2023-11-20: We will discuss this in the next meeting. One option could be to add a keyword with the geometry dimension as in JSON-FG or to provide additional values for frequently used combinations.

Meeting 2023-12-18: Add "geometry-point-or-multipoint", "geometry-linestring-or-multilinestring", "geometry-polygon-or-multipolygon" for these cases.