func (h *Handle) Close() {
	C.GEOSWKBWriter_destroy_r(h.context, h.wkbWriter)
	C.GEOSWKBReader_destroy_r(h.context, h.wkbReader)
	C.GEOS_finish_r(h.context)
}
Close cleans up memory resources associated with the handle. If Close is not
called, then a memory leak will occur.
package main
import (
	"errors"
	"fmt"
	"strings"
	"unsafe"
	"github.com/peterstace/simplefeatures/geom"
)
import "C"
var (
	errNonEmptyGeometryCollectionNotSupported = errors.New(
		"non-empty GeometryCollection not supported")
	errLibgeosCrash = errors.New(
		"libgeos would crash with this input")
)
type Handle struct {
	context   C.GEOSContextHandle_t
	wkbReader *C.GEOSWKBReader
	wkbWriter *C.GEOSWKBWriter
	wkbBuf    []byte
	errBuf    [1024]byte
}
func NewHandle() (*Handle, error) {
	h := &Handle{}
	h.context = C.sf_geos_init(unsafe.Pointer(&h.errBuf))
	if h.context == nil {
		return nil, errors.New("could not create libgeos context")
	}
	h.wkbReader = C.GEOSWKBReader_create_r(h.context)
	if h.wkbReader == nil {
		return nil, h.err()
	}
	h.wkbWriter = C.GEOSWKBWriter_create_r(h.context)
	if h.wkbWriter == nil {
		return nil, h.err()
	}
	return h, nil
}