示例#1
0
文件: osr.go 项目: 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
}
示例#2
0
文件: osr.go 项目: 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()
}