oceanum.datamesh.Query — oceanum 0.1.0 documentation

# oceanum.datamesh.Query

pydantic model oceanum.datamesh.Query

  Datamesh query

  Show JSON schema

      {
         "title": "Query",
         "description": "Datamesh query",
         "type": "object",
         "properties": {
            "datasource": {
               "title": "The id of the datasource",
               "description": "Datasource ID",
               "type": "string"
            },
            "parameters": {
               "title": "Datasource parameters",
               "description": "Dictionary of driver parameters to pass to datasource",
               "default": {},
               "type": "object"
            },
            "description": {
               "title": "Optional description of this query",
               "description": "Human readable description of this query",
               "type": "string"
            },
            "variables": {
               "title": "List of selected variables",
               "description": "List of requested variables.",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "timefilter": {
               "title": "Time filter",
               "description": "Temporal filter or interplator",
               "allOf": [
                  {
                     "$ref": "#/definitions/TimeFilter"
                  }
               ]
            },
            "geofilter": {
               "title": "Spatial filter or interpolator",
               "allOf": [
                  {
                     "$ref": "#/definitions/GeoFilter"
                  }
               ]
            },
            "crs": {
               "title": "Spatial reference for filter and output",
               "description": "Valid CRS string for returned data",
               "default": "EPSG:4326",
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "integer"
                  }
               ]
            }
         },
         "required": [
            "datasource"
         ],
         "definitions": {
            "TimeFilterType": {
               "title": "TimeFilterType",
               "description": "An enumeration.",
               "enum": [
                  "range"
               ],
               "type": "string"
            },
            "ResampleType": {
               "title": "ResampleType",
               "description": "An enumeration.",
               "enum": [
                  "mean"
               ],
               "type": "string"
            },
            "TimeFilter": {
               "title": "TimeFilter",
               "description": "TimeFilter class\nDescribes a temporal subset or interpolation",
               "type": "object",
               "properties": {
                  "type": {
                     "title": "Timefilter type",
                     "description": "\n        Type of the timefilter. Can be one of:\n            - 'range': Select times within a range\n        ",
                     "default": "range",
                     "allOf": [
                        {
                           "$ref": "#/definitions/TimeFilterType"
                        }
                     ]
                  },
                  "times": {
                     "title": "Selection times",
                     "description": "\n            - For type='range', [timestart, tend].\n        ",
                     "type": "array",
                     "items": {
                        "type": "string",
                        "format": "date-time"
                     }
                  },
                  "resolution": {
                     "title": "Temporal resolution of data",
                     "description": "Maximum resolution of the data for temporal downsampling. Only valid with range type",
                     "default": "native",
                     "type": "string"
                  },
                  "resample": {
                     "title": "Temporal resampling method",
                     "description": "Resampling method applied when reducing tempral resolution. Only valid with range type",
                     "default": "mean",
                     "allOf": [
                        {
                           "$ref": "#/definitions/ResampleType"
                        }
                     ]
                  }
               },
               "required": [
                  "times"
               ]
            },
            "GeoFilterType": {
               "title": "GeoFilterType",
               "description": "An enumeration.",
               "enum": [
                  "feature",
                  "radius",
                  "bbox"
               ]
            },
            "Point": {
               "title": "Point",
               "description": "Point Model",
               "type": "object",
               "properties": {
                  "coordinates": {
                     "title": "Coordinates",
                     "anyOf": [
                        {
                           "type": "array",
                           "minItems": 2,
                           "maxItems": 2,
                           "items": [
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              }
                           ]
                        },
                        {
                           "type": "array",
                           "minItems": 3,
                           "maxItems": 3,
                           "items": [
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              }
                           ]
                        }
                     ]
                  },
                  "type": {
                     "title": "Type",
                     "const": "Point",
                     "type": "string"
                  }
               },
               "required": [
                  "coordinates"
               ]
            },
            "MultiPoint": {
               "title": "MultiPoint",
               "description": "MultiPoint Model",
               "type": "object",
               "properties": {
                  "coordinates": {
                     "title": "Coordinates",
                     "type": "array",
                     "items": {
                        "anyOf": [
                           {
                              "type": "array",
                              "minItems": 2,
                              "maxItems": 2,
                              "items": [
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 },
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 }
                              ]
                           },
                           {
                              "type": "array",
                              "minItems": 3,
                              "maxItems": 3,
                              "items": [
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 },
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 },
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 }
                              ]
                           }
                        ]
                     }
                  },
                  "type": {
                     "title": "Type",
                     "const": "MultiPoint",
                     "type": "string"
                  }
               },
               "required": [
                  "coordinates"
               ]
            },
            "LineString": {
               "title": "LineString",
               "description": "LineString Model",
               "type": "object",
               "properties": {
                  "coordinates": {
                     "title": "Coordinates",
                     "minItems": 2,
                     "type": "array",
                     "items": {
                        "anyOf": [
                           {
                              "type": "array",
                              "minItems": 2,
                              "maxItems": 2,
                              "items": [
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 },
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 }
                              ]
                           },
                           {
                              "type": "array",
                              "minItems": 3,
                              "maxItems": 3,
                              "items": [
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 },
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 },
                                 {
                                    "anyOf": [
                                       {
                                          "type": "number"
                                       },
                                       {
                                          "type": "integer"
                                       }
                                    ]
                                 }
                              ]
                           }
                        ]
                     }
                  },
                  "type": {
                     "title": "Type",
                     "const": "LineString",
                     "type": "string"
                  }
               },
               "required": [
                  "coordinates"
               ]
            },
            "MultiLineString": {
               "title": "MultiLineString",
               "description": "MultiLineString Model",
               "type": "object",
               "properties": {
                  "coordinates": {
                     "title": "Coordinates",
                     "type": "array",
                     "items": {
                        "type": "array",
                        "items": {
                           "anyOf": [
                              {
                                 "type": "array",
                                 "minItems": 2,
                                 "maxItems": 2,
                                 "items": [
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    },
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    }
                                 ]
                              },
                              {
                                 "type": "array",
                                 "minItems": 3,
                                 "maxItems": 3,
                                 "items": [
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    },
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    },
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    }
                                 ]
                              }
                           ]
                        }
                     }
                  },
                  "type": {
                     "title": "Type",
                     "const": "MultiLineString",
                     "type": "string"
                  }
               },
               "required": [
                  "coordinates"
               ]
            },
            "Polygon": {
               "title": "Polygon",
               "description": "Polygon Model",
               "type": "object",
               "properties": {
                  "coordinates": {
                     "title": "Coordinates",
                     "type": "array",
                     "items": {
                        "type": "array",
                        "items": {
                           "anyOf": [
                              {
                                 "type": "array",
                                 "minItems": 2,
                                 "maxItems": 2,
                                 "items": [
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    },
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    }
                                 ]
                              },
                              {
                                 "type": "array",
                                 "minItems": 3,
                                 "maxItems": 3,
                                 "items": [
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    },
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    },
                                    {
                                       "anyOf": [
                                          {
                                             "type": "number"
                                          },
                                          {
                                             "type": "integer"
                                          }
                                       ]
                                    }
                                 ]
                              }
                           ]
                        }
                     }
                  },
                  "type": {
                     "title": "Type",
                     "const": "Polygon",
                     "type": "string"
                  }
               },
               "required": [
                  "coordinates"
               ]
            },
            "MultiPolygon": {
               "title": "MultiPolygon",
               "description": "MultiPolygon Model",
               "type": "object",
               "properties": {
                  "coordinates": {
                     "title": "Coordinates",
                     "type": "array",
                     "items": {
                        "type": "array",
                        "items": {
                           "type": "array",
                           "items": {
                              "anyOf": [
                                 {
                                    "type": "array",
                                    "minItems": 2,
                                    "maxItems": 2,
                                    "items": [
                                       {
                                          "anyOf": [
                                             {
                                                "type": "number"
                                             },
                                             {
                                                "type": "integer"
                                             }
                                          ]
                                       },
                                       {
                                          "anyOf": [
                                             {
                                                "type": "number"
                                             },
                                             {
                                                "type": "integer"
                                             }
                                          ]
                                       }
                                    ]
                                 },
                                 {
                                    "type": "array",
                                    "minItems": 3,
                                    "maxItems": 3,
                                    "items": [
                                       {
                                          "anyOf": [
                                             {
                                                "type": "number"
                                             },
                                             {
                                                "type": "integer"
                                             }
                                          ]
                                       },
                                       {
                                          "anyOf": [
                                             {
                                                "type": "number"
                                             },
                                             {
                                                "type": "integer"
                                             }
                                          ]
                                       },
                                       {
                                          "anyOf": [
                                             {
                                                "type": "number"
                                             },
                                             {
                                                "type": "integer"
                                             }
                                          ]
                                       }
                                    ]
                                 }
                              ]
                           }
                        }
                     }
                  },
                  "type": {
                     "title": "Type",
                     "const": "MultiPolygon",
                     "type": "string"
                  }
               },
               "required": [
                  "coordinates"
               ]
            },
            "Feature": {
               "title": "Feature",
               "description": "Feature Model",
               "type": "object",
               "properties": {
                  "type": {
                     "title": "Type",
                     "const": "Feature",
                     "type": "string"
                  },
                  "geometry": {
                     "title": "Geometry",
                     "anyOf": [
                        {
                           "$ref": "#/definitions/Point"
                        },
                        {
                           "$ref": "#/definitions/MultiPoint"
                        },
                        {
                           "$ref": "#/definitions/LineString"
                        },
                        {
                           "$ref": "#/definitions/MultiLineString"
                        },
                        {
                           "$ref": "#/definitions/Polygon"
                        },
                        {
                           "$ref": "#/definitions/MultiPolygon"
                        }
                     ]
                  },
                  "properties": {
                     "title": "Properties",
                     "type": "object"
                  },
                  "id": {
                     "title": "Id",
                     "type": "string"
                  },
                  "bbox": {
                     "title": "Bbox",
                     "anyOf": [
                        {
                           "type": "array",
                           "minItems": 4,
                           "maxItems": 4,
                           "items": [
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              }
                           ]
                        },
                        {
                           "type": "array",
                           "minItems": 6,
                           "maxItems": 6,
                           "items": [
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              },
                              {
                                 "anyOf": [
                                    {
                                       "type": "number"
                                    },
                                    {
                                       "type": "integer"
                                    }
                                 ]
                              }
                           ]
                        }
                     ]
                  }
               },
               "required": [
                  "geometry"
               ]
            },
            "GeoFilter": {
               "title": "GeoFilter",
               "description": "GeoFilter class\nDescribes a spatial subset or interpolation",
               "type": "object",
               "properties": {
                  "type": {
                     "title": "Geofilter type",
                     "description": "\n        Type of the geofilter. Can be one of:\n            - 'feature': Select with a geojson feature\n            - 'bbox': Select with a bounding box\n            - 'radius': Select within radius of point\n        ",
                     "default": "bbox",
                     "allOf": [
                        {
                           "$ref": "#/definitions/GeoFilterType"
                        }
                     ]
                  },
                  "geom": {
                     "title": "Selection geometry",
                     "description": "\n            - For type='feature', geojson feature.\n            - For type='bbox', list[x_min,y_min,x_max,y_max] in CRS units.\n            - For type='radius', list[x0,y0,radius] in CRS units.\n        ",
                     "anyOf": [
                        {
                           "type": "array",
                           "items": {}
                        },
                        {
                           "$ref": "#/definitions/Feature"
                        }
                     ]
                  },
                  "resolution": {
                     "title": "Maximum spatial resolution of data",
                     "description": "Maximum resolution of the data for downsampling in CRS units",
                     "default": 0.0,
                     "type": "number"
                  }
               },
               "required": [
                  "geom"
               ]
            }
         }
      }

  Config

    - json_dumps: function = <function _orjson_dumps at 0x7f2e7574e3a0>

    - json_encoders: dict = {<class ‘numpy.datetime64’>: <class ‘str’>}

    - json_loads: builtin_function_or_method = <built-in function loads>

  Fields

    - `crs (Optional[Union[str, int]])`

    - `datasource (str)`

    - `description (Optional[str])`

    - `geofilter (Optional[oceanum.datamesh.query.GeoFilter])`

    - `parameters (Optional[Dict])`

    - `timefilter (Optional[oceanum.datamesh.query.TimeFilter])`

    - `variables (Optional[List[str]])`

  field crs: Optional[Union[str, int]] = 'EPSG:4326'

    Valid CRS string for returned data

  field datasource: str [Required]

    Datasource ID

  field description: Optional[str] = None

    Human readable description of this query

  field geofilter: Optional[oceanum.datamesh.query.GeoFilter] = None
  field parameters: Optional[Dict] = {}

    Dictionary of driver parameters to pass to datasource

  field timefilter: Optional[oceanum.datamesh.query.TimeFilter] = None

    Temporal filter or interplator

  field variables: Optional[List[str]] = None

    List of requested variables.

previous

oceanum.datamesh.Catalog

next

About