// Export coordinate system in PCI format func (sr SpatialReference) ToPCI() (proj, units string, params []float64, errVal error) { var p, u *C.char err := C.OSRExportToPCI( sr.cval, &p, &u, (**C.double)(unsafe.Pointer(¶ms[0])), ).Err() header := (*reflect.SliceHeader)(unsafe.Pointer(¶ms)) header.Cap = 17 header.Len = 17 defer C.free(unsafe.Pointer(p)) defer C.free(unsafe.Pointer(u)) return C.GoString(p), C.GoString(u), params, err }
// Export coordinate system in PCI format func (sr SpatialReference) ToPCI() (proj, units string, params []float64, errVal error) { var p, u *C.char err := C.OSRExportToPCI(sr.cval, &p, &u, (**C.double)(unsafe.Pointer(¶ms[0]))) if err != 0 { return "", "", nil, error(err) } proj = C.GoString(p) C.free(unsafe.Pointer(p)) units = C.GoString(u) C.free(unsafe.Pointer(u)) header := (*reflect.SliceHeader)((unsafe.Pointer(¶ms))) header.Cap = 17 header.Len = 17 return proj, units, params, nil }