centreborelli / s2p

Satellite Stereo Pipeline
GNU Affero General Public License v3.0
207 stars 67 forks source link

Use double precision for 3D points coordinates #82

Closed carlodef closed 3 years ago

carlodef commented 3 years ago

Single precision has limited accuracy when representing large numbers: for example, numbers between 4 millions and 8 millions stored in single precision are accurate up to 0.5. See https://en.wikipedia.org/w/index.php?title=Single-precision_floating-point_format

UTM coordinates (s2p default output CRS) commonly have northing coordinates ranging up to 10 millions meters. Hence these coordinates need to be represented with double precision.

This was the case in former s2p version (up to version 1.0b17). In PR #16, double precision was mistakenly switched to single precision (my bad). The current PR fixes this bug. Many thanks to Alvaro and @gfacciol for spotting it!