[gdal-dev] OGR building always requires KML, GML, GEOJSON drivers

Dmitry Baryshnikov polimax at mail.ru
Sun Feb 5 08:34:59 EST 2012


Hi,

05.02.2012 16:55, Chaitanya kumar CH пишет:
> Dmitry,
>
> I not sure about KML and GeoJSON, but the GML driver need not be 
> enabled for the exportToGML method to work. Even for the other two, 
> the code associated with exporting the OGRGeometry to those formats 
> seems to stand apart from the driver code.
I want to build GDAL without GML, KML and GEOJSON and I cannot do it 
because dependencies. I don't need exportToGML, exportToKML, 
exportToJson working in this library (as I don't check this drivers to 
build). The adding of ifdef will solve this.
>
> Also, these functions are occasionally used irrespective of the drivers.
>
> Check if there are any problems when the KML and GeoJSON drivers are 
> disabled. If there are any, it's better to add your patch.
>
> On Sat, Feb 4, 2012 at 10:45 PM, Dmitry Baryshnikov <polimax at mail.ru 
> <mailto:polimax at mail.ru>> wrote:
>
>     Hi all,
>
>     OGRGeometry have such methods as exportToGML, exportToKML,
>     exportToJson which always requires KML (not LIBKM), GML and
>     GEOJSON code.
>     I think in exportToGML, exportToKML, exportToJson should be #ifdef
>     KML_ENABLED GML_ENABLED, GEOJSON_ENABLED.
>     For example:
>
>         char *OGRGeometry::exportToKML() const
>
>         {
>         #ifndef _WIN32_WCE
>         #if defined OGR_ENABLED && defined KML_ENABLED
>             return OGR_G_ExportToKML( (OGRGeometryH) this, NULL );
>         #else
>             CPLError( CE_Failure, CPLE_AppDefined,
>                       "OGRGeometry::exportToKML() not supported in
>         builds without OGR drivers." );
>             return NULL;
>         #endif
>         #else
>             CPLError( CE_Failure, CPLE_AppDefined,
>                       "OGRGeometry::exportToKML() not supported in the
>         WinCE build." );
>             return NULL;
>         #endif
>         }
>
>     Can I add such code?
>
>     Best regards,
>         Dmitry
>
>     _______________________________________________
>     gdal-dev mailing list
>     gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
>
> -- 
> Best regards,
> Chaitanya kumar CH.
>
> +91-9494447584
> 17.2416N 80.1426E
Best regards,
     Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120205/52a1b97a/attachment.html


More information about the gdal-dev mailing list