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

Baker, Anthony W Anthony.W.Baker at boeing.com
Tue Jul 9 12:07:45 PDT 2013


Seems that when I include the code from say OGR_G_ExportToJSon in my own code, I end up with lots of unresolved link errors.  I guess that the GDAL_i.lib does not expose the functions that I need to use OGRGeoJSONWriteFeature.  Maybe I am just missing something simple???

Anthony




-----Original Message-----
From: Mateusz Loskot [mailto:mateusz at loskot.net] 
Sent: Tuesday, July 09, 2013 2:17 PM
To: Baker, Anthony W
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Feature (geometry and attributes) to GeoJSON

On 9 July 2013 18:58, Baker, Anthony W <Anthony.W.Baker at boeing.com> wrote:
> Thank you for your response!
>
> Is it possible to use the json_object directly with something like
>        json_object *json = OGRGeoJSONWriteFeature(poFeature);
> Then just convert that to string?

I'm sure it is. You've got the source, you can include whatever GDAL headers you like and use whatever is exposed from the binary.

> I seem to get an error in json_object.h when I try this method with "boolean redefinition".

You may need to apply some fixes for your compiler.

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


More information about the gdal-dev mailing list