我正在使用 geotrellis vectorpipe 编写 MapBox 矢量图块。
有关基本流程,请参见此处:https ://geotrellis.github.io/vectorpipe/usage.html
通常 GeoJson Features 可以有一个id字段,以便可以将 Features 汇总到 FeatureCollections 中。我需要使用这个字段,但是vectorpipe(本机)没有这个功能。
这是使用的Feature类型,您可以看到它只有 1) aGeometry和 2) 数据对象D(最终填充properties到输出中)的空间。没有位置id。
https://geotrellis.github.io/scaladocs/latest/index.html#geotrellis.vector.Feature
上游有一个名为的方法writeFeatureJsonWithID(),它可以让您在编写 GeoJson 时将id字段注入到 a中。Feature
我的问题是这样的:
我已经完成了vectorpipe代码(https://github.com/geotrellis/vectorpipe),我无法确定数据是否/在哪里以GeoJson的形式存在,我可以覆盖和注入id,也许使用我明确写的writeFeatureJsonWithID()或东西。许多转换是隐式的,但它也可能永远不会显式地以 json 格式存在。
关于如何id将最终 GeoJson 中的字段写入矢量图块的任何想法?
编辑
现在我认为诀窍是找到一种方法来覆盖.unfeature()这里的方法:
问题是它internal.vector_tile.Tile是私有的,所以我可以在不分叉项目的情况下构建它。