Skip to content
OATSCHEMA

Docs / Schemas / geolocation

Geolocation 0.8.0

Represent a geographic feature. Defines a subset of GeoJSON (RFC 7946) optimized for predictable parsing and indexing. It restricts the root to a single 'Feature', supports all fixed-depth geometries (Point, Polygon, Multi-types), and enforces flat properties to prevent recursion and nesting attacks.

$id
https://oatschema.org/0.8.0/geolocation
Latest
https://oatschema.org/geolocation
Versions
Source
v0.8.0 on GitHub

Schema

geolocation.json Raw
{    "x-license": {        "id": "Apache-2.0",        "notice": "Copyright 2025-2026 The OATS Authors",        "url": "https://github.com/oatschema/oats/blob/main/LICENSE"    },    "$schema": "https://json-schema.org/draft/2020-12/schema",    "$id": "https://oatschema.org/0.8.0/geolocation",    "title": "Geolocation",    "x-version": "0.8.0",    "description": "Represent a geographic feature. Defines a subset of GeoJSON (RFC 7946) optimized for predictable parsing and indexing. It restricts the root to a single 'Feature', supports all fixed-depth geometries (Point, Polygon, Multi-types), and enforces flat properties to prevent recursion and nesting attacks.",    "type": "object",    "properties": {        "type": {            "description": "The GeoJSON object type.",            "const": "Feature"        },        "id": {            "description": "A unique identifier for the feature.",            "anyOf": [                {                    "type": "string",                    "maxLength": 128                },                {                    "type": "number"                }            ]        },        "producer": {            "type": "string",            "description": "The creator (model, tool or author) of this record.",            "maxLength": 1024        },        "bbox": {            "$ref": "#/$defs/bbox"        },        "geometry": {            "description": "The geometry of the feature. Uses the WGS 84 coordinate reference system.",            "anyOf": [                {                    "type": "null"                },                {                    "title": "Point",                    "type": "object",                    "properties": {                        "type": {                            "const": "Point"                        },                        "coordinates": {                            "$ref": "#/$defs/position"                        },                        "bbox": {                            "$ref": "#/$defs/bbox"                        }                    },                    "required": [                        "type",                        "coordinates"                    ],                    "maxProperties": 16,                    "propertyNames": {                        "maxLength": 128                    },                    "additionalProperties": {                        "$ref": "#/$defs/foreign-member"                    }                },                {                    "title": "LineString",                    "type": "object",                    "properties": {                        "type": {                            "const": "LineString"                        },                        "coordinates": {                            "$ref": "#/$defs/line-string-coords"                        },                        "bbox": {                            "$ref": "#/$defs/bbox"                        }                    },                    "required": [                        "type",                        "coordinates"                    ],                    "maxProperties": 16,                    "propertyNames": {                        "maxLength": 128                    },                    "additionalProperties": {                        "$ref": "#/$defs/foreign-member"                    }                },                {                    "title": "Polygon",                    "type": "object",                    "properties": {                        "type": {                            "const": "Polygon"                        },                        "coordinates": {                            "$ref": "#/$defs/polygon-coords"                        },                        "bbox": {                            "$ref": "#/$defs/bbox"                        }                    },                    "required": [                        "type",                        "coordinates"                    ],                    "maxProperties": 16,                    "propertyNames": {                        "maxLength": 128                    },                    "additionalProperties": {                        "$ref": "#/$defs/foreign-member"                    }                },                {                    "title": "MultiPoint",                    "type": "object",                    "properties": {                        "type": {                            "const": "MultiPoint"                        },                        "coordinates": {                            "type": "array",                            "description": "A list of positions.",                            "items": {                                "$ref": "#/$defs/position"                            },                            "maxItems": 10000                        },                        "bbox": {                            "$ref": "#/$defs/bbox"                        }                    },                    "required": [                        "type",                        "coordinates"                    ],                    "maxProperties": 16,                    "propertyNames": {                        "maxLength": 128                    },                    "additionalProperties": {                        "$ref": "#/$defs/foreign-member"                    }                },                {                    "title": "MultiLineString",                    "type": "object",                    "properties": {                        "type": {                            "const": "MultiLineString"                        },                        "coordinates": {                            "type": "array",                            "description": "A list of line strings.",                            "items": {                                "$ref": "#/$defs/line-string-coords"                            },                            "maxItems": 1000                        },                        "bbox": {                            "$ref": "#/$defs/bbox"                        }                    },                    "required": [                        "type",                        "coordinates"                    ],                    "maxProperties": 16,                    "propertyNames": {                        "maxLength": 128                    },                    "additionalProperties": {                        "$ref": "#/$defs/foreign-member"                    }                },                {                    "title": "MultiPolygon",                    "type": "object",                    "properties": {                        "type": {                            "const": "MultiPolygon"                        },                        "coordinates": {                            "type": "array",                            "description": "A list of polygons.",                            "items": {                                "$ref": "#/$defs/polygon-coords"                            },                            "maxItems": 1000                        },                        "bbox": {                            "$ref": "#/$defs/bbox"                        }                    },                    "required": [                        "type",                        "coordinates"                    ],                    "maxProperties": 16,                    "propertyNames": {                        "maxLength": 128                    },                    "additionalProperties": {                        "$ref": "#/$defs/foreign-member"                    }                }            ]        },        "properties": {            "description": "An object containing additional properties of the feature. Can be null.",            "anyOf": [                {                    "type": "null"                },                {                    "type": "object",                    "properties": {                        "timestamp": {                            "type": "string",                            "description": "The time the feature was observed.",                            "format": "date-time",                            "maxLength": 128                        },                        "camera_make": {                            "type": "string",                            "description": "The make of the camera that captured the source media.",                            "maxLength": 128                        },                        "camera_model": {                            "type": "string",                            "description": "The model of the camera that captured the source media.",                            "maxLength": 128                        }                    },                    "maxProperties": 100,                    "propertyNames": {                        "maxLength": 128                    },                    "additionalProperties": {                        "$ref": "#/$defs/foreign-member"                    }                }            ]        }    },    "required": [        "type",        "geometry",        "properties"    ],    "maxProperties": 32,    "propertyNames": {        "maxLength": 128    },    "$defs": {        "position": {            "type": "array",            "description": "A single position: [longitude, latitude] or [longitude, latitude, altitude].",            "prefixItems": [                {                    "type": "number",                    "description": "Longitude in decimal degrees.",                    "minimum": -180,                    "maximum": 180                },                {                    "type": "number",                    "description": "Latitude in decimal degrees.",                    "minimum": -90,                    "maximum": 90                },                {                    "type": "number",                    "description": "Altitude in meters above the WGS 84 ellipsoid."                }            ],            "items": false,            "minItems": 2,            "maxItems": 3        },        "line-string-coords": {            "type": "array",            "description": "An ordered list of two or more positions.",            "items": {                "$ref": "#/$defs/position"            },            "minItems": 2,            "maxItems": 10000        },        "linear-ring": {            "type": "array",            "description": "A closed ring of four or more positions. The first and last positions must be identical.",            "items": {                "$ref": "#/$defs/position"            },            "minItems": 4,            "maxItems": 10000        },        "polygon-coords": {            "type": "array",            "description": "A list of linear rings. The first is the exterior ring; any others are holes.",            "items": {                "$ref": "#/$defs/linear-ring"            },            "minItems": 1,            "maxItems": 100        },        "bbox": {            "type": "array",            "description": "A bounding box (RFC 7946, Section 5): 4 values for 2D or 6 values for 3D.",            "items": {                "type": "number"            },            "anyOf": [                {                    "minItems": 4,                    "maxItems": 4                },                {                    "minItems": 6,                    "maxItems": 6                }            ],            "minItems": 4,            "maxItems": 6        },        "foreign-member": {            "description": "Constrained definition of RFC 7946 Foreign Members.",            "anyOf": [                {                    "type": "string",                    "maxLength": 2048                },                {                    "type": "number"                },                {                    "type": "boolean"                },                {                    "type": "null"                },                {                    "type": "array",                    "maxItems": 100,                    "items": {                        "anyOf": [                            {                                "type": "string",                                "maxLength": 1024                            },                            {                                "type": "number"                            },                            {                                "type": "boolean"                            }                        ]                    }                },                {                    "type": "object",                    "maxProperties": 20,                    "propertyNames": {                        "maxLength": 128                    },                    "additionalProperties": {                        "anyOf": [                            {                                "type": "string",                                "maxLength": 2048                            },                            {                                "type": "number"                            },                            {                                "type": "boolean"                            },                            {                                "type": "null"                            }                        ]                    }                }            ]        }    },    "additionalProperties": {        "$ref": "#/$defs/foreign-member"    }}

Examples

Records that pass validation against this schema.

geolocation-1
geolocation-1.json
{  "type": "Feature",  "geometry": {    "type": "Point",    "coordinates": [      -0.5895,      51.3814    ]  },  "properties": {    "timestamp": "2025-09-17T11:45:00Z",    "camera_make": "DJI",    "camera_model": "Mavic 3 Pro"  }}
geolocation-2
geolocation-2.json
{  "type": "Feature",  "id": "route-17",  "producer": "GPX Importer v2",  "bbox": [-3.2, 55.9, -3.1, 56.0],  "geometry": {    "type": "MultiLineString",    "coordinates": [      [        [-3.19, 55.95, 48.0],        [-3.17, 55.96, 52.5]      ],      [        [-3.15, 55.97],        [-3.12, 55.99]      ]    ]  },  "properties": {    "timestamp": "2026-04-02T08:15:00Z",    "activity": "cycling"  }}

Fields

  • at most 32 properties
  • keys at most 128 characters
  • type constant "Feature" required

    The GeoJSON object type.

  • id string | number

    A unique identifier for the feature.

    • string: at most 128 characters
  • producer string

    The creator (model, tool or author) of this record.

    • at most 1024 characters
  • bbox bbox
  • geometry null | object required

    The geometry of the feature. Uses the WGS 84 coordinate reference system.

    Any of these forms:

    1. null
    2. Point object
      • at most 16 properties
      • keys at most 128 characters
    3. LineString object
      • at most 16 properties
      • keys at most 128 characters
    4. Polygon object
      • at most 16 properties
      • keys at most 128 characters
    5. MultiPoint object
      • at most 16 properties
      • keys at most 128 characters
    6. MultiLineString object
      • at most 16 properties
      • keys at most 128 characters
    7. MultiPolygon object
      • at most 16 properties
      • keys at most 128 characters
  • properties null | object required

    An object containing additional properties of the feature. Can be null.

    Any of these forms:

    1. null
    2. object
      • at most 100 properties
      • keys at most 128 characters
      • timestamp string

        The time the feature was observed.

        • at most 128 characters
        • format date-time
      • camera_make string

        The make of the camera that captured the source media.

        • at most 128 characters
      • camera_model string

        The model of the camera that captured the source media.

        • at most 128 characters
      • Any other key.

  • Any other key.

Definitions

  • position array

    A single position: [longitude, latitude] or [longitude, latitude, altitude].

    • 2 to 3 items
    • [0] number required

      Longitude in decimal degrees.

      • -180 to 180
    • [1] number required

      Latitude in decimal degrees.

      • -90 to 90
    • [2] number required

      Altitude in meters above the WGS 84 ellipsoid.

    • [] never
  • line-string-coords array of position

    An ordered list of two or more positions.

    • 2 to 10000 items
  • linear-ring array of position

    A closed ring of four or more positions. The first and last positions must be identical.

    • 4 to 10000 items
  • polygon-coords array of linear-ring

    A list of linear rings. The first is the exterior ring; any others are holes.

    • 1 to 100 items
  • bbox array of number

    A bounding box (RFC 7946, Section 5): 4 values for 2D or 6 values for 3D.

    • 4 to 6 items

    Rules:

    • Must match at least one of the alternatives below.
      Show the JSON Schema
      {  "anyOf": [    {      "minItems": 4,      "maxItems": 4    },    {      "minItems": 6,      "maxItems": 6    }  ]}
  • foreign-member string | number | boolean | null | array of string | number | boolean | object

    Constrained definition of RFC 7946 Foreign Members.

    Any of these forms:

    1. string
      • at most 2048 characters
    2. number
    3. boolean
    4. null
    5. array of string | number | boolean
      • at most 100 items
      • each string: at most 1024 characters
    6. object
      • at most 20 properties
      • keys at most 128 characters
      • * string | number | boolean | null

        Any other key.

        • string: at most 2048 characters

Copyright 2025-2026 The OATS Authors. Licensed under Apache-2.0.