Skip to content

Clarification on MultiPolygon, MultiPolygonSeries, and possibly MultiPoint Coverages #202

Closed

Description

@murithigeo

According to the Covjson Playground, each polygon in a MultiPolygon has a different associated value in linked ranges. For instance, in the first Polygon value, the temperature value is different from the subsequent polygon value.

Wouldn't it make sense that geographic features represented by a MultiPolygon have the same associated value?

Activity

  1. jonblower commented on Jul 21, 2025

    @jonblower
    Contributor

    This is a good point, and I think you have found an inconsistency. The Polygon domain type is defined as having a single polygon to define its domain, but there are two possible meanings of "MultiPolygon":

    1. A single domain element that is made up of multiple discontiguous polygons (like the land area of the USA)
    2. A domain that contains a number of polygons, each of which has its own range value.

    The CovJSON spec is not completely clear, but implies that the second one is correct (because the length of the range in the example is the same as the length of the z axis, implying that the polygons are considered part of the same domain element).

    But, as you say, the Playground treats the polygons as different domain elements in the MultiPolygon example.

    Assuming that the spec is the source of truth, this means:

    1. The playground example should be corrected, and
    2. We probably need a way to accommodate the second use case above

    @murithigeo does the above make sense to you?

  2. murithigeo commented on Jul 22, 2025

    @murithigeo
    Author

    I understand the implication. Given the spec also uses the first meaning, then I think it would make sense to use the first meaning until the alternate case is accomodated

  3. jonblower commented on Jul 22, 2025

    @jonblower
    Contributor

    Yes, I agree. The second use case could be accommodated through a CoverageCollection (like the example of the Point Collection in the Playground).

    As the title of this issue suggests, I think we may also have an issue with the MultiPoint domain type. We probably need to check what the schema and validator tools do too.

    I'm labelling this for the next bugfix release

  4. chris-little commented on Dec 3, 2025

    @chris-little
    Contributor

    @jonblower @murithigeo I am happy with the above analysis. Are there any volunteers for fixing:

    1. CovJSON playground
    2. Disambiguating the OGC Spec
    3. Clarify and fixing the schemas and tests?
  5. chris-little commented on Jan 28, 2026

    @chris-little
    Contributor

    We need to cross check the semantics of using MultiPolygon etc in API-EDR and perhaps also API-Coverages or CIS.

  6. murithigeo commented on Jan 29, 2026

    @murithigeo
    Author

    If I remember correctly, doesn't OGC API-EDR use the current official schemas instead of their own? This may make the semantics easier to change

  7. murithigeo commented on Mar 2, 2026

    @murithigeo
    Author

    Having gone through the JSON Schema and realizing that the shape is derived directly from length of axis, it would make sense to maintain the schema as is for compatibility issues. An attempt to be backward compatible could mean duplication of values

  8. chris-little commented on Mar 25, 2026

    @chris-little
    Contributor

    @murithigeo @jonblower Having read the spec, and the CovJson playground, I am not sure what we have agreed.
    In my mind, a MultiPolygon is more fundamental thing than a Polygon. Operate on a Polygon, such as by clipping, and you may end up with a MultiPolygon. Operate on a MultiPolygon, such as by clipping, and you end up with a MultiPolygon, or even a Polygon, which is a special case of MultiPolygon. So I prefer that a MultiPolygon is a spatially discontinuous representation of an single underlying entity, rather than a short-hand way of representing several different unconnected Polygons.
    Do you agree with my interpretation?

  9. murithigeo commented on Mar 25, 2026

    @murithigeo
    Author

    Yes, that makes sense.

    I think this issue can be closed

  10. chris-little commented on Mar 25, 2026

    @chris-little
    Contributor

    @murithigeo Agreed, but we need some more examples to clarify the distinctions.

  11. awarde96 commented on Mar 26, 2026

    @awarde96
    Collaborator

    Hey @chris-little , I tried to do a few examples based on what we discussed in the community group meeting.

    Example 1: Two discrete polygons in a multiPolygon where each is assigned a value in the range so 2 values appear in the range.

    {
      "type": "Coverage",
      "domain": {
        "type": "Domain",
        "domainType": "MultiPolygon",
        "axes": {
          "composite": {
            "dataType": "polygon",
            "coordinates": ["x", "y"],
            "values": [
              [
                [
                  [30, 20],
                  [45, 40],
                  [10, 40],
                  [30, 20]
                ]
              ],
              [
                [
                  [15, 5],
                  [40, 10],
                  [10, 20],
                  [5, 10],
                  [15, 5]
                ]
              ]
            ]
          },
          "z": {
            "values": [2]
          },
          "t": {
            "values": ["2008-01-01T04:00:00Z"]
          }
        },
        "referencing": [...]
      },
      "parameters": {
      },
      "ranges": {
        "temperature": {
          "type": "NdArray",
          "dataType": "float",
          "axisNames": ["composite"],
          "shape": [2],
          "values": [23.1, 24.7]
        }
      }
    }
    

    Example 2: Two discrete polygons in a multiPolygon however one of the discrete polygons contains a hole represented by two polygons, where each is assigned a value in the range so 2 values appear in the range.

    {
      "type": "Coverage",
      "domain": {
        "type": "Domain",
        "domainType": "MultiPolygon",
        "axes": {
          "composite": {
            "dataType": "polygon",
            "coordinates": ["x", "y"],
            "values": [
              [
                [
                  [40, 40],
                  [20, 45],
                  [45, 30],
                  [40, 40]
                ]
              ],
              [
                [
                  [20, 35],
                  [10, 30],
                  [10, 10],
                  [30, 5],
                  [45, 20],
                  [20, 35]
                ],
                [
                  [30, 20],
                  [20, 15],
                  [20, 25],
                  [30, 20]
                ]
              ]
            ]
          },
          "z": {
            "values": [2]
          },
          "t": {
            "values": ["2008-01-01T04:00:00Z"]
          }
        },
        "referencing": [...]
      },
      "parameters": {
      },
      "ranges": {
        "temperature": {
          "type": "NdArray",
          "dataType": "float",
          "axisNames": ["composite"],
          "shape": [2],
          "values": [23.1, 24.7]
        }
      }
    }
    

    Example 3: One discrete polygon which contains multiple polygons to denote a polygon with a hole, so only a single value is assigned in the range. Although this example could arguably just be a polygon rather than a multiPolygon.

    {
      "type": "Coverage",
      "domain": {
        "type": "Domain",
        "domainType": "MultiPolygon",
        "axes": {
          "composite": {
            "dataType": "polygon",
            "coordinates": ["x", "y"],
            "values": [
              [
                [
                  [20, 35],
                  [10, 30],
                  [10, 10],
                  [30, 5],
                  [45, 20],
                  [20, 35]
                ],
                [
                  [30, 20],
                  [20, 15],
                  [20, 25],
                  [30, 20]
                ]
              ]
            ]
          },
          "z": {
            "values": [2]
          },
          "t": {
            "values": ["2008-01-01T04:00:00Z"]
          }
        },
        "referencing": [...]
      },
      "parameters": {
      },
      "ranges": {
        "temperature": {
          "type": "NdArray",
          "dataType": "float",
          "axisNames": ["composite"],
          "shape": [1],
          "values": [23.1]
        }
      }
    }
    

    These are based on the examples found here https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry under multiPolygon for a visual aid.

    Do these make sense and clarify things?

  12. chris-little commented on Apr 2, 2026

    @chris-little
    Contributor

    @awarde96 Have a look at PR#214.

  13. chris-little commented on May 12, 2026

    @chris-little
    Contributor

    The extra examples have now been added with PR #214, with the agreed semantic that a MultiPolygon is used to indicate a discontinuous domain of one value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions