Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Haacker

A library of scripts to generate static maps using open source technology.

Background

Purpose

This library was originally developed to support the design process of a printed butterfly map. You can find out more about the map itself in the related detailed documentation.

preview of the butterfly map

Naming

The library is named after Hermann Haack, a german cartographer.

Installation

Install the requirements by running npm install in the root directory.

Additional Requirements

If you want to process the ETOPO1 data, make sure that GDAL is installed on your machine.

Included tools

ETOPO1 Data Processing (process-etopo1-data)

TLDR: A Shell script that downloads and prepares the elevation data for the mapping process. Delivers a set of GeoJSONs for different elevation levels. Run it with npm run process-etopo1-data in the root directory.

If a map should contain elevation levels, data from a digital elevation model (DEM) is needed. The NOAA provides such a model in the GeoTIFF format. This file can be processed to a series of GeoJSONs that can be used by D3 to generate a map.

This shell script automatically downloads the GeoTIFF dataset and converts it to GeoJSON files. The script can be called with the command npm run process-etopo1-data in the root directory. By default, it generates GeoJSONs for each hundred meter level, starting from -10,000 meters (sea ground) to 9,000 meters (Himalaya). The resulting files are therefore:

  • -10000.geojson (lowest sea level)
  • -9900.geojson
  • many more sea level files…
  • -100.geojson
  • 0.geojson (first landmass file)
  • 100.GeoJSON
  • many more landmass files…
  • 9000.GeoJSON

These settings can be tweaked in the section your settings in the file process-etopo1-data/main.sh.

Attention: Depending on the settings and your machine, this script might take several hours to run!

Map Layer Generation (render-map-layer)

A node application that renders a map layer for given GeoJSON data. Uses d3 and it's projections.

The map generation is controlled with a config file, see the file config.example.js as an example. The config file sets the map’s dimensions and layers.

Layer types

The tool supports these layer types:

  • filled — a filled layer, consisting of a a single GeoJSON
  • stroked — an outlined layer, consisting of a a single GeoJSON
  • levels — a series of filled levels, consisting of a set of GeoJSONs

Properties

filters

Filter the levels based on their height. Provide an array with filter functions as you would do in a JS .filter function. E.g., use filters: [level => level > 0] to only render layers above the sea level.

`domain``

: ["min", 0, "max"],

Please see the config.example.js for a reference how to use these layers. The config files need to be placed in the folder render-map-layer. To run the script, use the command npm run render-map-layer in the root directory. By default, the script will look for a config.js file in the folder render-map-layer. If you want to use another file, provide it's name as a argument like this: npm run render-map-layer my.special.config.

Map Label Generation (render-map-label)

A node application that renders map labels as SVG for given GeoJSON data.

This works similar to the render-map-layer script. It also uses a config.js file. To run the script, use the command npm run render-map-label in the root directory.

The script outputs SVG files with labels and dots in the desired projection. It was only tested and is optimized for files from Natural Earth.

Map Cutline Generation (render-map-cutline)

A node application that creates a cutline as SVG for a map.

This works similar to the render-map-layer script. It also uses a config.js file. To run the script, use the command npm run render-map-cutline in the root directory.

Central folders

By default, the tools use a common data folder at data. Exported maps are saved in the folder export. Also, a folder called temp is used in the root directory for temporary files.

About

A library of scripts to generate static maps using open source technology.

Resources

Releases

No releases published

Packages

No packages published