<p dir="ltr">Just a comment.<br>
With all the new json functions in PostgreSQL this is very easy to do directly in sql too. I think it is fairly efficient too. I use it in production to export complete geojson through postgrest.</p>
<p dir="ltr">I have thougt about if we could get rid of json-c dependency and use postgresql functionality instead. <br>
Building json with jsonb, I guess is a lot faster than dealing with text strings.</p>
<p dir="ltr">/Nicklas</p>
<p dir="ltr">Skickat från min Sony Xperia™-smartphone</p>
<p dir="ltr">---- Jan Michálek skrev ----</p>
<p dir="ltr">> Hello<br>
> <br>
> I need a advice about this problem<br>
> <br>
> I'm trying to write some C fuction for making geojson as aggregate from records as full regular geojson with properties.<br>
> <br>
> I tried to use function lwgeom_to_geojson inside my code.<br>
> <br>
> something like this<br>
> <br>
>                 case JSONTYPE_GEOM: //je;<br>
>                         {<br>
>                         LWGEOM *lwgeom;<br>
>                         lwgeom = lwgeom_from_gserialized(<br>
>                              (GSERIALIZED*)DatumGetPointer(val)<br>
>                               );<br>
>                         outputstr = lwgeom_to_geojson(lwgeom, 0, 0, false);<br>
>                         escape_json(result, outputstr);<br>
>                         pfree(outputstr);<br>
> <br>
>                         break;<br>
> <br>
>                         }<br>
> <br>
> <br>
> <br>
> I have <br>
> #include "liblwgeom.h"<br>
> <br>
> And I`m able to compile this. But if I try use function in postgre, it get me an error<br>
> <br>
> ERROR:  could not load library "/usr/lib/postgresql/<a href="http://jelejson.so">jelejson.so</a>": /usr/lib/postgresql/<a href="http://jelejson.so">jelejson.so</a>: undefined symbol: lwgeom_to_geojson.<br>
> <br>
> What i should do? Is posible to use this function like this?<br>
> <br>
> Thanks Je;<br>
> <br>
> <br>
> -- <br>
> <br>
> Jelen<br>
> <br>
> Starší čeledín datovýho chlíva</p>