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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
geos-devel mailing list
geos-devel@geos.refractions.net
http://geos.refractions.net/mailman/listinfo/geos-devel

Reply via email to