使用 esy-osmfilter 获取所有方法

get all ways by using esy-osmfilter

我有一个 pbf 文件,用

`osmconvert64 --drop-relations "{}" -B="{}" -o="{}"'.\
                        format(input_osm, poly_file, output_osm)`

但是我不知道如何从这个文件中只检索路径。 我尝试过使用 esy-osmfilter,但是我无法想象要在 Elements 标签中放入什么

PBF_inputfile = output_osm
JSON_outputfile = "{}\{}.geojson".format(user_input.output, city)
prefilter = {Node: {}, Way: {"highway": ["motorway", "motorway_link", "trunk", "trunk_link"], },
                             Relation: {}}
whitefilter = []
blackfilter = []
[Data, _] = run_filter('highway', PBF_inputfile, JSON_outputfile, prefilter, whitefilter,
                                       blackfilter, NewPreFilterData=True, CreateElements=False,
                                       LoadElements=False,verbose=True)
[_, Elements] = run_filter('all_ways', PBF_inputfile, JSON_outputfile, prefilter, whitefilter,
                                           blackfilter, NewPreFilterData=False, CreateElements=True,
                                           LoadElements=False, verbose=True)

export_geojson(Elements['all_ways']['Way'], Data,
                               filename=JSON_outputfile, jsontype='Line')

我收到一个错误:

ERROR:esy.osmfilter.osm_filter:Warning2: whitefilter is not a list of list of tuples

我可能需要设置whitefilter和blackfilter,但我不知道如何使用它们。我无法从示例中理解 here

只需关注 dokumentation 比这样的事情更神奇:

[(("高速公路","高速公路"),), (("高速公路","motorway_link"),), . . ]