Example #1
0
File: osr.go Project: kikht/gdal
// Initialize SRS based on WKT string
func (sr SpatialReference) FromWKT(wkt string) error {
	cString := C.CString(wkt)
	defer C.free(unsafe.Pointer(cString))
	err := C.OSRImportFromWkt(sr.cval, &cString)
	if err != 0 {
		return error(err)
	}

	return nil
}
Example #2
0
File: osr.go Project: sn-amber/gdal
// Initialize SRS based on WKT string
func (sr SpatialReference) FromWKT(wkt string) error {
	cString := C.CString(wkt)
	defer C.free(unsafe.Pointer(cString))
	return C.OSRImportFromWkt(sr.cval, &cString).Err()
}