The geometrical properties of streamlines, such as the curvatures, directions and positions, are studied in steady inviscid compressible flow fields via differential geometry theories and conservation laws. The influences of the streamline geometries on the flow speeds and pressures are also identified and discussed. By transforming the streamlines to fill the domain and satisfy the boundary conditions, a unified geometry-based solver, the streamline transformation method, is proposed for both subsonic and supersonic regions. The governing equations and boundary conditions along streamlines and shock waves are also derived. This method is verified by numerical results of three typical flow fields, including the subsonic channel flow, the supersonic downstream of attached shock waves and especially the subsonic/supersonic downstream of detached bow shock waves. Both two-dimensional planar and axisymmetric flow fields are considered. Compared with the results from computational fluid dynamics, good agreements are achieved by this method, while fewer computational resources, by an order of magnitude, are consumed. Features of these flow fields are also analysed from a geometrical perspective, such as flow speeds and pressures deviated by the wall curvatures, and three-dimensional effects in the after-shock flow fields. For a hyperbolic-shaped bow shock wave, the stand-off distances and the transitions from subsonic to supersonic regions are also discussed. As indicated by the accuracy, efficiency and applicability in a wide range of flow speeds, the streamline transformation method would be a potential candidate for the theoretical analysis and inverse design of high-speed flow fields, especially where the subsonic regions exist downstream of strong shock waves.