[mapserver-users] Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

Jeff McKenna jmckenna at gatewaygeomatics.com
Thu Oct 15 05:41:14 PDT 2020


Hi Bruno,

What happens if you call that mapfile at the commandline with shp2img 
(and pass the "i" switch with your format name)?  such as:

   shp2img -m mymap.map -o ttt.png -i kml -all_debug 5

You can also then try png output:

   shp2img -m mymap.map -o ttt.png -i png -all_debug 5

Does it generate a valid map image?




-jeff



-- 
Jeff McKenna
MapServer Consulting and Training Services
co-founder of FOSS4G
http://gatewaygeo.com/



On 2020-10-15 9:14 a.m., Bruno Domenget wrote:
> Hi all !
> 
> On a brand new debian server with Mapserver 7.6.1 / SWIG PHP Mapscript 
> (+ GDal 3.13 and Proj 7.1.1) I am encountering a strange issue with KML 
> output format. The code and mapfiles I am using were working perfectly 
> on an old Mapserver 6.4 / PHP mapscript installation, I just converted 
> the PHP functions to the SWIG interface.
> 
> 
> On a simple map file and PHP script the map shows fine, but when I 
> select KML as outputformat ( $map->selectOutputFormat('kml'); ) I get 
> the following error : *Fatal error: Uncaught Exception: msDrawMap(): 
> Image handling error. Failed to draw layer named 'Points'. in 
> /home/mapserver/public_html/lib/mapscript.php:2637*
> 
> /Stack trace: #0 /home/mapserver/public_html/lib/mapscript.php(2637): 
> mapobj_draw() #1 
> /home/mapserver/public_html/test/test_points_export.php(15): 
> mapObj->draw() #2 {main} thrown in 
> /home/mapserver/public_html/lib/mapscript.php on line 2637/
> 
> There is no detail in the logs concerning that error, and I haven’t 
> found any suitable solution. *It works if I remove the LABEL entry from 
> the layer class, but then there is no label…*
> 
> I tried with several PHP versions (7.1, 7.3, 7.4) and it always gave me 
> the same result. Everything else works perfectly, I have no issue with 
> Shapefile or Mapinfo output.
> 
> Does anybody know what is going on ?
> 
> Here is an example of mapfile that causes this issue :
> 
> https://pastebin.com/LFxZ1L9T
> 
> And the PHP code :
> 
> https://pastebin.com/Tp30bzf3
> 
> Thanks,
> 
> Bruno
> 





More information about the MapServer-users mailing list