[MapServer-users] MVT Unable to initialize image

Jeff McKenna jmckenna at gatewaygeomatics.com
Fri Jul 25 09:42:09 PDT 2025


Hi Mathias,

What happens if you try in your request: &TILE=0+0+0 (and remove the 
&map.imagetype part) ?

(that's what I did while documenting steps for the page 
https://mapserver.org/output/tile_mode.html )

Recent MS4W versions also include an MVT demo as well as a local.map 
test file, so you could:


- first try in your browser 
http://127.0.0.1/cgi-bin/mapserv.exe?MAP=/ms4w/apps/local-demo/local.map&MODE=tile&TILEMODE=gmap&TILE=0+0+0&LAYERS=countries 
  (you should see a map image of the world countries in your browser)

- then add your OUTPUTFORMAT for MVT into local.map, and then try:

http://127.0.0.1/cgi-bin/mapserv.exe?MAP=/ms4w/apps/local-demo/local.map&MODE=tile&TILEMODE=gmap&TILE=0+0+0&LAYERS=countries&map.imagetype=mvt

If that fails, you might have to upgrade your MS4W version.

But if that works, I would then paste your "prescription" layer into 
local.map, and reload that same request in your browser.

thanks,

(and thanks for using MS4W)

-jeff



-- 
Jeff McKenna
GatewayGeo: Developers of MS4W, & offering MapServer Consulting/Dev
co-founder of FOSS4G
http://gatewaygeo.com/


On 2025-07-25 9:11 a.m., mathias cunault via MapServer-users wrote:
> Mapserver 7.6
> I try to create MapBox vectorTile to use with Openlayers.
> Here is my mapfile :
> MAP
> NAME " WFS Prescription"
> 
> SIZE 256 256
> 
> FONTSET "C:\ms4w\Apache\site\fonts\fonts.txt"
> 
> OUTPUTFORMAT
> NAME "mvt"
> DRIVER "MVT"
> MIMETYPE "application/vnd.mapbox-vector-tile"
> EXTENSION "pbf"
>    END
> 
> EXTENT -7029101.058003008 -2435968.9856906775 6204182.853414171 
> 6634638.986072871 #xmin ymin xmax ymax
> 
> UNITS METERS
> DEBUG 5
> CONFIG "CPL_DEBUG" "ON"
> CONFIG "PROJ_DEBUG" "ON"
> CONFIG MS_ERRORFILE "C:/ms4w/Apache/error/ 
> errorMapFile_prescription_pgts.txt"
> 
> SYMBOLSET "C:\ms4w\Apache\site\symbols\symbols.sym"
> 
> PROJECTION # proj de sortie
> "init=epsg:3857"
> END
> 
> WEB
> METADATA
> "wfs_title" "WFS-Inrap, Prescription"
> "wfs_onlineresource" "http://.../mapserv.exe?MAP=C:/ms4w/Apache/site/ 
> mapfile/vue_prescription_pgts_wfs.map&"
> "wfs_srs" "EPSG:3857 EPSG:900913"
> "wfs_enable_request" "*"
> "wfs_abstract" "WFS diffusant la couche prescrition_pgts de Caviar pour 
> l'application Iliad."
> "wms_srs" "EPSG:3857"
> END #fin metadata
> END #end web
> 
> LAYER
> NAME "prescription"
> TYPE POLYGON
> CONNECTIONTYPE POSTGIS
> CONNECTION "host=xxxx dbname=xxx user=xxx password=xxx port=5432"
> DATA "geom from iliad.prescription_pgts as foo using unique gid using 
> SRID=3857"
> PROCESSING "CLOSE_CONNECTION=DEFER"
> #PROCESSING "TILE_DATASET=true"
> METADATA
> "gml_include_items" "all" #obligé pour afficher attributs getfeatureinfo
> "wfs_title" "Inrap Prescription"
> "wfs_srs" "EPSG:3857" car le même que section WEB, inutile.
> "ows_featureid" "gid"
> "wfs_enable_request" "*"
> "wfs_getfeature_formatlist" "geojson, application/json, json"
> "wfs_use_default_extent_for-getfeature" "false"
> END #fin metadata prescription
> TEMPLATE "bidon.html" #obligé pour afficher attributs getfeatureinfo
> END #fin layer prescription
> END
> 
> First, I test with a request like :
> http://.../mapserv.exe?MAP=C:/ms4w/Apache/site/mapfile/ 
> vue_prescription_pgts_wfs.map&mode=tile&tilemode=gmap&tile={12}+{447}+{1988}&layers=prescription&
> All I get is :
> msDrawMap(): Image handling error. Unable to initialize image. 
> msPrepareImage(): Image handling error. Unable to initialize image.
> 
> SUPPORTS=PBF is in mapserv.exe -v
> EXTENT is that of my data.
> I did not find any leads in RFC-119 (but I don't understand all that I 
> read.)
> I have no idea how to solve this problem.
> 
> Cordialement,
> 
> /----------/
> /Mathias Cunault/
> /référent SIG / Admin Caviar
> ///Inrap Tours - /148 av. Maginot
> 37000 TOURS
> 06 32 05 98 96/
> abonn//ez-vous à la lettre d'information de l'Inrap : http://ww <http:// 
> www.inrap.fr/newsletter.php>w.inrap.fr/newsletter.php <http:// 
> www.inrap.fr/newsletter.php>
> 
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list