[geos-devel] GEOS and Writing SRID values

Charlie Savage cfis at savagexi.com
Thu Sep 13 12:46:08 EDT 2007


> I agree - but that's separate thing, no?  The right solution is expose 
> the reader/writers to the capi so you can create one and then use it.
> 
>> I'd like to see an extension to the C API adding:
>>
>> GEOSGeomToHEX_bufWithOpts( const GEOSGeometry *g, size_t *size,
>>                            int byteOrder, int includeSRID,
>>                            int outpuDimension );

Thinking about this more, maybe the better way to do this is give the 
caller more control:

GEOSWkbWriter GEOSWkbWriter_create(int byteOrder, int includeSRID,  int 
outpuDimension);

void GEOSWkbWriter GEOSWkbWriter_destroy(GEOSWkbWriter writer);

extern unsigned char GEOSWkbWriter_write(const GEOSGeometry *g, size_t 
*size);

extern unsigned char GEOSWkbWriter_writeHex(const GEOSGeometry *g, 
size_t *size);

And similar for the WktWriter.  And really the same for WkbReader/WktReader.

The advantage of this is a client can create and cache their own 
reader/writers without having to create a new one every time.  Thus this 
avoids the static issue you mentioned, but doesn't force creation of new 
readers and writers every time you want to use one (which for my app, is 
  *alot*).

Thus, this is the approach that I prefer.

Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osgeo.org/pipermail/geos-devel/attachments/20070913/3d6ccae5/smime.bin


More information about the geos-devel mailing list