activitiesInPolygon

Get a list of conducted activities within existing polygons (pre-defined by Windward) or your own areas of interest (coordinates), in a given time frame.

Query Schema

type Query {
   activitiesInPolygon(input: ActivitiesInPolygonInput!): ActivitiesInPolygonConnection!
}

Arguments

NameTypeDescription
inputActivitiesInPolygonInput!Sets which activities to return by specifying filtering criteria.

Schema

input ActivitiesInPolygonInput {
  type: ActivityTypes!
  polygon: GeoJSONPolygonGeometryScalar
  polygonId: ObjectId
  timeRange: ClosedDateTimeRangeInput!
  limit: PositiveInt! = 100
  offset: NonNegativeInt! = 0
}

ActivitiesInPolygonInput Fields

NameTypeDescription
limitPositiveInt! The maximal number of returned records.
offsetNonNegativeInt!The first results page.
polygonGeoJSONPolygonGeometryScalarThe geographical location of the returned activities.
polygonIdObjectIdThe unique Windward assigned ID of the polygon in which the activities occurred.
timeRangeClosedDateTimeRangeInput!The time range within which the activities occurred.
typeActivityTypes!The activity type of the returned activities.

Returns

NameDescription
ActivitiesInPolygonConnection!The activity nodes returned by the activitiesInPolygon query input (the object constitutes the response of the query).

ActivitiesInPolygonConnection Fields

NameTypeDescription
nodes[Activity!]!The activities in the specified polygon and time range.
totalCountNonNegativeInt!The total number of activities in the polygon and time range.

Example Code

Sample Mutation

query ActivitiesInPolygon($input: ActivitiesInPolygonInput!) {
  activitiesInPolygon(input: $input) {
    nodes {
      duration
      endDate
      formerMMSI
      id
      nextPortId
      previousPortId
      startCoordinate
      startDate
      vesselId
      endCoordinate
      polygon {
        id
        type
        properties {
          name
          areaType
          country
          locode
          secondaryLocodes
        }
      }
      type
      vessel {
        id
        name
        imo
        mmsi
        class
        length
        flag
        status
        grosstonnage
        callsign
        subClass
        draught
        insurer
        historicalNames
      }
    }
    totalCount
  }
}

Variables

{
  "input": {
    "polygon": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            113.258057,
            19.823202
          ],
          [
            113.258057,
            23.007113
          ],
          [
            120.629883,
            23.007113
          ],
          [
            120.629883,
            19.823202
          ],
          [
            113.258057,
            19.823202
          ]
        ]
      ]
    },
    "limit": 2,
    "offset": 0,
    "timeRange": {
      "from": "2022-11-01T00:00:00Z",
      "to": "2022-12-01T00:00:00Z"
    },
    "type": "MEETING"
  }
}

Response

{
  "data": {
    "activitiesInPolygon": {
      "nodes": [
        {
          "duration": 24.904722222222222,
          "endDate": "2022-11-01T00:03:18.000Z",
          "formerMMSI": null,
          "id": "635f040d17a127f673dfebee",
          "nextPortId": "57d7bd342e4e5fe35e7b3136",
          "previousPortId": "57d7bd342e4e5fe35e7b3136",
          "startCoordinate": [
            120.15539,
            22.83315
          ],
          "startDate": "2022-10-30T23:09:01.000Z",
          "vesselId": "5a9ef384e200661b8881224b",
          "endCoordinate": [
            120.18079,
            22.82978
          ],
          "extraFields": null,
          "polygon": null,
          "type": "MEETING",
          "vessel": {
            "id": "5a9ef384e200661b8881224b",
            "name": "YUNG AN NO.16",
            "imo": null,
            "mmsi": 416005507,
            "class": "ServiceVessel",
            "length": 33,
            "flag": "Taiwan",
            "status": null,
            "grosstonnage": null,
            "callsign": "BR4022",
            "subClass": null,
            "draught": 5.2,
            "insurer": null,
            "historicalNames": null
          }
        },
        {
          "duration": 24.904722222222222,
          "endDate": "2022-11-01T00:03:18.000Z",
          "formerMMSI": null,
          "id": "635f040d941932c3051d8d6e",
          "nextPortId": "57dd86552e4e5fe35e7b320d",
          "previousPortId": "57dd86552e4e5fe35e7b320d",
          "startCoordinate": [
            120.152,
            22.83246
          ],
          "startDate": "2022-10-30T23:09:01.000Z",
          "vesselId": "595d1b29bf8fc070cc5fe927",
          "endCoordinate": [
            120.18477,
            22.82794
          ],
          "extraFields": null,
          "polygon": null,
          "type": "MEETING",
          "vessel": {
            "id": "595d1b29bf8fc070cc5fe927",
            "name": "PACIFIC BREEZE",
            "imo": 9698123,
            "mmsi": 538007670,
            "class": "Tanker",
            "length": 300,
            "flag": "MarshallIslands",
            "status": null,
            "grosstonnage": 143000,
            "callsign": "V7LZ9",
            "subClass": "LNG Tanker",
            "draught": 11.9,
            "insurer": null,
            "historicalNames": null
          }
        }
      ],
      "totalCount": 4266
    }
  }
}