From d9f26653b2020ed485577495252efe3630c84531 Mon Sep 17 00:00:00 2001 From: Peter Kleiweg Date: Tue, 10 May 2022 16:42:37 +0200 Subject: [PATCH] docstring for CreateCRS2CRS --- v5/proj.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/v5/proj.go b/v5/proj.go index 1a23422..c469918 100644 --- a/v5/proj.go +++ b/v5/proj.go @@ -126,19 +126,20 @@ func (ctx *Context) Create(definition string) (*PJ, error) { return &p, nil } -func (ctx *Context) CreateCRS2CRS(srcDefn, dstDefn string) (*PJ, error) { +// Create a transformation object that is a pipeline between two known coordinate reference systems +func (ctx *Context) CreateCRS2CRS(srcDefinition, dstDefinition string) (*PJ, error) { if !ctx.opened { return &PJ{}, errContextClosed } - srcDefnC := C.CString(srcDefn) - dstDefnC := C.CString(dstDefn) + srcDefinitionC := C.CString(srcDefinition) + dstDefinitionC := C.CString(dstDefinition) defer func() { - C.free(unsafe.Pointer(srcDefnC)) - C.free(unsafe.Pointer(dstDefnC)) + C.free(unsafe.Pointer(srcDefinitionC)) + C.free(unsafe.Pointer(dstDefinitionC)) }() - pj := C.proj_create_crs_to_crs(ctx.pj_context, srcDefnC, dstDefnC, nil) + pj := C.proj_create_crs_to_crs(ctx.pj_context, srcDefinitionC, dstDefinitionC, nil) if pj == nil { errno := C.proj_context_errno(ctx.pj_context) err := C.GoString(C.proj_errno_string(errno))