{
  "type" : "record",
  "name" : "Location",
  "namespace" : "eu.europa.emsa.ecld",
  "fields" : [ {
    "name" : "loCode",
    "type" : {
      "type" : "string",
      "minLength" : 5,
      "maxLength" : 5,
      "example" : "GRZTH"
    },
    "doc" : "Unique identifier of the location (concatenation of the 2-character ISO code of a country and a 3-character unique location identifier as defined by UNECE and/ or in SSN.\nSSN specific locodes in the form [Countrycode_888] (e.g.PT888) are used in the context of CLD to identify an unknown port in a given country"
  }, {
    "name" : "deactivated",
    "type" : {
      "type" : "boolean",
      "example" : false
    },
    "doc" : "Specifies if the record is deactivated."
  }, {
    "name" : "details",
    "type" : [ "null", {
      "type" : "record",
      "name" : "LocationDetails",
      "doc" : "The details of a CLD location",
      "fields" : [ {
        "name" : "createdOn",
        "type" : {
          "type" : "long",
          "logicalType" : "timestamp-millis",
          "example" : 1706869855000
        },
        "doc" : "Date and time of the creation of the location in the database. In milliseconds since the UNIX epoch."
      }, {
        "name" : "lastUpdatedOn",
        "type" : [ "null", {
          "type" : "long",
          "logicalType" : "timestamp-millis",
          "example" : 1706869855000
        } ],
        "doc" : "Date and time of the last update of the location in the database. In milliseconds since the UNIX epoch."
      }, {
        "name" : "locationNameWithDiacritics",
        "type" : [ "null", {
          "type" : "string",
          "maxLength" : 50,
          "example" : "Zákynthos"
        } ],
        "doc" : "Official name of the location with diacritics. Equals to the Name with diacritics provided by UNECE for UNECE locations (e.g. Zákynthos for Locode GRZTH)"
      }, {
        "name" : "locationNameWithoutDiacritics",
        "type" : {
          "type" : "string",
          "maxLength" : 50,
          "example" : "Zakynthos"
        },
        "doc" : "Name of the location without diacritics. Equals to the Name without diacritics provided by UNECE for UNECE locations (e.g. Zakynthos for Locode GRZTH)."
      }, {
        "name" : "countryCode",
        "type" : {
          "type" : "string",
          "minLength" : 2,
          "maxLength" : 2,
          "example" : "GR"
        },
        "doc" : "A code representing the country where the location is situated"
      }, {
        "name" : "type",
        "type" : {
          "type" : "int",
          "minimum" : 0,
          "maximum" : 1,
          "example" : 1
        },
        "doc" : "An indication whether the location is a United Nations Code for Trade and Transport Locations (UN/LOCODE), or whether the location is specific to SafeSeaNet.  Possible values:\n<br/>0 (SSN)\n<br/>1 (UNECE)"
      }, {
        "name" : "coordinates",
        "type" : [ "null", {
          "type" : "record",
          "name" : "Coordinates",
          "doc" : "Geographical coordinates, in latitude and longitude",
          "fields" : [ {
            "name" : "latitude",
            "type" : {
              "type" : "double",
              "minimum" : -90.0,
              "maximum" : 90.0,
              "multipleOf" : 1.0E-6,
              "example" : 37.7804
            },
            "doc" : "Latitude in decimal degrees"
          }, {
            "name" : "longitude",
            "type" : {
              "type" : "double",
              "minimum" : -180.0,
              "maximum" : 180.0,
              "multipleOf" : 1.0E-6,
              "example" : 20.9035
            },
            "doc" : "Longitude in decimal degrees"
          } ]
        } ],
        "doc" : "Location of the port"
      }, {
        "name" : "UNECEFunctions",
        "type" : {
          "type" : "array",
          "items" : {
            "type" : "record",
            "name" : "FunctionsUNECE",
            "doc" : "UNECE defined location functions",
            "fields" : [ {
              "name" : "function",
              "type" : {
                "type" : "string",
                "minLength" : 1,
                "maxLength" : 1,
                "example" : "3"
              },
              "doc" : "Function number of the location (classifier code) as defined by UNECE. It is provided for UNECE locations. Possible values:\n<br/>0\n<br/>1\n<br/>2\n<br/>3\n<br/>4\n<br/>5\n<br/>6\n<br/>7\n<br/>8\n<br/>B"
            } ]
          },
          "uniqueItems" : true,
          "maxItems" : 8
        }
      }, {
        "name" : "portFacilities",
        "type" : {
          "type" : "array",
          "items" : {
            "type" : "record",
            "name" : "PortFacility",
            "doc" : "A facility in a port",
            "fields" : [ {
              "name" : "name",
              "type" : {
                "type" : "string",
                "minLength" : 1,
                "maxLength" : 1000,
                "example" : "Zakynthos"
              },
              "doc" : "Name of a port, written as the port name is normally written."
            }, {
              "name" : "description",
              "type" : {
                "type" : "string",
                "minLength" : 1,
                "maxLength" : 2500,
                "example" : "Passenger Port"
              },
              "doc" : "Port facility description in GISIS Maritime Security"
            }, {
              "name" : "code",
              "type" : {
                "type" : "string",
                "maxLength" : 10,
                "example" : "GRZTH-0001"
              },
              "doc" : "A code representing the port facility at the referenced port, composed by a locode followed by a port fcaility GISIS code separated by a dash (e.g. NLRTM-0406)"
            }, {
              "name" : "coordinates",
              "type" : [ "null", "Coordinates" ],
              "doc" : "Location of the port facility"
            } ]
          },
          "uniqueItems" : true,
          "maxItems" : 500
        }
      }, {
        "name" : "relevantToSSN",
        "type" : {
          "type" : "boolean",
          "example" : false
        },
        "doc" : "An indicator set to True if the location is considered as a port or off-shore installation by SafeSeaNet."
      } ]
    } ],
    "doc" : "Details of the CLD location, null if the record is deactivated."
  } ]
}
