User Rating 0.0
Total Usage 0 times
Presets:
Drawing Data Output (JSON)

      
Preview
Is this tool helpful?

Your feedback helps us improve.

About

Transit map rendering requires precise drawing data: station coordinates on an orthogonal grid, line paths as polyline segments snapped to 45° or 90° angles, color codes per line, and label offsets to avoid overlap. Manually assembling this from raw station lists is error-prone. A misplaced coordinate shifts an entire branch. A wrong color hex breaks visual line identity. This tool parses simplified Taipei Metro definitions - station names, line assignments, ordering, and optional coordinates - and outputs structured drawing data (JSON) containing x, y positions, RGB stroke values, connection paths, and text anchor points ready for Canvas or SVG renderers.

The converter handles all 6 main MRT lines (Brown, Red, Green, Orange, Blue, Yellow) plus airport and circular segments. When coordinates are omitted, an auto-layout engine places stations on a schematic grid at 60px intervals, routing lines along cardinal and diagonal axes. Transfer stations are detected automatically when a station name appears on multiple lines. The output format is deterministic: identical input always produces identical drawing data, making it suitable for version-controlled map assets.

taipei metro metro map drawing data data converter transit map MRT svg data canvas data

Formulas

Station positions on the schematic grid are computed when explicit coordinates are absent. Each station Si on line L receives a position:

xi = x0 + i Δx cos(θ)
yi = y0 + i Δy sin(θ)

Where x0, y0 is the starting anchor of the line segment, Δx = Δy = 60px (grid spacing), i is the station index along that segment, and θ {0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°}.

Transfer stations are detected by name collision across lines. When station name N appears in lines La and Lb, both line paths converge to a single coordinate, and the station object gains a transfer: TRUE flag. The drawing radius increases from 6px to 9px and fill becomes #FFFFFF with a 2px black stroke.

Label anchor offset is computed as: labelX = x + 12 cos(θ + 90°), labelY = y + 12 sin(θ + 90°). This places the label perpendicular to the line direction.

Reference Data

Line CodeLine NameColorHexStationsOpenedLength (km)Terminal ATerminal B
BRWenhu (Brown)#C48C3124199625.7Taipei ZooNangang Exhibition Center
RTamsui-Xinyi (Red)#E3002C33199732.3TamsuiXiangshan
GSongshan-Xindian (Green)#00865920199921.3SongshanXindian
OZhonghe-Xinlu (Orange)#F8B61C25199831.5LuzhouNanshijiao
BLBannan (Blue)#0070BD23199928.2DingpuNangang Exhibition Center
YCircular (Yellow)#FFDB0014202015.4DapinglinXinbeitou
ATaoyuan Airport MRT#95468822201751.0Taipei MainTaoyuan Airport T2
LGXiaobitan Branch (Green)#CFDB00120041.9QizhangXiaobitan
R-XBXinbeitou Branch (Red)#F090A0119971.2BeitouXinbeitou
- Transfer Station#FFFFFF - - - Rendered as larger circle with white fill + black stroke
Drawing Defaults
Grid Spacing60px
Station Radius6px (normal) / 9px (transfer)
Line Stroke Width8px
Label Font Size11px
Allowed Angles0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°

Frequently Asked Questions

The converter accepts a line-based text format. Each line definition starts with a header: LINE:::, followed by station entries as STATION: or STATION::: for explicit coordinates. Transfer stations are detected automatically when identical station names appear on multiple lines. Comments start with # and blank lines are ignored.
The auto-layout engine assigns each line a default direction angle (e.g., Red line runs vertical at 90°, Blue line runs horizontal at 0°). Starting from a computed anchor point, each subsequent station is placed at 60px intervals along that angle. Transfer stations serve as anchor constraints - when two lines share a station, the second line's layout adjusts its starting anchor to match the already-placed transfer station coordinate.
Yes. Add a CONFIG line at the top of your input: CONFIG:gridSpacing:80 or CONFIG:stationRadius:8 or CONFIG:strokeWidth:10. These override the defaults (60px grid, 6px radius, 8px stroke). All numeric CONFIG values must be positive integers between 1 and 200.
Branch lines are defined as separate LINE entries with their own color. The branch's first station should share a name with a station on the parent line (e.g., "Beitou" appears on both the Red line and the Xinbeitou branch). The converter detects this overlap and places the branch's origin at the transfer coordinate, then extends the branch in the specified or default angle.
The output JSON has four arrays: "lines" (each with id, name, color, strokeWidth, and a "path" array of [x,y] waypoints), "stations" (each with id, name, x, y, radius, fill, stroke, isTransfer, and lineIds), "labels" (each with text, x, y, fontSize, anchor, rotation), and "config" (gridSpacing, canvasWidth, canvasHeight). This data can be fed directly into a Canvas 2D or SVG renderer.
Yes. After parsing, the converter runs a graph connectivity check per line. If any station in a LINE block is orphaned (no path connection to adjacent stations), a warning is emitted in the output under a "warnings" array. This catches typos or duplicate station names within the same line.