2

I try to get MVT format from my geometry table with this query

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

As you can see I using Postgis extension function ST_AsMVT() to convert my inner query result to MVT but instead of getting the expected result (MVT) it genereate the missing libprotobuf-c error. I'm on MacOSX High Sierra 10.13.1, Postgis version 2.4.0.

I already research the error and try some of it solutions

brew install protobuf
brew install protobuf-c

both of the process ends succesfully with no error. already restart my device but the missing libprotobuf-c error still occured.

Casey West
  • 578
  • 5
  • 22
Edgar P.
  • 129
  • 1
  • 1
  • 7

2 Answers2

2

Try to install postgis with this command:

brew install postgis --with-protobuf-c

I've encountered this problem last time and this fixed it on mac high sierra.

Luq
  • 36
  • 1
  • 5
  • Can you explain why this is a solution to the issue? Maybe `postgis` is required for something and OP may not realize it? etc. etc. – twedl Feb 08 '18 at 12:48
  • PostGIS makes sure that you first have it installed when using the `ST_AsMVT()` function and it needs to check that you have installed protobuf-c and its version. – Dr G. Feb 08 '18 at 22:43
  • I uninstall both postgis extension and postgresql on my machine and re-run the postgis installation using this command, reboot my device and it works. thank you for your response. – Edgar P. Feb 09 '18 at 14:38
  • You can't just install protobuf-c, postgis needs to be compiled with that support available at compile time – chrismarx Mar 10 '18 at 14:09
  • Brew has removed options from its formulae https://github.com/Homebrew/homebrew-core/pull/36286/files This solution is no longer valid – Hugoren Martinako Jan 28 '19 at 15:43
1

Try reinstall postgis:

brew reinstall postgis --with-protobuf-c
js.bai
  • 11
  • 1