{
  "title": "Gazetteer",
  "description": "The Vision Gazetteer",
  "primaryKey": [
    "uprn",
    "counter"
  ],
  "type": "object",
  "properties": {
    "uprn": {
      "typeHint": "uprn",
      "type": "integer",
      "maxLength": 12,
      "title": "UPRN",
      "description": "A gazetteer URN"
    },
    "originHashSum": {
      "typeHint": "text",
      "type": "string",
      "title": "Hash sum",
      "description": "Hash representing column data",
      "audit": "raw"
    },
    "counter": {
      "typeHint": "integer",
      "type": "integer",
      "minLength": 1,
      "description": "A generated sequence number which is combined with the URN to identify the address (Minimum=1)"
    },
    "class": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 6,
      "title": "Classification",
      "description": "Classification of the address record. Source: Contributing Local Authority"
    },
    "parentUprn": {
      "typeHint": "uprn",
      "type": "integer",
      "maxLength": 12,
      "title": "Parent UPRN",
      "description": "UPRN of the parent record if a parent child relationship exists. Source: Contributing Local Authority"
    },
    "usrn": {
      "typeHint": "usrn",
      "type": "integer",
      "maxLength": 8,
      "title": "USRN",
      "description": "Unique Street Reference Number. Source: Contributing Local Authority"
    },
    "state": {
      "typeHint": "text",
      "type": "string",
      "title": "Building State",
      "description": "A code identifying the current state of the property. Source: Contributing Local Authority"
    },
    "localCustodianCode": {
      "typeHint": "integer",
      "type": "integer",
      "title": "LLPG Custodian",
      "description": "Unique identifier of the LLPG Custodian"
    },
    "officialFlag": {
      "typeHint": "text",
      "type": "string",
      "title": "Address Status",
      "description": "Status of the address. Source: Contributing Local Authority"
    },
    "addressLabel": {
      "typeHint": "address",
      "type": "string",
      "maxLength": 500,
      "title": "Address",
      "description": "An address label assembles from various elements",
      "audit": "raw"
    },
    "alias": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 30,
      "title": "Alias",
      "description": "The alias for the property in question"
    },
    "addressDescription": {
      "typeHint": "text",
      "type": "string",
      "title": "UPRN again",
      "description": ""
    },
    "businessName": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 60,
      "title": "Business Name",
      "description": "Stores the Business Name of the address if applicable"
    },
    "buildingName": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 60,
      "title": "Building Name",
      "description": "Stores the name of a building if applicable"
    },
    "buildingNumber": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 15,
      "title": "Building Number",
      "description": "Stores the number of a building if applicable"
    },
    "streetName1": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 60,
      "title": "Street",
      "description": "The first Street name of the property"
    },
    "streetName2": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 60,
      "title": "Street 2",
      "description": "The second Street name of the property, if any"
    },
    "areaName1": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 40,
      "title": "Area Name",
      "description": "The local area (e.g. Town, Suburb)"
    },
    "areaName2": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 40,
      "title": "Area Name 2",
      "description": "The main area (e.g. County, State)"
    },
    "postTown": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 30,
      "title": "Post Town",
      "description": "The Post Town"
    },
    "postCounty": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 30,
      "title": "Post County",
      "description": "The Post County"
    },
    "postcode": {
      "typeHint": "postcode",
      "type": "string",
      "maxLength": 10,
      "title": "Post Code",
      "description": "Address Postcode"
    },
    "longitude": {
      "typeHint": "latLong",
      "type": "number",
      "maxLength": 8,
      "multipleOf": 0.00000001,
      "title": "Longitude",
      "description": "A value defining the Longitude in accordance with the ETRS89 coordinate reference system. Source: Ordnance Survey"
    },
    "latitude": {
      "typeHint": "latLong",
      "type": "number",
      "maxLength": 8,
      "multipleOf": 0.00000001,
      "title": "Latitude",
      "description": "A value defining the Latitude in accordance with the ETRS89 coordinate reference system. Source: Ordnance Survey"
    },
    "actualX": {
      "typeHint": "osNatGrid",
      "type": "number",
      "maxLength": 8,
      "multipleOf": 0.01,
      "title": "X",
      "description": "The X grid co-ordinate (Easting)"
    },
    "actualY": {
      "typeHint": "osNatGrid",
      "type": "number",
      "maxLength": 8,
      "multipleOf": 0.01,
      "title": "Y",
      "description": "The Y grid co-ordinate (Northing)"
    },
    "routingX": {
      "typeHint": "osNatGrid",
      "type": "number",
      "maxLength": 8,
      "multipleOf": 0.01,
      "title": "Routing X",
      "description": "The Easting co-ordinate of an access-point for the address"
    },
    "routingY": {
      "typeHint": "osNatGrid",
      "type": "number",
      "maxLength": 8,
      "multipleOf": 0.01,
      "title": "Routing Y",
      "description": "The Northing co-ordinate of an access-point for the address"
    },
    "mapbookRef": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 15,
      "title": "Map book ref",
      "description": "Map book reference of premise"
    },
    "lpiKey": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 14,
      "title": "LPI Key",
      "description": "NLPG Land and Property Identifier key"
    },
    "lsoaCode2011": {
      "typeHint": "text",
      "type": "string",
      "title": "LSOA Code",
      "description": "LSOA Code 2011"
    },
    "voaNdrpDescCode": {
      "typeHint": "text",
      "type": "string",
      "title": "VOA NDRP Desc Code",
      "description": "VOA NDRP Desc Code"
    },
    "voaNdrScatCode": {
      "typeHint": "text",
      "type": "string",
      "title": "VOA NDR Scat Code",
      "description": "VOA NDR Scat Code"
    },
    "wardCode": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 9,
      "title": "Ward Code",
      "description": "ONS GSS code of the electoral ward (Eng and Scot) or the electoral division (Wales) name in which the property is situated"
    },
    "commandAreaId": {
      "typeHint": "integer",
      "type": "integer",
      "title": "Command Area Id",
      "description": "The Command Area Id"
    },
    "commandAreaLabel": {
      "typeHint": "text",
      "type": "string",
      "title": "Command Area Label",
      "description": "The Command Area Label"
    },
    "boroughId": {
      "typeHint": "integer",
      "type": "integer",
      "title": "Borough Id",
      "description": "The Borough Id"
    },
    "districtId": {
      "typeHint": "integer",
      "type": "integer",
      "title": "District Id",
      "description": "The District Id"
    },
    "dataSource": {
      "typeHint": "text",
      "type": "string",
      "maxLength": 10,
      "title": "Data Source",
      "description": "Where this data has come from - Ordnance Survey, legacy, etc"
    },
    "maskingNumber": {
      "type": "string",
      "title": "Masking Number",
      "description": "Masking number calculated from the UPRN of the property"
    },
    "routingNode": {
      "type": "boolean",
      "title": "Routing Node",
      "description": "Does the property have a routing node?"
    },
    "markedAsInvalid": {
      "type": "boolean",
      "title": "Marked As Invalid",
      "description": "Whether this property is marked as invalid"
    },
    "excludeFromVisionExtract": {
      "type": "boolean",
      "title": "Marked As Error",
      "description": "Whether this property should be excluded from the Vision Gazetteer extract"
    },
    "primaryFlag": {
      "type": "integer",
      "title": "Primary Flag"
    },
    "lpiStatus": {
      "type": "integer",
      "maxLength": 1,
      "description": "LPI Logical Status, 1: Approved, 3: Alternative, 6: Provisional, 8: Historical"
    }
  },
  "indexes": [
    {
      "columns": [
        "uprn",
        "counter"
      ],
      "unique": true
    },
    {
      "columns": ["origin_hash_sum"],
      "unique": false
    },
    {
      "columns": ["class"],
      "unique": false
    },
    {
      "columns": ["postcode"],
      "unique": false
    },
    {
      "columns": ["mapbook_ref"],
      "unique": false
    },
    {
      "columns": ["lpi_key"],
      "unique": false
    },
    {
      "columns": ["lsoa_code_2011"],
      "unique": false
    },
    {
      "columns": ["voa_ndrp_desc_code"],
      "unique": false
    },
    {
      "columns": ["voa_ndr_scat_code"],
      "unique": false
    },
    {
      "columns": ["parent_uprn"],
      "unique": false
    },
    {
      "columns": ["usrn"],
      "unique": false
    },
    {
      "columns": ["maskingNumber"],
      "unique": false
    },
    {
      "columns": ["state"],
      "unique": false
    },
    {
      "columns": ["local_custodian_code"],
      "unique": false
    },
    {
      "columns": ["official_flag"],
      "unique": false
    }
  ],
  "required": [
    "uprn",
    "counter",
    "addressLabel"
  ],
  "label": "address_label"
}
