cjseq
cjseq is a Rust libray+binary for creating, processing, and modifying CityJSONSeq files, as well as converting to/from CityJSON.
Installation
Installing the binary
- Install the Rust compiler
- Run
cargo install cjseq - Then a binary called
cjseqis installed system-wide
Installing the library
- Install the Rust compiler
- Run
cargo install cjseq
Compiling the project
- Install the Rust compiler
- Clone the repository:
git clone https://github.com/cityjson/cjseq.git - Build the project:
cargo build --release - Run the program:
./target/release/cjseq --help
Usage
cjseq takes input from either a file or the standard input (stdin, if no file path is given as argument), and it always outputs the results to the standard output (stdout).
The output can be a CityJSON object or a CityJSONSeq stream.
Convert CityJSON to CityJSONSeq
The operator "cat" converts a CityJSON file to a CityJSONSeq stream:
Alternatively, to use stdin as input:
|
Convert CityJSONSeq to CityJSON
The operator "collect" converts a CityJSONSeq stream to a CityJSON file:
|
Notice that globbing works for the collect command:
|
Filter CityJSONSeq
An input stream of CityJSONSeq can be filtered with the following operators:
)
As an example:
|
Input constraints
- the input CityJSON/Seq must be v1.1 or v2.0 (v1.0 will panic).
- the input JSON must be CityJSON schema-valid, use cjval to validate.
WASM bindings
cjseq can be used in JavaScript/TypeScript applications via WASM bindings.
Build the WASM bindings: