BitmapMaps doc

Run pipeline

  1. Verify input files
  2. Run the pipeline
  3. Result files
  4. Evaluating the first run

Verify input files

If you followed along, you should see a pretty clean project directory (you may also have a couple of .toml files):

PS C:\Users\f\BitmapMaps> tree /F Stetind
Folder PATH listing
Volume serial number is 6E6D-2993
C:\USERS\F\BITMAPMAPS\STETIND
    BitmapMaps.ini
    eksport_1150771_20250401.zip

No subfolders exist

If you solve crosswords with a pen, go ahead and run_pipeline()! The .zip file will be read. But in Windows, unzipping large files programmatically might irritate the anti-virus ghosts.

Unzipping the .tif files manually is good practice [1]. Just unzip and place the large .tif files in '~/BitmapMaps/Stetind'! Metadata files and all folders can be deleted, along with the .zip file. We should now have:

C:\USERS\F\BITMAPMAPS\STETIND
    BitmapMaps.ini
    dtm1_33_143_175.tif
    dtm1_33_143_176.tif
    dtm1_33_144_175.tif
    dtm1_33_144_176.tif

The .tif files are 32-bit image files, i.e. gray scale with potentially four billion shades. You could edit these images in GIMP with large difficulty [2].

Run the pipeline

Ready with the Julia prompt?

using BitmapMaps
# Request more detailed feedback. With one sheet, it's not too much.
ENV["JULIA_DEBUG"] = "BitmapMaps"
# This defines a SheetMatrixBuilder like we did before, then does the work
run_bitmapmap_pipeline();

...which produces all of this feedback:

[ Info: Default settings read from C:\Users\f\BitmapMaps\Stetind\BitmapMaps.ini
Bitmapmap builder based on .ini file and keywords
SheetMatrixBuilder((564923, 7560194), # southwest_corner
      CartesianIndices((1:1, 1:1)), # sheet_indices
                                 1, # cell_to_utm_factor
                               191, # sheet_width_mm
                               275, # sheet_height_mm
                             11811, # density_pt_m⁻¹
              "BitmapMaps/Stetind") # pth
        [easting, northing] derived properties:
          Bounding Box (BB) SE-NW            = (564923 7560195)-(567177 7563442)
          Northeast internal corner          = (567177, 7563442) - most northeastern sample point
          Geo centre                         = (566050.5, 7.561818e6)
          Grid centre single                 = (566050, 7561818)
        Derived properties:
          Geographical (width, height) [km]  = (2.3, 3.2)
          Geographical area [km²]            = 7
                    Per sheet = 7.32 km²   (Single file export limit: 16 km²)
          Sheets total (width, height) [cm]  = (19.1, 27.5)
                    Per sheet [mm] (w, h) = (190.9, 275.0)
          Map scale                          = 1 : 11811 = 1 : (cell_to_utm_factor * density_pt_m⁻¹)
        BBs of sheets as Well Known Text (paste in wktmap.com or nvdb-vegdata.github.io/nvdb-visrute/STM ):
          MULTIPOLYGON (
                   ((564923 7560194, 567178 7560194, 567178 7563442, 564923 7563442, 564923 7560194)))
[ Info: Mosaic of linked sheets thumbnails in C:\Users\f\BitmapMaps/Stetind\(564923 7560195)-(567177 7563442).svg
┌ Debug: Pre-process: Make C:\Users\f\BitmapMaps/Stetind\(564923 7560195)-(567177 7563442).svg
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\vector_graphics.jl:341
┌ Debug:     Common to all sheets, graph file: ffna_graph = raw"C:\Users\f\BitmapMaps/Stetind\(564923 7560195)-(567177 7563442).z"
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\pipeline.jl:152
[ Info: Sheet [1, 1] of up to [1, 1], at 18:45:21
┌ Debug:  1 `establish_folder` at 18:45:21. C:\Users\f\BitmapMaps/Stetind\1-1__564923-7560194__567178-7563442
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\pipeline.jl:203
┌ Debug:  2 `unzip_tif` at 18:45:22. C:\Users\f\BitmapMaps/Stetind\1-1__564923-7560194__567178-7563442
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\pipeline.jl:203
┌ Debug:  3 `consolidate_elevation_data` at 18:45:24. C:\Users\f\BitmapMaps/Stetind\1-1__564923-7560194__567178-7563442
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\pipeline.jl:203
┌ Debug:     Find nonzero bounding box from C:\Users\f\BitmapMaps\Stetind\dtm1_33_143_175.tif
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\consolidate_elevation_data.jl:164
┌ Debug:     Find nonzero bounding box from C:\Users\f\BitmapMaps\Stetind\dtm1_33_143_176.tif
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\consolidate_elevation_data.jl:164
┌ Debug:     Find nonzero bounding box from C:\Users\f\BitmapMaps\Stetind\dtm1_33_144_175.tif
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\consolidate_elevation_data.jl:164
┌ Debug:     Find nonzero bounding box from C:\Users\f\BitmapMaps\Stetind\dtm1_33_144_176.tif
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\consolidate_elevation_data.jl:164
┌ Debug:     Copy cells from C:\Users\f\BitmapMaps\Stetind\dtm1_33_144_175.tif
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\consolidate_elevation_data.jl:108
┌ Debug:  4 `water_overlay` at 18:45:44. C:\Users\f\BitmapMaps/Stetind\1-1__564923-7560194__567178-7563442
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\pipeline.jl:203
(..snip..)
┌ Debug: 14 `join_layers` at 18:47:16. C:\Users\f\BitmapMaps/Stetind\1-1__564923-7560194__567178-7563442
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\pipeline.jl:203
┌ Debug:     Saving C:\Users\f\BitmapMaps/Stetind\1-1__564923-7560194__567178-7563442\Composite.png
└ @ BitmapMaps C:\Users\f\.julia\packages\BitmapMaps\ZBwH9\src\layers.jl:63
Finished job in folder C:\Users\f\BitmapMaps/Stetind
                                                        \1-1__564923-7560194__567178-7563442

Result files

None of the work files were deleted. You could modify any intermediate results and rerun the pipeline. The 'modified' timestamps would be recognized and incorporated into the steps after it. These are the files:

PS C:\Users\f\BitmapMaps> tree /F Stetind
Folder PATH listing
Volume serial number is 6E6D-2993
C:\USERS\F\BITMAPMAPS\STETIND
│   (564923 7560195)-(567177 7563442).css
│   (564923 7560195)-(567177 7563442).csv
│   (564923 7560195)-(567177 7563442).svg
│   (564923 7560195)-(567177 7563442).z
│   BitmapMaps.ini
│   dtm1_33_143_175.tif
│   dtm1_33_143_176.tif
│   dtm1_33_144_175.tif
│   dtm1_33_144_176.tif
│   tifdic.jls
│
└───1-1__564923-7560194__567178-7563442
        (564923 7560195)-(567177 7563442).z
        Composite.css
        Composite.png
        Composite.svg               
        Consolidated.tif
        Contour.png
        Grid.png
        Markers.png
        Parse_builder.jl
        Ridge.png
        Summits.csv
        Thumbnail.png
        Toporelief.png
        Water.csv
        Water.png

<code>Thumbnail.png</code>

Evaluating the first run

So, this was the default try, and it can easily be improved:

Previous page Next page

[1] BitmapMaps will make an internal library of .tif files and their actual content after opening each file once. The library is stored as 'tifdic.jls'.
[2] Gimp could open a geotiff file directly, and can save it without destroying the metadata which makes these files more than image files. However, it only displays 256 shades of grey at a time - the rest will be "darker than black, whiter than white". See inline docs ?edit_in_gimp and heed the warnings, or you may easily mess up the tiny variations in smoothness and curvature which BitmapMaps uses to identify various surface types.
[3] Most often, a map will have multiple sheets, each with its own folder. In this example, we use only one. There is no hard limit on how many pixels you could fit on a sheet, but some of the calculations we do will take impractically long to finish when there is too much information on one sheet. When divided properly, wall- or book-sized printed maps are unproblematic.
[4] 1] Copy the template from ~/.julia/packages/BitmapMaps/–-/resource/index.html
    to ~/BitmapMaps/Stetind/index.html
2] Open .html file in a text editor, change the 'defaultSvgFile' value to point to your .svg file.
3] Start a local server in that directory from Julia, e.g. using LiveServer.
Note that the .html page uses Timmy Willison's 'Panzoom.js', which will download automatically.

CC BY-SA 4.0 hustf. Last modified: April 18, 2025. Website built with Franklin.jl and the Julia programming language.