Skip to content

Snapshots and scripting

--snapshot COLSxROWS loads the tiles for one view, draws it, prints it and exits. No terminal is needed, so it works in scripts, CI and cron jobs.

Terminal window
mapterm --snapshot 120x40 --at 38.8895,-77.0353 -z 14 # plain text
mapterm --snapshot 120x40 --at 38.8895,-77.0353 -z 14 --format ansi # 24-bit color
mapterm --snapshot 120x40 --at 38.8895,-77.0353 -z 14 --format html # an HTML fragment

Every option that changes the map works with it: --style, --light, --geojson, --raster (as cell colors) and the source argument.

--format Output
text (default) The characters only, one line per row, trailing spaces trimmed
ansi Characters with 24-bit foreground and background colors, bold and italic; each row ends with a reset. cat it in a terminal, or pipe it to less -R.
html A <pre class="mapterm"> element with inline colors

Each run of cells with the same colors becomes one <span> with inline color and background. Cells that use the terminal’s default color have no style, so the page decides the default foreground and background. The <pre> carries data-cols and data-rows.

mapterm --snapshot 110x34 --at 40.758,-73.9855 -z 13 --format html
                    ⢀9A⠤⣀    ⡠⠊   West 53rd Street ⡔⠁        ⢈⠞⠤⣀⢸      ⢠⠊⠒⠤⣀                  ⢀⠎    ⢀⠎    ⣸⡿⠣
                   ⢠⢪⠣⢄⡀ ⠉⠒⠤⡰⠁      ⡼⠁ ⡜  ⠉⠒⠤⣀ ⠈⠑⢢⢎⡀        ⢀⠎   ⡝⠒⠤⡀  ⡰⠁    ⠉⠒⠤⣀             ⢠⠊    ⢀⠎    ⣰⡿⠁ 
                  ⢠⡪⠃  ⠈⠑⠢⢄⡰⠉⠑⠢⢄⡀  ⡰⠁ ⡜     9th Avenue⢄⡀   ⢠⠊    ⡇  ⠈⠑⡲⢅⡀        ⡝⠒⠤⣀        ⡠⠃    ⢀⠎    ⣰⡟⠁  
                 ⢠⡳⠁      ⡰West 50th Street    ⢀⠎⠈⠑⠢⣀  ⠈⠒⠤⣀⠎    ⢸ West 57th Street   ⠉⠒⠤⣀⢀⠔⠒⢲⣁    ⢠⠃    ⣰⡟    
                ⢠⡳⠁     ⢀⠔⠁    ⠉⠒⡴⣁⢀⠎⠒⠤⣀      ⢠⠊     ⠉⠒⠤⣀⢠⠊⠉⠒⢄⡀ ⡇   ⡔⠁      ⠉⠒⠤⣰⠁        ⠫⢄⡠⠃ ⠑⠢⣀⢠⠃    ⣼⡟    ⢠
               ⢠⡳⠉⠑⠢⣀  ⢀⠎     10th Avenue⠢⢄⡀ ⢠⠃    8th Avenue ⠈⡹⠤⣀ ⡜     6th Avenue⡀     Madison Avenue⠏    ⢠⠃
             ⢀⡴⠋⠒⠤⣀  ⠉⢒⢎⡀      ⡜ ⢠⠊  ⠈⠑⠢⣀  ⠈⡲⠥⣀        ⡰⠁   ⠈7th Avenue     ⢀⠎     ⠈⠑⠢⢄⡀ ⡰⠁    ⢩⠣⢄⡀ ⢈⣵⠫⢄⡀  ⢠⠃ 
           ⢀⡴⠋     ⠑⠢⢄⡎ ⠈⠑⠤⣀  ⡜ ⡠⠃       ⠉⠒⡴⣁  ⠉⠢⢄⡀   ⡸⠁     ⢠⠃ ⢈⠟⠢⣀ ⠈⠑⠢⢄  ⢠⠊          ⠈⡕⠥⣀   ⡰⠁  ⠈⢑⣾⣃  ⠈⠑⣢⣧⣔⠮
         ⡠⢔⠏        ⢀⠎West 46th Street    ⡔⠁ ⠑⠢⢄⡀ ⠈⠑⢢⢜⡀     ⢠West 53rd Street          ⡜   ⠉⠢⣜⡀   ⢀⣾⠃ ⢉⡲⣴⡾⠓⠉⠈⠢
       ⢀⢜⠖⠥⣀       ⢠⠊     ⠈⢱⠮⣀⡰⠉⠑⠢⣀      ⡜      ⠈⠒⠤⣀⠎ ⠈⠑⠤⣀ ⢰⠁ ⢀⠎       ⠈⠑⢢⡃ ⠈⠑⠢⢄      ⡜     ⡜ ⠈⠑⠤⣀⣾⡣⢖⣪⠵⠋⡱⠉⠑⠢⢄⡀
      ⢀⢮⠊   ⠉⠒⠤⡀  ⣠⠃   West 45th Street ⡜          ⡎⠉⠢⢄⡀  ⢩⠣⢄⣀⠎         ⢠⠃⠈⠒⠤⣀  ⠉⠒⠤⣀⢠⠊     ⡜    ⣠⣿⡯⠾⢏⡁ ⡰⠁    ⡜
⡢⢄⡀  ⢠⢪⣃     11th Avenue ⣰⠏ ⡰⠁   ⠈⠑⠤⣀ ⢈⠝⠤⣀       ⢀⠎   West 50th Street ⢠⠃     ⠉⠒⠤⣀ ⢠⠓⠢⢄⡀ ⢀Park Avenue⠈⡕⠥⣀   ⣸⠤
⡉⠓⠯⣗9A⠃ ⠉⠒⠤⣀  West 42nd Street       ⢩⠚⢄⡀ ⠉⠒⠤⡀  ⢀⠎         ⡩⠓⠤⣀  ⠑⠢⢄⡀ ⡰⠁          ⢩⠣⢄⡀ ⠈⢱⠪⢄⡀  ⣼⣿⠃   ⢀⠜   ⠉⢢⢴⡃ 
⠈⠑⠦⣤⡻⠓⠭⣢⢄⡀  ⠉⠒⢄⡾⠁     ⣠⠟⠣⢄⡎         ⢠⠃  ⠈⠑⠤⣀ ⠈⠉⢢⣃       West 49th Street         ⢠⠃  ⠈⠑⢢⣃  ⠈⠑⣾⣿⠃   ⢀⠎    ⢀⢮⠃⠈⠑
  ⡰⡷⠉⠒⢄⡀⠑⠪⢖⡤⣀⢠⡳⠓⠦⣄⡀ ⢀⡜⠥⣀⢀⠎⠈⠒⠤⣀     ⢠⠃       ⠑⠢⢤⠃ ⠉⠒⠤⣀    ⡰⠁       ⠉⠒⣜⡀  ⠉⠒⠤⣀    ⡠⠃    ⢠⠃ ⠉⠒⠤⣼⡿⠁⠉⠢⢄⣀⠎     ⡞⠁   
 ⡜⡜    ⠈⠑⠢⣀⠈⢑⠯⠵⣒⠶⣒⠿⡵⠋  ⢀⠏⠑⠢⣀ 9th Avenue      ⡰⠁⠉⠒⠤⣀  ⠉⠒⠤⡰⠁        ⢀⠜ ⠈⠑⠢⢄⡀  ⠉⠒⠤⡰⠁    ⢠⠃    ⣼⡿⠑⠤⣀ ⢀⠎⠒⠤⣀ ⢀⠎     
⡜⡺         ⢉⠞⢄⡀ ⠉⣲⠿⣒⠤⡀⢠⠊    ⢩⠓⠢⢄⡀⡸⠑⠢⢄⡀      ⡜    West 46th Street⢀⠎      ⠈⠑⠢⢄⡀⡜⠈⠑⠤⡀ ⡰⠁   ⢀⣾⡟⠁   ⢩⠪⢄⡀  ⢉⠮⢄⡀    
⡱⠁        ⢀⢎⡀ ⠈⢑⠴⣁  ⠉⡺⡗⢄   ⢠⠃   ⡜⠁   ⠈⠑⠢⢄⡀ ⡸      Manhattan ⠉⠒⠤⡀⢀⠎          ⢀⠎⠒⠤⣀ ⠈⡱⠣⢄⡀ ⣠⣿⡟    ⢠⠃  ⠈⠑⢢⢇  ⠈⠑⠢⢄⣀
         ⢀⠎ ⠈⢑⠶⣁  ⠉⠢⡴⠥⣝⣦⣍⣢⣠⠃   ⡜         ⠈⡕⠥⣀     West 45th Street⢄⡀       ⢀⠎    ⠉⡖⠥⣀⢀⣨⣿⣿⣟    ⡰⠁    ⡠⠃ ⠉⠒⠤⣀ ⢀⠞
⠢⢄⡀     ⢀⠎⣉⠶⠮⡁ 10th Avenue⠫⡆  ⡜     8th Avenue⠢⣀   ⢠⠊     6th Avenue⠒⠤⡀   Madison Avenue⣿⠃⠉⠒⠤⡰⠁3rd Avenue  ⢉⠮⢄
  ⠉⠓⠢⣀ ⣀⠞⠉  West 37th Street⢀⠜         ⢀⠜West 42nd Street    ⢠⠃  ⠈⠑⠤⡀ ⠈⠑⠢⢄⠎    ⢀⠎ ⣰⣿⡝⣽⣿⣿⣿⠢⢄⡀⡜⠈⠑⠢⢄⡀⡜   ⠝   ⢀⠎  
     ⢠⢫⠚⢄⡀       ⡜⠒⠤⣀  ⣝⣶⢶⣏⢀⠎         ⢠⠃         ⢠⠃⠈⠑⠢⢄⡀    ⢠⠃      ⠈⠑⠢⠤⣠⠃⠉⠒⠤⣀⢀⠎ ⣼⣿⣿⣾⣿⣿⣿⡏ ⢀⠎⠑⠢⢄⡀ ⡜⠒⠤⡀    ⢀⠎   
⢦⣄⡀West 34th Street⢀⣠⣽⣞⣽⡷⢅⣠⠏⠢⣀       ⢠⠃         ⡰⠁     ⠈⠑⠤⣀⢠⠃          ⢠⠃⠉⠢⢄ ⢀⠏⢒⣾⣿Lexington Avenue⡀ ⠈⠑⠤⣀⢠⠃    
 ⠈⠛⠷⣾⣀       ⠉⠒⡼⣀⢀⣔⠟⢋⠟⠁ ⠈⢱⠣⢄  ⠉⠒⢄⡀  ⢠⠊         ⡰⠁         ⡰⠉⠢⢄⡀       ⡰⠁    ⢉⠮⢄⣾⣿⣿⣿⣿⣿⣿⡟⢹⢠⠃    ⢠⠃  ⠈⠑⠢⢄⡀⡰⠑⠢⢄⡀  
   ⡞⠈⢏⠛⢖⣄⡀   ⢀⠎  ⣿⠧⢄⡎   ⢰⠁  ⠉⠒⠤⣀ ⠈⠑⢢⢇⡀        ⡔⠁         ⡰⠁   ⠈⠑⠢⣀   ⡔⠁   Park Avenue⡟⠑⣯⣃    ⢠⠃       ⡸⠑⠢⣀ ⠈⠑⠢
⢄⣀⠎   ⠉⠒⠬⢝⣵⣢⢤⠃  ⢼⡏  ⠈⠑⠢⣠⠃       ⠉⠒⡤⣃ ⠈⠑⠢⢄   ⢀⠜         ⢀⠔⠁        ⠉⠒⣜⡀    ⢠⠃⢠⣿⣾⣟⣾⣿⣿⣿⡟⠤⣼⠃ ⠉⠒⠤⣠⠃       ⡔⠁   ⠉⠢⢄⡀
⢀⠎⠒⠤⣀      ⢨⠛⠿⣶⣤⣟     ⡰⠁⠉⠒⠤⡀     ⡰⠁ ⠉⠒⢄⡀ ⠉⠒⠤⣜         ⢀⠎           ⡜ ⠈⠑⠢⢄⡰⠁ ⢸⡟⢈⣾⣿⣿⣿⡟ ⣼⠃⠉⠒⠤⣀⢠⠃⠉⠒⢄⡀   ⡜       ⢀⡾
⠎    ⠉⠢⢄⡀ ⢠⠓⠢⢄⡰⡝⠛⠷⣦⣄⡀⡰⠁    ⠈⠑⠢⢄⡀⡔⠁     ⠈West 37th Street          ⡜     ⡜⠉⠒⠤⣸⢷⣼⠏⡰⠉⠉⢀⡼⠁    ⡰⠉⠢⢄  ⠈⠒⠤⡜       ⢠⣾⣃
        ⠈⢱⠵⣢⢄⣰⠏⠒⠤⣀ ⢙⠿⣷⣶⣤⣀⡀     ⡜⠒⠤⣀      ⢀⠎⠉⠒⢄⡀  ⠑⠢⣀⢀⠎          ⢀⠜    ⢀⠎     ⡝⠫⢟⡒⠒⠒⡱⠁    ⡰⠁   ⠉⠒⢄⡀⡜⠈⠑⠢⢄⡀  ⣰⣻⠊ 
        ⡠⠃  ⠉⠛⠷⣢⢄⡀⢩⠪⢄⡈⠙⢯⣿⣿⣿⣶⣦⢦⣮⣄⡀  ⠉⠒⢄⡀ ⢀⠎    ⠈⠑⠢⣀ ⢀⠏⠒⠢⣀       ⢀⠎    ⢀⠎     ⡜   ⠈⠑⡲⣁    ⡰⠁      ⢀⠎⠑⠢⢄⡀ ⠈⠑⢢⡷⠁  
       ⡰⠁       ⠑⢪⢇  ⠈⠑⠤⣙⠿⣿⣿⣿⣿⣾West 34th Street   ⢉⠮⢄⡀  ⠉⠒⢄⡀  ⢠⠃    ⢀⠎    ⢠⡜     ⡰⠁ ⠉⠒⠤⡰⠁ 2nd Avenue ⠈⠑⠢⢤⡟⠁   
      ⡰⠁        ⢀⠎ ⠑⠢⢄⡀  ⠉⠚⢿⣿⢿⣿⣿⣿⣿⣿⣿⣷⣦⣠⠃  ⠉⠒⠤⣀   ⡰⠁  ⠈⠑⠢⢄⡀ ⠈⠑⡢⣃    ⢀⠎    ⢠⡿⠁   ⢀⠎     ⡜⠈⠑⠢⢄⡀  ⢠⠃       ⣰⡟     
10th Avenue    ⢀⠎    8th Avenue⣿⣿⣿⣿⣿⣿⣿⡿⠿⣒⣤⣄6th Avenue    ⠈⠑Madison Avenue⡳⠁   ⢀3rd Avenue  ⠈⠑⡢⣃       ⣰⠏     ⡠
   ⢀⠎         ⡠⠊         ⡰⠉⠒⠤⢄⡀ ⠉⠛⠿⣯⡝⠛⠛⠶⣤⡀ ⠉⠛⠶⣤⡜ ⠈⠑⠢⢄  5th Avenue⡰⠉⠒⠤⣀ ⣰⠏    ⢀⠎    ⢀⠎       ⡰⠁ ⠉⠒⠤⡀  ⣰⠏     ⣰⠏

To make the braille line up, use a monospace font with braille glyphs (DejaVu Sans Mono has them) and set the line height to twice the character width. This site uses:

pre.mapterm {
font-family: 'DejaVu Sans Mono', monospace;
line-height: 1.2042; /* 2 × 0.6021em, DejaVu's advance width */
}
pre.mapterm span {
display: inline-block; /* fill backgrounds edge to edge */
height: 1.2042em;
vertical-align: top;
}

The site’s snapshot script shows the whole setup.

--pick COL,ROW replaces the drawing with the features under that cell, as JSON lines. See Inspect features.

Every map on mapterm.com is real mapterm output: a script runs mapterm --snapshot ... --format html for each view, and the pages embed the fragments. Nothing is a screenshot or a mock-up, so when mapterm’s styles change, the site is regenerated from the same commands.