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根据选择随机设置图标   java如何将Android Studio与本地服务器数据库SQL server 2008连接?   java在点击鼠标后绘制一个椭圆形   java选项窗格相对于其父项的位置   java如何在Android中的switch case中使用String[]输入?   安卓无法从“15.0.1”确定java版本   如果满足特定条件,java是否重置计时器?   java是一个实体类,可以在OOAD中返回其他实体实例吗?   bash将对jar文件| cut | awk和java程序的调用集成到一个统一进程中   Spring安全更新身份验证成功时的最后登录日期   数据库身份验证中基于Java控制台的客户端服务器登录应用程序错误   java Selenium junit测试失败,驱动程序过早获取URL   java LibGdx多点触摸事件混淆   带扫描仪的java打印空间   来自旧版应用程序的java springcloudsleuth头   java如何实现模板设计模式?   java如何比较具有多个值的键的两个映射?   读取时R中的java MemoryError。xlsx