Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed translated content for 'zh'
Sv translation
languageen

/api/reports/views/:id/map

This method returns data and metadata of specified map.

Resource Information

Request Parameters

Parameters

Detail

Example

id

ID of the map view. This ID is a part of the /api/reports/:id response.

1234

filter

(Optional) Filter used in the map with following structure:

Name
Description
drilldown

Drilldown defined with attribute code and following structure:

Name
Description
opFilter operation type - please see list of supported values.
value/values(Optional) Depends on selected "op". Contains value or values for filter.
countOp

(Optional) Used with COUNT operation. Specifies the second operation used together with count.

Supported values: EQ, NEQ, GT, GTE, LT, LTE


Code Block
{
   "drilldown": {
      "L_COUNTRY_OR_AREA": {
          "op": "EQ",
          "value": "Slovakia"
      },
      "L_TYPE": {
          "op": "IN",
          "values": [ "Type 1", "Type 2", "Type 3" ]
      },
      "L_DATE": {
          "op": "NOT_NULL"
      },
      "L_PRODUCT":{ 
         "op":"COUNT",
         "countOp":"LTE",
         "value":"816"
      }
   }
}

dateTimeDefinition

(Optional) Date and time definition used in the map with following structure:

NameDescription
dateInterval

(Optional) Date interval to filter values. Has following structure:

Name
Description
aggregationTypeDate interval period - please see list of supported values.
interval

Interval definition with following structure:

Name
Description
typeInterval type - please see list of supported values.
fromInterval start value - please see Setting Date Interval
toInterval end value - please see Setting Date Interval
timeInterval

(Optional) Time interval to filter values. Has following structure:

Name
Description
aggregationTypeTime interval period - please see list of supported values.
interval

Interval definition with following structure:

Name
Description
typeInterval type - please see list of supported values.
fromInterval start value - please see Setting Date Interval
toInterval end value - please see Setting Date Interval


 

Code Block
{
   "dateInterval": {
      "interval": {
          "from": "actualYear-1y",
          "to": "actualYear-1d",
          "type": "custom"
      },
      "aggregationType": "DAY"
   },
   "timeInterval": {
      "interval": {
          "from":{"hour":"14","minute":"15","second":"16"},
          "to":{"hour":"20","minute":"0","second":"0"},
          "type": "absolute"
      },
      "aggregationType": "SECOND"
   }
}

Response Structure

JSON response contains one JSON object. The response is different for point-based map and for shaped-base map.

Point-based map

NameDescription
content.options

Configuration of the map

NameDescription
indicator

Name of the used indicator

colorColor of the indicator in HEX format
content.points

Array of GEO points where each point has following structure:

NameDescription
latitudeLatitude of the GEO point
longitudeLongitude of the GEO point
properties
NameDescription
backgroundColorBackground color
colorColor of the text
nameName of the point
context.dataLinkUnique identifier of the context element
context.indentifierQuery

Query used to display the value for this point

(e.g."[L_COUNTRY_NAME={Albania}]"

captionCaption of the point
valueValue of the indicator
rationSize of the point

Shape-based map

NameDescription
content.options

Configuration of the map

NameDescription
indicator

Name of the used indicator

grades

Array of colors used in the map. Each grade has following properties:

NameDescription
ColorColor of the shape (HEX format)
FromMinimum value of the interval
ToMaximum value of the interval
content.shapes.features

Array of GEO shapes where each shape has following structure:

NameDescription
geometryArray of coordinates which define the shape.
type"Feature"
properties
NameDescription
colorColor of the text
nameName of the point
context.dataLinkUnique identifier of the context element
context.indentifierQuery

Query used to display the value for this point

(e.g."[L_COUNTRY_NAME={Albania}]"

captionCaption of the point
valueValue of the indicator

Sample request/response

Using curl:

Code Block
curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" https://service.belladati.com/api/reports/views/1234/map

The JSON format response (points):

Code Block
javascript
javascript
{
  "title": "<div class=\"cleverTitle\"><\/div>"
  "content": {
  	"points" : [
      {
        "longitude" : 45,
        "latitude" : 40,
        "properties" : {
          "ratio" : 0.6323828313278139,
          "name" : "Armenia",
          "value" : "-7,142,253,000",
          "context" : {
            "identifierQuery" : "[L_COUNTRY_OR_AREA={Armenia}]",
            "dataLink" : "1_1097087486"
          }
        }
      },
      {
        "longitude" : 133,
        "latitude" : -27,
        "properties" : {
          "ratio" : 0,
          "name" : "Australia",
          "value" : "-132,579,546,390",
          "context" : {
            "identifierQuery" : "[L_COUNTRY_OR_AREA={Australia}]",
            "dataLink" : "1_-2097652575"
          }
        }
      }
    ],
    "options" : {
      "indicator" : "Value",
      "color" : "#4379bd"
    }
  }
}
Sv translation
languageja

/api/reports/views/:id/map

このメソッドは、指定されたマップのデータとメタデータを返します。

リソース情報

リクエストパラメーター

パラメーター

詳細

id

マップビューのID。このIDは /api/reports/:id レスポンスの一部です。

1234

filter

(オプション) 次の構造でマップで使用されるフィルター:

説明
drilldown

属性コードと次の構造で定義されたドリルダウン:

説明
op

フィルター操作タイプ - サポートされている値のリストを参照してください。

value/values

(オプション) 選択した "op" によって異なります。フィルターの1つまたは複数の値が含まれます。

countOp

(オプション) COUNT操作で使用されます。 countと一緒に使用される2番目の操作を指定します。

サポートされている値: EQ, NEQ, GT, GTE, LT, LTE




Code Block
{
   "drilldown": {
      "L_COUNTRY_OR_AREA": {
          "op": "EQ",
          "value": "Slovakia"
      },
      "L_TYPE": {
          "op": "IN",
          "values": [ "Type 1", "Type 2", "Type 3" ]
      },
      "L_DATE": {
          "op": "NOT_NULL"
      }
   }
}


dateTimeDefinition

(オプション) 次の構造でマップで使用される日時の定義:

説明
dateInterval

(オプション) 値をフィルタリングする日付間隔。構造は次の通りです:

説明
aggregationType日付間隔期間 - サポートされている値のリストを参照してください。
interval

次の構造の間隔定義:

説明
type間隔のタイプ - サポートされている値のリストを参照してください。
from間隔開始値 - サポートされている値のリストを参照してください。
to間隔終了値 - サポートされている値のリストを参照してください。



timeInterval

(オプション) 値をフィルタリングするための時間間隔。構造は次の通りです:

説明
aggregationType時間間隔期間 - サポートされている値のリストを参照してください。
interval

次の構造の間隔定義:

説明
type間隔のタイプ - サポートされている値のリストを参照してください。
from間隔開始値 - サポートされている値のリストを参照してください。
to間隔終了値 - サポートされている値のリストを参照してください。






Code Block
{
   "dateInterval": {
      "interval": {
          "from":{"year":"2014","month":"1","day":"22"},
          "to":{"year":"2014","month":"1","day":"25"},
          "type": "absolute"
      },
      "aggregationType": "DAY"
   },
   "timeInterval": {
      "interval": {
          "from":{"hour":"14","minute":"15","second":"16"},
          "to":{"hour":"20","minute":"0","second":"0"},
          "type": "absolute"
      },
      "aggregationType": "SECOND"
   }
}


レスポンス構造

JSONレスポンスには、1つのJSONオブジェクトが含まれています。ポイントベースのマップとシェイプベースのマップでは、レスポンスが異なります。

ポイントベースのマップ

説明
content.options

マップの構成

説明
indicator

使用されたインジケーターの名前

color

HEX形式のインジケーターの色


content.points

各ポイントが次の構造を持つGEOポイントの配列:

説明
latitudeGEOポイントの緯度
longitudeGEOポイントの経度
properties


説明
backgroundColor背景色
colorテキスト色
nameポイントの名前
context.dataLinkコンテキスト要素の一意の識別子
context.indentifierQuery

このポイントの値を表示するために使用されるクエリ

(例."[L_COUNTRY_NAME={Albania}]"

captionポイントのキャプション
valueインジケーターの値
rationポイントのサイズ



シェイプベースのマップ

説明
content.options

マップの構成

説明
indicator

使用されたインジケーターの名前

grades

マップで使用される色の配列。各グレードには以下のプロパティがあります:

説明
Color形の色 (HEX形式)
From間隔の最小値
To間隔の最大値



content.shapes.features

各形状が次の構造を持つGEO形状の配列:

説明
geometry

形状を定義する座標の配列。

type"Feature"
properties


説明
colorテキスト色
nameポイントの名前
context.dataLink

コンテキスト要素の一意の識別子

context.indentifierQuery

このポイントの値を表示するために使用されるクエリ

(例."[L_COUNTRY_NAME={Albania}]"

captionポイントのキャプション
valueインジケーターの値



サンプルリクエスト/レスポンス

Curl使用:

Code Block
curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" https://service.belladati.com/api/reports/views/1234/map

JSON形式のレスポンス (ポイント):

Code Block
javascript
javascript
{
  "title": "<div class=\"cleverTitle\"><\/div>"
  "content": {
  	"points" : [
      {
        "longitude" : 45,
        "latitude" : 40,
        "properties" : {
          "ratio" : 0.6323828313278139,
          "name" : "Armenia",
          "value" : "-7,142,253,000",
          "context" : {
            "identifierQuery" : "[L_COUNTRY_OR_AREA={Armenia}]",
            "dataLink" : "1_1097087486"
          }
        }
      },
      {
        "longitude" : 133,
        "latitude" : -27,
        "properties" : {
          "ratio" : 0,
          "name" : "Australia",
          "value" : "-132,579,546,390",
          "context" : {
            "identifierQuery" : "[L_COUNTRY_OR_AREA={Australia}]",
            "dataLink" : "1_-2097652575"
          }
        }
      }
    ],
    "options" : {
      "indicator" : "Value",
      "color" : "#4379bd"
    }
  }
}