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 can take input from either stdin or a file, and it always outputs the results to stdout.
The output can be a CityJSON object or a CityJSONSeq stream.
OBJ Conversion
The library also provides functionality to convert CityJSON or CityJSONSeq files to OBJ format, which can be used for 3D visualization in many software packages.
Here's an example of how to use the OBJ conversion in your Rust code:
use ;
use File;
use Read;
Convert CityJSON to CityJSONSeq
Convert a CityJSON file to a CityJSONSeq stream:
Alternatively use stdin:
|
Convert CityJSONSeq to CityJSON
Convert a CityJSONSeq stream to a CityJSON file:
|
Filter CityJSONSeq
cat myfile.city.jsonl | cjseq filter --bbox 85007 446179 85168 446290 > mysubset.city.jsonl
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.