I'm taking a first course on complex manifolds, and am trying to square what I hear with what I know of (real) differential geometry. Please forgive me if this question is misguided!

Here are two examples of ways of making vector bundles from codimension-one submanifolds.

**(The tensor powers of its associated line bundle)**In a complex manifold $M$ with a codimension-1 complex submanifold $D$, take as an atlas a system $(U_\alpha)$ of slice-coordinate charts for $V$, together with other charts $(V_\beta)$ covering $M\setminus D$. For each $n\in \mathbb{Z}$, define a line bundle via the following transition functions: $\phi_{\beta_1\beta_2}:V_{\beta_1}\cap V_{\beta_2}\to GL_1(\mathbb{C})$ is uniformly =1; $\phi_{\alpha_1\beta_2}:U_{\alpha_1}\cap V_{\beta_2}\to GL_1(\mathbb{C})$ is $z_1^n$, and $\phi_{\alpha_1\alpha_2}:U_{\alpha_1}\cap U_{\alpha_2}\to GL_1(\mathbb{C})$ is $z_1^n/w_1^n$, where $z_1$ and $w_1$ are the coordinates whose vanishing determines $D$ on $U_{\alpha_1}$ and $U_{\alpha_2}$ respectively.

*Comment: This also seems to work fine if we replace "complex" by "smooth (real)" throughout. However, the family of line bundles isn't so interesting: the even ones are all trivial; the odd ones are mutually isomorphic.*

**(Vector bundles on spheres)**For each homotopy class of maps $S^{n-1}\to GL_k(\mathbb{R})$, we can construct a vector bundle of rank $k$ on $S^n$, by using a representative of this class to define a transition function on the intersection of the "north" and "south" stereographic projection charts (which has $S^{n-1}$ as a retract).

I'd like to know: are these indeed analogous? Are they special cases of, say, a general method for constructing a smooth (respectively, complex) rank-$k$ vector bundle on a smooth (resp., complex) manifold out of a map from a codimension-one submanifold into $GL_k(\mathbb{R})$ (resp., $GL_k(\mathbb{C})$?