In the COMPASS experiment at CERN, large straw drift tube detectors are used for large-angle tracking. To minimize the total areal density, a self supporting structure of thin-walled plastic tubes was chosen and, hence, a loss in mechanical precision was accepted. A complete mapping of the anode wire coordinate grid was required. An X-ray apparatus using a charge-coupled device (CCD) as imaging detector was built to investigate the mechanical properties and to calibrate (offline) the wire positions. Deviations of typically 200-400 μm from the nominal positions, defined by equal spacing, are found across the detector area of 8 m2. With a calibration method based on high-resolution CCD imaging and pattern recognition algorithms, the absolute wire coordinates are determined with an accuracy better than 30 μm across the whole detector area. Temperature effects are clearly seen. Their inhomogenity limits the achievable accuracy to about 50 μm under realistic experimental conditions, which is sufficient in view of the intrinsic straw resolution of 200 μm for minimum ionizing particles. The offline calibration was checked with particle tracks in the experimental setup, running COMPASS with 160 GeV/c muons. Tracks reconstructed with other detectors that cover a central angular range were used for this comparison. Good agreement is found between these in situ measurements and the X-ray calibration.