0

I have compiled MapServer 8.0.0 and works well, except it will not generate an MVT tile, instead, it returns this message loadOutputFormat(): General error message. OUTPUTFORMAT (mvt) clause references driver (mvt), but this driver isn't configured.

I used the following to compile

cmake -DCMAKE_INSTALL_PREFIX=/opt \
    -DCMAKE_PREFIX_PATH=/usr/local:/opt \
    -DWITH_CLIENT_WFS=ON \
    -DWITH_CLIENT_WMS=ON \
    -DWITH_CURL=ON \
    -DWITH_SOS=ON \
    -DWITH_PHP=ON \
    -DWITH_JAVA=OFF \
    -DWITH_PERL=ON \
    -DWITH_CSHARP=OFF \
    -DWITH_PYTHON=ON \
    -DWITH_RUBY=OFF \
    -DWITH_EXEMPI=ON \
    -DWITH_KML=ON \
    -DWITH_POSTGIS=ON \
    -DWITH_RSVG=ON \
    -DWITH_SVGCAIRO=0 \
    -DWITH_LIBXML2=ON \
    -DWITH_PROTOBUFC=0 \
    ../ >../configure.out.txt

My Mapserv -v is here

MapServer version 8.0.0 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=XMP SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF

I have a MapServer 7.4.3 that does create MVT, and the only real difference I can see is that the other has SUPPORTS=PBF. (but I am not sure how to compile with PBF to test that theory).

How do I compile Mapserver 8 to support MVT tile generation?


I am using Ubuntu

I needed these two packages (libprotobuf-c-dev) being the one I was missing

sudo apt install protobuf-c-compiler libprotobuf-c-dev

Then it compiled like a dream with the

-DWITH_PROTOBUFC=ON

1

1 Answer 1

3

You didn't mention what operating system you are referring to, but that is ok. If you are on Ubuntu you will need to install the protobuf-c library with a command such as sudo apt-get install protobuf-c-compiler

Then, you can enable MVT support during your CMake command for MapServer, through the switch -DWITH_PROTOBUFC=1

Finally, you can verify that MVT support is included by executing mapserv -v and looking for SUPPORTS=PBF in the response, such as:

MapServer version 8.1.0-dev (MS4W 5.0.0-dev) OUTPUT=PNG OUTPUT=JPEG 
OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE 
SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=SVGCAIRO SUPPORTS=ICONV 
SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT 
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER 
SUPPORTS=SOS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=FASTCGI 
SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS 
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF

On Windows it is much more difficult, but good news is that I do compile MVT support into MS4W, for Windows users, to make it easy for all to use out-of-the-box : https://ms4w.com

3
  • gisinternals MapServer also supports MVT
    – nmtoken
    Nov 1, 2022 at 13:31
  • Thanks -- this is helpful and seems to be on the right course. I must be doing something dumb. Ohh yes sorry I am on Ubuntu 20.04.5 LTS I have installed protobuf-c-compiler, so when I run protoc-c --version I get protobuf-c 1.3.3 libprotoc 3.6.1 So it seems to be installed but can't be found on compile I get this error CMake Error at CMakeLists.txt:92 (message): PROTOBUFC library/component/dependency could not be found. I added -DCMAKE_PREFIX_PATH=/usr/bin/:/usr/local:/opt but same error.
    – Matt
    Nov 1, 2022 at 22:52
  • Worked it out -- thanks for your help. Needed both these two packages sudo apt install protobuf-c-compiler libprotobuf-c-dev
    – Matt
    Nov 2, 2022 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.