TSTool / Command / WriteObjectToJSON
Overview
The WriteObjectToJSON command writes an object to a JSON file.
Any JSON object can be written, including objects read from GeoJSON files
(for example using the NewObject command).
Command Editor
The following dialog is used to edit the command and illustrates the command syntax.
WriteObjectToJSON Command Editor (see also the full-size image)
Command Syntax
The command syntax is as follows:
WriteObjectToJSON(Parameter="Value",...)
Command Parameters
| Parameter | Description | Default |
|---|---|---|
ObjectIDrequired |
The object identifier for the object to be output. Can be specified using ${Property}. |
None - must be specified. |
OutputFilerequired |
The name of the output file to write. Can be specified using ${Property}. |
None - must be specified. |
PrettyPrint |
Whether to format the JSON in indented format, which is easier to read but results in larger files. | True |
Indent |
Used with PrettyPrint=True to indicate the number of spaces used for indentation. |
2 |
Examples
See the automated tests.
Troubleshooting
Problems in JSON files can be checked by using online "JSON lint" websites.
See Also
NewObjectcommand