Hi Yewondwossen,

compilation fails on CentOS (GCC 4.1.2):

g++ -O2 -fPIC -Wall     -DHAVE_VSNPRINTF -DNEED_STRLCAT -DNEED_STRRSTR      
-DUSE_CAIRO     -DUSE_KML    -DUSE_LIBXML2    -DUSE_WMS_SVR    -DUSE_POSTGIS 
-DPOSTGIS_HAS_SERVER_VERSION -DUSE_JPEG     -DUSE_PROJ  -DUSE_AGG      
-DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT 
-DGD_HAS_FTEX_XSHOW -DGD_HAS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS 
-DGD_HAS_GET_TRUE_COLOR_PIXEL -DUSE_ICONV -DUSE_ZLIB     -I/usr/include 
-I/usr/include/freetype2 -Irenderers/agg/include         -I/usr/include         
-I/usr/include/libxml2  -I/usr/include/cairo -I/usr/include/freetype2 
-I/usr/include/libpng12     -c -o mapkmlrenderer.o mapkmlrenderer.cpp
mapkmlrenderer.h: In constructor ‘KmlRenderer::KmlRenderer(int, int, 
colorObj*)’:
mapkmlrenderer.h:60: warning: ‘KmlRenderer::GroundOverlayNode’ will be 
initialized after
mapkmlrenderer.h:50: warning:   ‘int KmlRenderer::Width’
mapkmlrenderer.cpp:38: warning:   when initialized here
mapkmlrenderer.h:93: warning: ‘KmlRenderer::FirstLayer’ will be initialized 
after
mapkmlrenderer.h:88: warning:   ‘outputFormatObj* 
KmlRenderer::RasterizerOutputFormat’
mapkmlrenderer.cpp:38: warning:   when initialized here
mapkmlrenderer.h:103: warning: ‘KmlRenderer::RasterMode’ will be initialized 
after
mapkmlrenderer.h:52: warning:   ‘double KmlRenderer::MapCellsize’
mapkmlrenderer.cpp:38: warning:   when initialized here
mapkmlrenderer.cpp: In member function ‘void 
KmlRenderer::closeNewLayer(imageObj*, layerObj*)’:
mapkmlrenderer.cpp:375: error: invalid conversion from ‘const char*’ to ‘char*’
mapkmlrenderer.cpp:375: error:   initializing argument 2 of ‘char* 
msStringConcatenate(char*, char*)’
mapkmlrenderer.cpp: In member function ‘xmlNode* 
KmlRenderer::createPlacemarkNode(xmlNode*, char*)’:
mapkmlrenderer.cpp:463: warning: format ‘%d’ expects type ‘int’, but argument 3 
has type ‘long int’
make: *** [mapkmlrenderer.o] Error 1


I've "fixed" this (adding simply a cast, I'm not sure that this is the correct 
approach):

--- mapkmlrenderer.cpp  (revision 10149)
+++ mapkmlrenderer.cpp  (working copy)
@@ -372,7 +372,7 @@
             tmpUrl = strdup( img->imageurl);
             tmpUrl = msStringConcatenate(tmpUrl, (char 
*)(msGetBasename(tmpFileName)));
             tmpUrl = msStringConcatenate(tmpUrl, ".");
-            tmpUrl = msStringConcatenate(tmpUrl, 
MS_IMAGE_EXTENSION(RasterizerOutputFormat));
+            tmpUrl = msStringConcatenate(tmpUrl, (char 
*)MS_IMAGE_EXTENSION(RasterizerOutputFormat));
                 
             createGroundOverlayNode(LayerNode, tmpUrl, layer);
             msFree(tmpFileName);

and now KML is in the output list. Running it over a simple test map file KML 
is produced, seems to produce reasonable results.

Regards

Peter
--------Yewondwossen Assefa <yass...@dmsolutions.ca> wrote--------
Subject: Re: [mapserver-users] Testing KML support
Date: 07.05.2010 23:02

>
>Hi Peter,
>
>There is supposed to be --with-kml.
>I have added the OUTPUT=KML if built with the flag.
>Note that the driver is still in development/cleanup state. I will 
>update the RFC  (http://mapserver.org/development/rfc/ms-rfc-58.html) 
>once this phase is over.
>
>regards,
>
>On 07/05/2010 12:23 PM, Peter Hopfgartner wrote:
>> Hi,
>>
>> I'm would like to look at the KML functionality in the current
>MapServer
>> trunk.
>>
>> There does not seem to be any specific option in configure, so I
>enabled
>> it by setting the environment variable CPPFLAGS:
>>
>> $ export CPPFLAGS=-DUSE_KML
>> $ ./configure --with-proj --with-postgis --with-cairovim
>> --with-xml2-config=/usr/bin/xml2-config
>> $ make
>>    
>
>> The resulting shp2img has a lot of Kml-related symbols in it:
>>
>> $ nm shp2img | grep -i kml | wc -l
>> 71
>>
>> Anyway, KML does not seem to be oin the OUTPUT formats list:
>>
>> [peter.hopfgart...@vm-centos5-64-1 mapserver]$ ./shp2img -v
>> MapServer version 5.7-dev OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
>> OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV
>> SUPPORTS=WMS_SERVER INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE
>>
>> Indeed, trying to produce some KML from a map file, I get:
>>
>> $ /usr/local/bin/shp2img -i KML -m kml_test.map>  test.kml
>> loadOutputFormat(): General error message. OUTPUTFORMAT clause
>> references driver KML, but this driver isn't configured.

>>
>> Am I missing something?
>>
>> Regards,
>>
>> Peter
>>
>>    
>
>
>-- 
>----------------------------------------------------------------
>Assefa Yewondwossen
>Software Analyst
>
>Email: yass...@dmsolutions.ca
>http://www.dmsolutions.ca/
>
>Phone: (613) 565-5056 (ext 14)
>Fax:   (613) 565-0925
>----------------------------------------------------------------
>
>
>

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to