cityjson-validator-rust

June 16, 2021 ยท View on GitHub

A cli tool which validates a cityjson file according to a schema, and certain other properties


properties the validator tests against

  • The cityjson must match the 1.0.2 cityjson-schema
  • Vertices cannot be duplicate
  • Proper building hierarchies
    • 1st level city objects cannot have parents -> schema should take care of this
      • if they have children, they must exist
    • 2nd level city objects must have at least 1 parent -> schema should take care of this
      • this parent must exist
    • parent-child relationships must be mutual (parent pointing to child, child pointing to parent)
  • no duplicate keys in general
    • names (hashes) cannot be duplicate

Install

git clone https://github.com/josfeenstra/cjval-rs
cd cityjson-validator-rs
cargo build

Local usage

target/debug/validator.exe [absolute path to schema] [absolute path to cityjson file] 

Web usage

Download wasm-pack.

Then run

wasm-pack build -t web

for a local /pkg, or run

wasm-pack build -t web --out-dir ../cityjson-validator/docs/bin/

Then run it like we do here.


Credits

  • Written as a GEO5010 research project for the Msc Geomatics @ Tu Delft