We provide a simple method to build a straight field-line coordinate system from discretized (Poincaré) magnetic field maps. The method is suitable for any plasma domain with nested flux surfaces, including magnetic islands. Illustrative examples are shown for tokamak, heliotron, and reversed-field-pinch plasmas with m = 1 islands.