Raster File
Adapter Type: "files.raster"
This adapter keeps a raster node, or a raster tiler node, in step with an image file on disk, in both directions. It is useful for editing a map in an image editor, or for handing a map to other software.
The adapter never creates the node. It only synchronises a node which is already in the map, for instance one which came from a static map. It starts synchronising when the node appears, and again if it reappears after the map has been cleared. From then on, changes to the node are written to the file, and changes to the file are loaded into the node. Writes are saved atomically, so other software never sees a half-written file.
The image file is a PNG. A PNG has no georeferencing, so when a file is loaded the node keeps its resolution and pixel origin, while its size and pixel format are updated to match the image. The image is stored with north at the top, the usual convention for image files.
| Setting | Type | Description | Default |
|---|---|---|---|
path | string | The path of the image file. The format is chosen from the file extension; only .png is currently supported. The directory is created if it does not exist. Required. | |
nodeId | string | The ID of the raster or raster tiler node to synchronise. Required. | |
direction | string | Which way changes are propagated. One of "bidirectional", "toDisk" (only write the node out to the file) or "fromDisk" (only load the file into the node). | "bidirectional" |
initialSync | string | Which side wins when the node appears and both it and the file have content: "map" overwrites the file with the node, "disk" overwrites the node with the file. "disk" is not valid with a direction of "toDisk", and "map" is not valid with "fromDisk". | "map", or "disk" when direction is "fromDisk" |
Example
"uniqueAdapterName": {
"enabled": true,
"type": "files.raster",
"settings": {
"path": "/var/lib/rocos/floor-plan.png",
"nodeId": "floor-plan",
"direction": "bidirectional",
"initialSync": "disk"
}
}