[gdal-dev] Feature (geometry and attributes) to GeoJSON

Mateusz Loskot mateusz at loskot.net
Mon Jul 8 08:08:07 PDT 2013


On 8 July 2013 15:59, Baker, Anthony W <Anthony.W.Baker at boeing.com> wrote:
> I would like to export a single feature to GeoJSON format and have
> successfully used OGR_G_ExportToJson to convert the geometry to a character
> string GeoJSON format.  Is there a similar function for converting a feature
> to a character string GeoJSON format (including geometry and attribute
> information)?

AFAIK, there is no such API and that's why Python bindings provide
custom method Feature.ExportToJson defined here:

http://svn.osgeo.org/gdal/trunk/gdal/swig/python/osgeo/ogr.py

Best regards,
-- 
Mateusz  Loskot, http://mateusz.loskot.net


More information about the gdal-dev mailing list