The person charged by law with the duty of burying the body of a deceased person is entitled to the custody of such body for the purpose of burying it. However, in the cases in which an investigation or inquest is required by law to be held upon a dead body, by a coroner, such coroner is entitled to its custody until such inquest has been completed.
SDCL 34-26-14