【问题标题】:Postgis ST_AsMVT() return missing libprotobuf-c on MacOSX High SierraPostgis ST_AsMVT() 在 MacOSX High Sierra 上返回缺少的 libprotobuf-c
【发布时间】:2018-07-15 17:47:32
【问题描述】:

我尝试使用此查询从我的几何表中获取 MVT 格式

SELECT ST_AsMVT(q)
FROM (
        SELECT
                id_kelurahan,
                nama_kelurahan,
                ST_AsMVTGeom(
                        feature,
                        TileBBox(11, 1150, 1724, 3857),
                        4096,
                        0,
                        false
                ) geom
        FROM kelurahan
        WHERE ST_Intersects(feature, (SELECT ST_Transform(ST_MakeEnvelope(22.1484375, -76.72022329036133, 22.32421875, -76.6797849031069, 4326), 3857)))
) q

如您所见,我使用 Postgis 扩展函数 ST_AsMVT() 将我的内部查询结果转换为 MVT,但它没有得到预期的结果 (MVT),而是生成了缺少的 libprotobuf-c 错误。 我使用的是 MacOSX High Sierra 10.13.1,Postgis 版本 2.4.0。

我已经研究了错误并尝试了一些解决方案

brew install protobuf
brew install protobuf-c

这两个过程都成功结束,没有错误。已经重启了我的设备,但missing libprotobuf-c 错误仍然发生。

【问题讨论】:

  • 尝试安装libprotobuf-c-dev

标签: postgresql geospatial postgis protobuf-c vector-tiles


【解决方案1】:

尝试使用以下命令安装 postgis:

brew install postgis --with-protobuf-c

我上次遇到过这个问题,现在在 mac high sierra 上解决了这个问题。

【讨论】:

  • 您能解释一下为什么这是解决问题的方法吗?也许postgis 是必需的,而 OP 可能没有意识到这一点?等等等等。
  • PostGIS 确保您在使用ST_AsMVT() 函数时首先安装了它,并且它需要检查您是否安装了protobuf-c 及其版本。
  • 我在我的机器上卸载了 postgis 扩展和 postgresql 并使用此命令重新运行 postgis 安装,重新启动我的设备并且它可以工作。感谢您的回复。
  • 你不能只安装 protobuf-c,postgis 需要在编译时使用该支持进行编译
  • Brew 已从其公式中删除选项github.com/Homebrew/homebrew-core/pull/36286/files 此解决方案不再有效
【解决方案2】:

尝试重新安装 postgis:

brew reinstall postgis --with-protobuf-c

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-08
    • 2018-05-09
    • 2018-12-05
    • 2018-04-03
    相关资源
    最近更新 更多