Example #1
0
func (this *Geos) AsWkb(geom *Geom) []byte {
	var size C.size_t
	buf := C.GEOSGeomToWKB_buf_r(this.v, geom.v, &size)
	if buf == nil {
		return nil
	}
	result := C.GoBytes(unsafe.Pointer(buf), C.int(size))
	C.free(unsafe.Pointer(buf))
	return result
}
Example #2
0
func cGEOSGeomToWKB_buf(g *C.GEOSGeometry, size *C.size_t) *C.uchar {
	handlemu.Lock()
	defer handlemu.Unlock()
	return C.GEOSGeomToWKB_buf_r(handle, g, size)
}