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

Even Rouault even.rouault at mines-paris.org
Tue Jul 9 12:16:57 PDT 2013


Le mardi 09 juillet 2013 21:07:45, Baker, Anthony W a écrit :
> 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???

Yes this is an internal symbol of GDAL. If you really want it to be exported, 
you can add CPL_DLL in its prototype, but this is at your own risks (= the 
function might have disappeared or be renamed in any future version).

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

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list