Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

Bruno Domenget

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


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

jmckenna
Administrator
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
>


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

jmckenna
Administrator
oops here is the correct command for kml output:

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

(does that generate a valid KML file?)


-jeff



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


On 2020-10-15 9:41 a.m., Jeff McKenna wrote:

> 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
>
>
>

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

Bruno Domenget
Hi Jeff,

Thanks for your quick answer !

So I tried with shp2img but got the same error with KML output...
msDrawMap(): Image handling error. Failed to draw layer named 'points'. <br>
GDAL: In GDALDestroy - unloading GDAL shared library.


Logfile :
[Thu Oct 15 15:36:02 2020].174254 msLoadMap(): 0.005s
[Thu Oct 15 15:36:02 2020].174344 msDrawMap(): rendering using outputformat named kml (KML).
[Thu Oct 15 15:36:02 2020].174348 msDrawMap(): WMS/WFS set-up and query, 0.000s
[Thu Oct 15 15:36:02 2020].174369 msINLINELayerOpen: Layer is already open!
[Thu Oct 15 15:36:02 2020].174564 msSaveImage(/home/mapserver/public_html/test/././5f885042_26ab_0.png) total time: 0.000s
[Thu Oct 15 15:36:02 2020].174629 msDrawMap(): Image handling error. Failed to draw layer named 'points'.
[Thu Oct 15 15:36:02 2020].174649 msFreeMap(): freeing map at 0x559913f1af60.
[Thu Oct 15 15:36:02 2020].174698 freeLayer(): freeing layer at 0x559914207ad0.

It works perfectly with PNG output, and with KML output if I remove the LABEL lines from my mapfile.

So it is not a Mapscript issue, there is definitely an issue with my Mapserver instance...

Bruno



Le jeu. 15 oct. 2020 à 08:42, Jeff McKenna <[hidden email]> a écrit :
oops here is the correct command for kml output:

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

(does that generate a valid KML file?)


-jeff



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


On 2020-10-15 9:41 a.m., Jeff McKenna wrote:
> 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
>
>
>

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

jmckenna
Administrator
Hi Bruno,

Next test is to test that your local GDAL was built with KML support:

   ogrinfo --formats

(you should see a 'LIBKML' or 'KML' driver listed there, either one can
be used for this)

-jeff



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


On 2020-10-15 10:48 a.m., Bruno Domenget wrote:

> Hi Jeff,
>
> Thanks for your quick answer !
>
> So I tried with shp2img but got the same error with KML output...
> *msDrawMap(): Image handling error. Failed to draw layer named 'points'.
> <br>
> GDAL: In GDALDestroy - unloading GDAL shared library.*
>
> Logfile :
> [Thu Oct 15 15:36:02 2020].174254 msLoadMap(): 0.005s
> [Thu Oct 15 15:36:02 2020].174344 msDrawMap(): rendering using
> outputformat named kml (KML).
> [Thu Oct 15 15:36:02 2020].174348 msDrawMap(): WMS/WFS set-up and query,
> 0.000s
> [Thu Oct 15 15:36:02 2020].174369 msINLINELayerOpen: Layer is already open!
> [Thu Oct 15 15:36:02 2020].174564
> msSaveImage(/home/mapserver/public_html/test/././5f885042_26ab_0.png)
> total time: 0.000s
> [Thu Oct 15 15:36:02 2020].174629 msDrawMap(): Image handling error.
> Failed to draw layer named 'points'.
> [Thu Oct 15 15:36:02 2020].174649 msFreeMap(): freeing map at
> 0x559913f1af60.
> [Thu Oct 15 15:36:02 2020].174698 freeLayer(): freeing layer at
> 0x559914207ad0.
>
> It works perfectly with PNG output, and with KML output if I remove the
> LABEL lines from my mapfile.
>
> So it is not a Mapscript issue, there is definitely an issue with my
> Mapserver instance...
>
> Bruno
>
>
>
> Le jeu. 15 oct. 2020 à 08:42, Jeff McKenna
> <[hidden email] <mailto:[hidden email]>> a
> écrit :
>
>     oops here is the correct command for kml output:
>
>         shp2img -m mymap.map -o ttt.kml -i kml -all_debug 5
>
>     (does that generate a valid KML file?)
>
>
>     -jeff
>
>
>
>     --
>     Jeff McKenna
>     MapServer Consulting and Training Services
>     co-founder of FOSS4G
>     http://gatewaygeo.com/
>
>
>     On 2020-10-15 9:41 a.m., Jeff McKenna wrote:
>      > 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
>      >
>      >
>      >
>
>     _______________________________________________
>     mapserver-users mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

Bruno Domenget
Sorry I should have said at first that I already checked that. I have both KML and LIBKML drivers listed.

And KML output works if I remove the LABEL entry from my mapfile...

Le jeu. 15 oct. 2020 à 09:52, Jeff McKenna <[hidden email]> a écrit :
Hi Bruno,

Next test is to test that your local GDAL was built with KML support:

   ogrinfo --formats

(you should see a 'LIBKML' or 'KML' driver listed there, either one can
be used for this)

-jeff



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


On 2020-10-15 10:48 a.m., Bruno Domenget wrote:
> Hi Jeff,
>
> Thanks for your quick answer !
>
> So I tried with shp2img but got the same error with KML output...
> *msDrawMap(): Image handling error. Failed to draw layer named 'points'.
> <br>
> GDAL: In GDALDestroy - unloading GDAL shared library.*
>
> Logfile :
> [Thu Oct 15 15:36:02 2020].174254 msLoadMap(): 0.005s
> [Thu Oct 15 15:36:02 2020].174344 msDrawMap(): rendering using
> outputformat named kml (KML).
> [Thu Oct 15 15:36:02 2020].174348 msDrawMap(): WMS/WFS set-up and query,
> 0.000s
> [Thu Oct 15 15:36:02 2020].174369 msINLINELayerOpen: Layer is already open!
> [Thu Oct 15 15:36:02 2020].174564
> msSaveImage(/home/mapserver/public_html/test/././5f885042_26ab_0.png)
> total time: 0.000s
> [Thu Oct 15 15:36:02 2020].174629 msDrawMap(): Image handling error.
> Failed to draw layer named 'points'.
> [Thu Oct 15 15:36:02 2020].174649 msFreeMap(): freeing map at
> 0x559913f1af60.
> [Thu Oct 15 15:36:02 2020].174698 freeLayer(): freeing layer at
> 0x559914207ad0.
>
> It works perfectly with PNG output, and with KML output if I remove the
> LABEL lines from my mapfile.
>
> So it is not a Mapscript issue, there is definitely an issue with my
> Mapserver instance...
>
> Bruno
>
>
>
> Le jeu. 15 oct. 2020 à 08:42, Jeff McKenna
> <[hidden email] <mailto:[hidden email]>> a
> écrit :
>
>     oops here is the correct command for kml output:
>
>         shp2img -m mymap.map -o ttt.kml -i kml -all_debug 5
>
>     (does that generate a valid KML file?)
>
>
>     -jeff
>
>
>
>     --
>     Jeff McKenna
>     MapServer Consulting and Training Services
>     co-founder of FOSS4G
>     http://gatewaygeo.com/
>
>
>     On 2020-10-15 9:41 a.m., Jeff McKenna wrote:
>      > 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
>      >
>      >
>      >
>
>     _______________________________________________
>     mapserver-users mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

jmckenna
Administrator
Hi Bruno,

I can trigger this problem with any mapfile that uses an inline FEATURE,
a label, and KML output (only with those 3 combinations enabled, as it
works with other outputformats as SVG).  I don't think it has anything
to do with your settings, as I can trigger that here on Windows/MS4W as
well.

Sorry for the bad news.

-jeff




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



On 2020-10-15 10:58 a.m., Bruno Domenget wrote:

> Sorry I should have said at first that I already checked that. I have
> both KML and LIBKML drivers listed.
>
> And KML output works if I remove the LABEL entry from my mapfile...
>
> Le jeu. 15 oct. 2020 à 09:52, Jeff McKenna
> <[hidden email] <mailto:[hidden email]>> a
> écrit :
>
>     Hi Bruno,
>
>     Next test is to test that your local GDAL was built with KML support:
>
>         ogrinfo --formats
>
>     (you should see a 'LIBKML' or 'KML' driver listed there, either one can
>     be used for this)
>
>     -jeff
>
>
>
>     --
>     Jeff McKenna
>     MapServer Consulting and Training Services
>     co-founder of FOSS4G
>     http://gatewaygeo.com/
>
>
>     On 2020-10-15 10:48 a.m., Bruno Domenget wrote:
>      > Hi Jeff,
>      >
>      > Thanks for your quick answer !
>      >
>      > So I tried with shp2img but got the same error with KML output...
>      > *msDrawMap(): Image handling error. Failed to draw layer named
>     'points'.
>      > <br>
>      > GDAL: In GDALDestroy - unloading GDAL shared library.*
>      >
>      > Logfile :
>      > [Thu Oct 15 15:36:02 2020].174254 msLoadMap(): 0.005s
>      > [Thu Oct 15 15:36:02 2020].174344 msDrawMap(): rendering using
>      > outputformat named kml (KML).
>      > [Thu Oct 15 15:36:02 2020].174348 msDrawMap(): WMS/WFS set-up and
>     query,
>      > 0.000s
>      > [Thu Oct 15 15:36:02 2020].174369 msINLINELayerOpen: Layer is
>     already open!
>      > [Thu Oct 15 15:36:02 2020].174564
>      >
>     msSaveImage(/home/mapserver/public_html/test/././5f885042_26ab_0.png)
>      > total time: 0.000s
>      > [Thu Oct 15 15:36:02 2020].174629 msDrawMap(): Image handling error.
>      > Failed to draw layer named 'points'.
>      > [Thu Oct 15 15:36:02 2020].174649 msFreeMap(): freeing map at
>      > 0x559913f1af60.
>      > [Thu Oct 15 15:36:02 2020].174698 freeLayer(): freeing layer at
>      > 0x559914207ad0.
>      >
>      > It works perfectly with PNG output, and with KML output if I
>     remove the
>      > LABEL lines from my mapfile.
>      >
>      > So it is not a Mapscript issue, there is definitely an issue with my
>      > Mapserver instance...
>      >
>      > Bruno
>      >
>      >
>      >
>      > Le jeu. 15 oct. 2020 à 08:42, Jeff McKenna
>      > <[hidden email]
>     <mailto:[hidden email]>
>     <mailto:[hidden email]
>     <mailto:[hidden email]>>> a
>      > écrit :
>      >
>      >     oops here is the correct command for kml output:
>      >
>      >         shp2img -m mymap.map -o ttt.kml -i kml -all_debug 5
>      >
>      >     (does that generate a valid KML file?)
>      >
>      >
>      >     -jeff
>      >
>      >
>      >
>      >     --
>      >     Jeff McKenna
>      >     MapServer Consulting and Training Services
>      >     co-founder of FOSS4G
>      > http://gatewaygeo.com/
>      >
>      >
>      >     On 2020-10-15 9:41 a.m., Jeff McKenna wrote:
>      >      > 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
>      >      >
>      >      >
>      >      >
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

jmckenna
Administrator
In reply to this post by Bruno Domenget
Bruno: since you get all the credit for this research, can you please
file this as a ticket at : https://github.com/MapServer/MapServer/issues 
  (include your mapfile and commands, nothing about mapscript).  I
believe this is something to do with how inline features are handled,
for labels, in KML output.  (maybe related to the message
"msINLINELayerOpen: Layer is already open!" that MapServer is yelling at
us, ha)

Thanks and hello from the east coast of Canada,

-jeff


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





On 2020-10-15 10:58 a.m., Bruno Domenget wrote:

> Sorry I should have said at first that I already checked that. I have
> both KML and LIBKML drivers listed.
>
> And KML output works if I remove the LABEL entry from my mapfile...
>
> Le jeu. 15 oct. 2020 à 09:52, Jeff McKenna
> <[hidden email] <mailto:[hidden email]>> a
> écrit :
>
>     Hi Bruno,
>
>     Next test is to test that your local GDAL was built with KML support:
>
>         ogrinfo --formats
>
>     (you should see a 'LIBKML' or 'KML' driver listed there, either one can
>     be used for this)
>
>     -jeff
>
>
>
>     --
>     Jeff McKenna
>     MapServer Consulting and Training Services
>     co-founder of FOSS4G
>     http://gatewaygeo.com/
>
>
>     On 2020-10-15 10:48 a.m., Bruno Domenget wrote:
>      > Hi Jeff,
>      >
>      > Thanks for your quick answer !
>      >
>      > So I tried with shp2img but got the same error with KML output...
>      > *msDrawMap(): Image handling error. Failed to draw layer named
>     'points'.
>      > <br>
>      > GDAL: In GDALDestroy - unloading GDAL shared library.*
>      >
>      > Logfile :
>      > [Thu Oct 15 15:36:02 2020].174254 msLoadMap(): 0.005s
>      > [Thu Oct 15 15:36:02 2020].174344 msDrawMap(): rendering using
>      > outputformat named kml (KML).
>      > [Thu Oct 15 15:36:02 2020].174348 msDrawMap(): WMS/WFS set-up and
>     query,
>      > 0.000s
>      > [Thu Oct 15 15:36:02 2020].174369 msINLINELayerOpen: Layer is
>     already open!
>      > [Thu Oct 15 15:36:02 2020].174564
>      >
>     msSaveImage(/home/mapserver/public_html/test/././5f885042_26ab_0.png)
>      > total time: 0.000s
>      > [Thu Oct 15 15:36:02 2020].174629 msDrawMap(): Image handling error.
>      > Failed to draw layer named 'points'.
>      > [Thu Oct 15 15:36:02 2020].174649 msFreeMap(): freeing map at
>      > 0x559913f1af60.
>      > [Thu Oct 15 15:36:02 2020].174698 freeLayer(): freeing layer at
>      > 0x559914207ad0.
>      >
>      > It works perfectly with PNG output, and with KML output if I
>     remove the
>      > LABEL lines from my mapfile.
>      >
>      > So it is not a Mapscript issue, there is definitely an issue with my
>      > Mapserver instance...
>      >
>      > Bruno
>      >
>      >
>      >
>      > Le jeu. 15 oct. 2020 à 08:42, Jeff McKenna
>      > <[hidden email]
>     <mailto:[hidden email]>
>     <mailto:[hidden email]
>     <mailto:[hidden email]>>> a
>      > écrit :
>      >
>      >     oops here is the correct command for kml output:
>      >
>      >         shp2img -m mymap.map -o ttt.kml -i kml -all_debug 5
>      >
>      >     (does that generate a valid KML file?)
>      >
>      >
>      >     -jeff
>      >
>      >
>      >
>      >     --
>      >     Jeff McKenna
>      >     MapServer Consulting and Training Services
>      >     co-founder of FOSS4G
>      > http://gatewaygeo.com/
>      >
>      >
>      >     On 2020-10-15 9:41 a.m., Jeff McKenna wrote:
>      >      > 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
>      >      >
>      >      >
>      >      >
>      >
>      >     _______________________________________________
>      >     mapserver-users mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>     <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>      >
>      >
>      > _______________________________________________
>      > mapserver-users mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>      >
>
>     _______________________________________________
>     mapserver-users mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

Bruno Domenget
Hi Jeff,

Thanks for taking the time to investigate that !

That is what I feared, but it is not such a big deal as we can still use csv export and write our own KML creation function.

It would have been much worse if the issue had been about Shapefile export.

I will create the ticket as soon as possible.

Thanks and hello from Quebec !

Bruno

Le jeu. 15 oct. 2020 à 12:01, Jeff McKenna <[hidden email]> a écrit :
Bruno: since you get all the credit for this research, can you please
file this as a ticket at : https://github.com/MapServer/MapServer/issues
  (include your mapfile and commands, nothing about mapscript).  I
believe this is something to do with how inline features are handled,
for labels, in KML output.  (maybe related to the message
"msINLINELayerOpen: Layer is already open!" that MapServer is yelling at
us, ha)

Thanks and hello from the east coast of Canada,

-jeff


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





On 2020-10-15 10:58 a.m., Bruno Domenget wrote:
> Sorry I should have said at first that I already checked that. I have
> both KML and LIBKML drivers listed.
>
> And KML output works if I remove the LABEL entry from my mapfile...
>
> Le jeu. 15 oct. 2020 à 09:52, Jeff McKenna
> <[hidden email] <mailto:[hidden email]>> a
> écrit :
>
>     Hi Bruno,
>
>     Next test is to test that your local GDAL was built with KML support:
>
>         ogrinfo --formats
>
>     (you should see a 'LIBKML' or 'KML' driver listed there, either one can
>     be used for this)
>
>     -jeff
>
>
>
>     --
>     Jeff McKenna
>     MapServer Consulting and Training Services
>     co-founder of FOSS4G
>     http://gatewaygeo.com/
>
>
>     On 2020-10-15 10:48 a.m., Bruno Domenget wrote:
>      > Hi Jeff,
>      >
>      > Thanks for your quick answer !
>      >
>      > So I tried with shp2img but got the same error with KML output...
>      > *msDrawMap(): Image handling error. Failed to draw layer named
>     'points'.
>      > <br>
>      > GDAL: In GDALDestroy - unloading GDAL shared library.*
>      >
>      > Logfile :
>      > [Thu Oct 15 15:36:02 2020].174254 msLoadMap(): 0.005s
>      > [Thu Oct 15 15:36:02 2020].174344 msDrawMap(): rendering using
>      > outputformat named kml (KML).
>      > [Thu Oct 15 15:36:02 2020].174348 msDrawMap(): WMS/WFS set-up and
>     query,
>      > 0.000s
>      > [Thu Oct 15 15:36:02 2020].174369 msINLINELayerOpen: Layer is
>     already open!
>      > [Thu Oct 15 15:36:02 2020].174564
>      >
>     msSaveImage(/home/mapserver/public_html/test/././5f885042_26ab_0.png)
>      > total time: 0.000s
>      > [Thu Oct 15 15:36:02 2020].174629 msDrawMap(): Image handling error.
>      > Failed to draw layer named 'points'.
>      > [Thu Oct 15 15:36:02 2020].174649 msFreeMap(): freeing map at
>      > 0x559913f1af60.
>      > [Thu Oct 15 15:36:02 2020].174698 freeLayer(): freeing layer at
>      > 0x559914207ad0.
>      >
>      > It works perfectly with PNG output, and with KML output if I
>     remove the
>      > LABEL lines from my mapfile.
>      >
>      > So it is not a Mapscript issue, there is definitely an issue with my
>      > Mapserver instance...
>      >
>      > Bruno
>      >
>      >
>      >
>      > Le jeu. 15 oct. 2020 à 08:42, Jeff McKenna
>      > <[hidden email]
>     <mailto:[hidden email]>
>     <mailto:[hidden email]
>     <mailto:[hidden email]>>> a
>      > écrit :
>      >
>      >     oops here is the correct command for kml output:
>      >
>      >         shp2img -m mymap.map -o ttt.kml -i kml -all_debug 5
>      >
>      >     (does that generate a valid KML file?)
>      >
>      >
>      >     -jeff
>      >
>      >
>      >
>      >     --
>      >     Jeff McKenna
>      >     MapServer Consulting and Training Services
>      >     co-founder of FOSS4G
>      > http://gatewaygeo.com/
>      >
>      >
>      >     On 2020-10-15 9:41 a.m., Jeff McKenna wrote:
>      >      > 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
>      >      >
>      >      >
>      >      >
>      >
>      >     _______________________________________________
>      >     mapserver-users mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>     <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>      >
>      >
>      > _______________________________________________
>      > mapserver-users mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>      >
>
>     _______________________________________________
>     mapserver-users mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Mapserver 7.6.1 - PHP 7 Swig - Kml output issue

Bruno Domenget
In reply to this post by jmckenna
Hi Jeff,

Thanks for taking the time to investigate that !

That is what I feared, but it is not such a big deal as we can still use csv export and write our own KML creation function.

It would have been much worse if the issue had been about Shapefile export.

I will create the ticket as soon as possible.

Thanks and hello from Quebec !

Bruno

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users