cli处理和操作cityjson文件

cjio的Python项目详细描述


cjio或cityjson/io

License: MIT

python cli来处理和操作CityJSON文件。 可以将不同的运算符链接起来,一步执行多个处理操作,cityjson模型将遍历这些运算符,cityjson模型的不同版本可以保存为管道沿线的文件。

安装

它只使用Python3.5+。

要安装最新版本:

pip install cjio

要安装开发分支,并继续使用它进行开发:

git checkout developmentvirtualenv venv. venv/bin/activatepip install --editable .

或者,可以使用包含的pip文件来管理带有pipenv的虚拟环境。

对于Windows用户的注释

如果由于pyprojpyresistent错误而导致安装失败,则需要一个小技巧来解决。 根据您安装的python版本,您可以下载问题包的wheel(python包的二进制文件)。 一个好的网站是here。 然后运行:

pip3 install [name of wheel file]

然后您可以继续:

pip3 install cjio

用法

安装后,您将拥有一个名为cjio的小程序,以查看其可能性:

cjio --helpCommands:  assign_epsg                Assign a (new) EPSG.  compress                   Compress a CityJSON file, ie stores its...  decompress                 Decompress a CityJSON file, ie remove the...  export                     Export the CityJSON to another format.  extract_lod                Extract only one LoD for a dataset.  info                       Output info in simple JSON.  locate_textures            Output the location of the texture files.  merge                      Merge the current CityJSON with others.  remove_duplicate_vertices  Remove duplicate vertices a CityJSON file.  remove_materials           Remove all materials from a CityJSON file.  remove_orphan_vertices     Remove orphan vertices a CityJSON file.  remove_textures            Remove all textures from a CityJSON file.  reproject                  Reproject the CityJSON to a new EPSG.  save                       Save the city model to a CityJSON file.  subset                     Create a subset of a CityJSON file.  update_bbox                Update the bbox of a CityJSON file.  update_textures            Update the location of the texture files.  upgrade_version            Upgrade the CityJSON to the latest version.  validate                   Validate the CityJSON file: (1) against its...

运营商管道

打开的三维城市模型通过所有操作员传递,并由一些操作员进行修改。 像infovalidate这样的操作符在控制台中输出信息,并将3d城市模型传递给下一个操作符。

$ cjio example.json subset --id house12 info remove_materials info save out.json
$ cjio example.json remove_textures compress info
$ cjio example.json upgrade_version save new.json
$ cjio myfile.json merge '/home/elvis/temp/*.json' save all_merged.json

根据架构验证cityjson文件

根据schemas of CityJSON验证cityjson文件(这将自动获取cityjson版本的模式):

$ cjio myfile.json validate

如果文件太大(因此验证速度很慢),可以选择裁剪一个子集并验证它:

$ cjio myfile.json subset --random 2 validate

如果要使用自己的模式,请给出主模式文件cityjson.json所在的文件夹:

$ cjio example.json validate --folder_schemas /home/elvis/temp/myschemas/

示例cityjson数据集

有几个example files on the CityJSON webpage

或者,任何CityGML文件都可以通过开源项目citygml-tools(基于citygml4j)自动转换为cityjson。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何使用java向dropup html/css添加项目   如何从java中的向量向量打印   Java Maven库项目模板   java使用atmosphere api还是直接使用grizzly?   java JComponent仅部分显示   如何将动态值传递给自定义注释,以从Java数据进行映射。性质   java破解已实现方法的返回类型的最佳方法?   java Netbeans在JFrame Gui布局中覆盖图像   spring java仅向登录用户显示注销按钮   java如何对com进行身份验证。谷歌。云bigquery。带有服务帐户的BigQuery`   java禁止空字符串参数和抛出RuntimeException以阻止方法继续的利弊   java分析项目中的所有JAR以获取版本和许可证信息   Java,数据库为什么要分配一个新对象,而我们可以直接将它放入数据库