Map Configuration

This chapter explains how to set up a configuration file for the Data Inspector to correctly decode and visualize objects of the same type in a folder of an object store layer.

.here/map.json is a configuration file stored in any folder in an object store layer, including the layer's root folder. If it is present, the folder content can be interpreted as a tiled map.

The configuration describes the following properties:

  • keytype: Type of the partitioning scheme used. Currently, heretile is supported.
  • levels: Array of quad tree levels which have tiles.
  • prefix/suffix: Used in constructing the actual object key (for example, a suffix could be .png for tiles in the <heretile>.png format). If folders is true, the prefix and suffix are used to filter the objects inside the folder (empty by default).
  • defaults:
    • The center and recommended zoom level for visualization.
    • The content type and schema used for decoding/rendering the objects. These override the content type or schema defined in the individual objects.

Below is a sample .here/map.json file for plain HERE tiles at level 14 located around San Francisco, with GeoJSON content type:

{
    "keytype": "heretile",
    "levels" : [14],
    "prefix": "",
    "suffix": "",
    "defaults": {
        "view": {
            "center": { "lat": 37.7749, "lng": -122.4194 },
            "zoom": 13
        },
        "contentType": "application/geo+json",
        "schemaHrn": ""
    }
}

A valid map configuration enables different inspection experiences, which can be further nested:

  • The layer root contains a tiled map where each tile is a single object.

    For example, the root contains a properly configured .here/map.json where the layer data level and schema HRN are specified:

    {
        "keytype": "heretile",
        "levels" : [12],
        "prefix": "",
        "suffix": "",
        "defaults": {
            "view": {
                "center": { "lat": 52.43739, "lng": 14.10953 },
                "zoom": 12
            },
            "contentType": "application/x-protobuf",
            "schemaHrn": "hrn:here:schema:::com.here.schema.rib:topology-geometry_v2:2.66.0"
        }
    }
    

    Also, there are objects with keys 23619104 and 23619105. These objects contain Protobuf-encoded road geometries of Berlin.

    Go to the Map View to find the tile grid. Click a tile to decode and/or visualize the object contents.

  • The layer root contains a tiled map where a tile can be a folder with objects relevant for that tile.

    For example, the root contains .here/map.json and subfolders like 23618357/ and 23618359/.

    Each subfolder contains its own .here/map.json and Protobuf-encoded objects.

    Note that map configuration is not recursive and is relevant only for the folder where it is contained. Subfolders need to contain their own map configurations to be able to decode and/or visualize objects in those subfolders.

    Go to the Map View to find the tile grid. Click a tile to decode and visualize the corresponding object contents.

    Note the tiles with a folder icon in the bottom-right corner. Those represent the subfolders 23618357/ and 23618359/ mentioned above. Click one of those tiles to inspect the objects of the corresponding folder. If the subfolder contains a valid map configuration, its contents is visualized in the Map View; otherwise - in the Partitions List.

Rendering Plugin Setup

Optionally, a rendering plugin can be stored in the .here/renderers/ folder. It is used if there isn't any schema, or to provide a custom plugin even if there is a schema.

If there isn't any schema, then the plugin file should be always named default.js. This allows visualizing objects in formats like JSON, XML, and CSV.

When specifying a custom plugin for a schema, the plugin file must be named as described in the Archetypes documentation (for example, com.here.example.v1.MainProtobufMessage.js). This allows for multiple custom plugins to be used, even if each object has its own schema.

results matching ""

    No results matching ""