python - 集成 osmosis 和 python 从 .osm 文件中获取数据
问题描述
我正在尝试使用 python 脚本从 .osm 文件中过滤数据
以下是我为此目的使用的 python 代码。但是创建的 .osm 文件不包含输入文件中的数据。
import subprocess
subprocess.call(['C:/Users/91957/Desktop/osmosis/bin/osmosis.bat','--read-xml','C:/Users/91957/Desktop/osm_test/Sample_input.osm',
'--nkv','keyValueList="amenity.fast_food"','--write-xml','C:/Users/91957/Desktop/osm_test/fast_food.osm'])
但是当在命令行上运行以下命令时,它就像魅力一样。
osmosis --read-xml file=Sample_input.osm --nkv keyValueList="amenity.fast_food" --write-xml file=fast_food.osm
解决方案
推荐阅读
- c - 如何在有 2 个圆圈的矩形中找到空白空间?
- flutter - 重命名文件时VSCode Dart / Flutter不重命名导入
- qt - 在导入之前,我如何知道系统中的哪个 Qt 快速版本?
- sql - 子查询与多表连接
- python - 在字典中查找最新的日期值
- javascript - 更新 angularjs 中的数组或视图未更新后,ng-repeat 未更新
- amazon-web-services - AWS API Gateway :允许从另一个 AWS 账户中的 Lamba 函数访问 API
- regex - 在文件中查找具有特定开头和结尾的字符串,并使用命令替换为另一个字符串
- cesium - 尝试使用 CesiumJS 为实体添加阴影
- apache-spark - 即使任务失败,Airflow BashOperator 也返回退出代码 0 并返回退出代码 1