https://github.com/cityjson/cjval
Official validator for CityJSON + CityJSONSeq datasets
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.7%) to scientific vocabulary
Keywords
Repository
Official validator for CityJSON + CityJSONSeq datasets
Basic Info
Statistics
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 1
- Releases: 5
Topics
Metadata Files
README.md
cjval: schema-validation of CityJSON + CityJSONSeq datasets
A Rust library and binaries to validate the syntax of CityJSON objects (CityJSON + CityJSONSeq).
It validates against the CityJSON schemas and additional functions have been implemented (because these checks cannot be expressed with JSON Schemas).
The following error checks are performed:
- JSON syntax: is it a valid JSON object?
- CityJSON schemas: validation against the schemas (CityJSON v1.0 + v1.1 + v2.0)
- Extension schemas: validate against the extra schemas if there's an Extension (those are automatically fetched from a URL)
- parentschildrenconsistency: if a City Object references another in its
"children", this ensures that the child exists. And that the child has the parent in its"parents" - wrongvertexindex: checks if all vertex indices exist in the list of vertices
- semantics_array: checks if the arrays for the semantics in the geometries have the same shape as that of the geometry and if the values are consistent
- textures: checks if the arrays for the textures are coherent (if the vertices exist + if the texture exists)
- materials: checks if the arrays for the materials are coherent with the geometry objects and if the material exists
It also verifies the following, these are not errors but warnings since the file is still considered valid and usable, but they can make the file larger and some parsers might not understand all the properties:
- extrarootproperties: if CityJSON has extra root properties, these should be documented in an Extension. If not this warning is returned
- duplicate_vertices: duplicated vertices in
"vertices"are allowed, but they take up space and decrease the topological relationships explicitly in the file. If there are any, cjio has the operatorcleanto fix this automatically. - unused_vertices: vertices that are not referenced in the file, they take extra space. If there are any, cjio has the operator
cleanto fix this automatically.
A Rust library + 2 binaries
cjval is a Rust library, and has 2 different binaries:
cjvalto validate a CityJSON file or a CityJSONSeq stream (it downloads Extensions automatically if the file contains some)cjvalextto validate a CityJSON Extension file
Installation/compilation
To install the binaries on your system easily
- install the Rust compiler
cargo install cjval --features build-binary
To compile the project (and eventually modify it)
- install the Rust compiler
git clone https://github.com/cityjson/cjval.gitcargo build --release --features build-binary(this will ensure the binaries are compiled too)./target/release/cjval myfile.json
Web application
The code is used at https://validator.cityjson.org, it is compiled as a WebAssembly (WASM code here) and a simple GUI was built.
CLI Usage
For CityJSON files
The CityJSON schemas are packaged with the binary, so it suffices to:
sh
cjval myfile.city.json --verbose
(the latest schemas of a X.Y version will be automatically fetched)
--verbose is used to get a detailed report per error check.
If the file contains one or more Extensions, eg:
json
{
"type": "CityJSON",
"version": "2.0",
"extensions":
{
"Potato":
{
"url": "https://www.cityjson.org/extensions/potato.ext.json",
"version": "1.0"
}
}
...
then cjval will download the Extension schema files automatically.
If instead you want to use your own local Extension schema(s), you can pass them as argument with the -e flag and this will overwrite the automatic download:
sh
cjval myfile.city.json -e ./myextensions/generic.ext.json
For CityJSONSeq
To validate a stream of CityJSONFeature, you need to 'cat' the file:
sh
cat mystream.city.jsonl | cjval --verbose
Or you can use cjseq to generate the stream from a CityJSON file:
sh
cjseq cat -f myfile.city.json | cjval --verbose
and you'll get a short report per line (which is one CityJSON followed by several CityJSONFeature).
--verbose is used to get a detailed report per line, if not used then only lines with errors are reported.
Contributors
- @hugoledoux
- @josfeenstra (started the project for an MSc Geomatics course at TU Delft, original code)
Owner
- Name: CityJSON
- Login: cityjson
- Kind: organization
- Website: https://cityjson.org
- Repositories: 14
- Profile: https://github.com/cityjson
For all CityJSON matters. Managed by @tudelft3d
GitHub Events
Total
- Create event: 6
- Issues event: 3
- Release event: 4
- Watch event: 1
- Delete event: 2
- Issue comment event: 1
- Push event: 11
- Pull request event: 6
Last Year
- Create event: 6
- Issues event: 3
- Release event: 4
- Watch event: 1
- Delete event: 2
- Issue comment event: 1
- Push event: 11
- Pull request event: 6
Committers
Last synced: about 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Hugo Ledoux | h****x@t****l | 160 |
| Hannes Gräuler | h****s@s****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 15
- Total pull requests: 4
- Average time to close issues: 2 months
- Average time to close pull requests: about 5 hours
- Total issue authors: 8
- Total pull request authors: 2
- Average comments per issue: 1.33
- Average comments per pull request: 0.25
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 3
- Pull requests: 3
- Average time to close issues: 23 days
- Average time to close pull requests: 3 minutes
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 0.33
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- balazsdukai (3)
- hugoledoux (3)
- ozgetufan (3)
- clausnagel (2)
- gperonato (1)
- josfeenstra (1)
- GinaStavropoulou (1)
- zacharylee1204 (1)
Pull Request Authors
- GinaStavropoulou (6)
- lordi (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cargo 16,953 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 15
- Total maintainers: 1
crates.io: cjval
Schema-validation of CityJSON+CityJSONSeq datasets
- Homepage: https://github.com/cityjson/cjval
- Documentation: https://docs.rs/cjval/
- License: MIT
-
Latest release: 0.8.3
published about 1 year ago