Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.42 KB

README.md

File metadata and controls

60 lines (40 loc) · 1.42 KB

val3ditypy

Python bindings for val3dity.

to install:

  1. Clone the repository:
git clone /~https://github.com/tudelft3d/val3ditypy
git submodule init
git submodule update
  1. Install val3dity and all its dependencies and make sure you can compile it

  2. Compile the bindings and install the Python package: python setup.py install

how to use it

import val3ditypy
import json

mycity = json.load(open("/home/elvis/delft.city.json"))

if val3ditypy.is_valid_cityjson(mycity) == True:
  print("valid!")
else:
  print("oh no invalid :(")

report = val3ditypy.validate_cityjson(mycity)
print(report["validity"])

input accepted

  1. one CityJSON object
  2. one tu3djson object
  3. one geometry of a tu3djson object
  4. IndoorGML

functions

bool is_valid_onegeom(json mydata)
json validate_onegeom(json mydata)

bool is_valid_tu3djson(json mydata)
bool is_valid_tu3djson_each(json mydata)
json validate_tu3djson(json mydata)

bool is_valid_cityjson(json mydata)
json validate_cityjson(json mydata)

bool is_valid_indoorgml(string myindoors)
json validate_indoorgml(string myindoors)