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

Chaitanya kumar CH chaitanya.ch at gmail.com
Sun Feb 5 07:55:53 EST 2012


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.

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> 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
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120205/2009dbd7/attachment.html


More information about the gdal-dev mailing list