Home

Awesome

Wikimaps-D3js Atlas -- A command line utility to convert massive GIS sources into elegant administrative and topographic raster, topojson files and web friendly svg maps.

Wikimaps-D3js Atlas takes the power of GIS to the hands of web developpers, graphists, journalists and online readers. A single command let you process super heavy GIS sources such open source administrative NaturalEarth shapefiles and topographic ETOPO/SRTM tifs into light geojson, TopoJSON and SVG files optimized for screens display. XML shapes and groups of shapes keep the most relevant data-attributes (name, iso_2, hasc code, population and others) allowing rich data binding while the graphic aspect keeps up to modern expectations. We believe our topojson and svg files to be the finest available online due to the smart selection and presence of these data attributes easing data binding.

Use case

# Generate map for India 
make -f master.makefile NAME=India ISO2=IN WEST=67.0 NORTH=37.5 EAST=99.0 SOUTH=05.0 WIDTH=1280
# Generate maps for all countries. /!\ : May take half a day.
bash ./script/world_atlas_generator.bash ./script/world_atlas_commands.txt 
Topographic-AdministrativeAdministrative
<img src="doc/WikimapsAtlas-Admin_topographic_relief.png" width="300" float="center"><img src="doc/WikimapsAtlas-Admin_relief.png" width="300" float="center">
TopographicAdministrative localisator
<img src="doc/WikimapsAtlas-Topographic.png" width="300" float="center"><img src="doc/WikimapsAtlas-Localisator.png" width="300" float="center">

Constitutives components (raster, topojson) and derivated variations (jpg, png, svg) are gathered into /output/{Country_name}/, as for India it represent about 70 files.

To custom the styles, edit ./js/wikiatlas.js's "CSS MODULE", and ./01_topography/ relative color ramps.

Requirements

CPU :

Disk space :

Environment :

System dependencies :

Install

On Linux Ubuntu, run the following:

git clone https://github.com/WikimapsAtlas/WikimapsAtlas-generator.git  #get code
cd ./WikimapsAtlas-generator
npm install	 # install node dependencies and system dependencies. May need sudo.
npm run data     # download ETOPO1, NaturalEarth data (default). See ./package.json & data.makefile
# npm run dataplus # download SRTM250, SRTM90, GADM2 data (precise). See ./package.json & data.makefile

On OS X use Homebrew's brew install <program>. (Are you on Mac ? Help us to write this section.).

Projections and dimensions

Per default, output files have the following characteristics:

Custom projection is possible but not yet implemented. See issue 1.

Run

Modules explained

Wikimaps Atlas is usually run via the master.makefile, which pass variables to sub-module makefiles generating suit of cropped shp, rasters images, topojson and svgs. Modules can be ran independently as well.

Master: When run, the master.makefile runs other layer-specialized sub-makefiles. These sub-makefiles process GIS sources, output topoJSON file(s) which nodejs, jsdom, and D3js convert into stand alone SVGs stored in the ./output folder.

Topography & reliefs: When run, the topography.makefile download the raster GIS DEM sources, process them (unzip, crop, slice, polygonize, merge), to output an elegant topographic stack of polygons, topojson and WP styled SVG files.

Hillshade relief: When run, the hillshade.makefile process SRTM sources via crop, hillshading relief, resize, color relief, to output elegant shaded relief png/jpg (current) and topojson/svg.

Administrative: When run, the administrative.makefile processes the administrative L0 (countries), L1 (subunits), disputed areas and cities (places) GIS sources via unzip, crop, filter, to output elegant topojson files.

Water: When run, the water.makefile processes the rivers and lakes GIS sources via unzip and crop, to output elegant topojson files.

D3 (svg generator): When run, the d3.makefile queries the previously generated jpg, png, and topojson in order to create D3js svg visualisations, then printed into stand alone .svg files.

Example

# master
make -f master.makefile NAME=India ISO2=IN WEST=67.0 NORTH=37.5 EAST=99.0 SOUTH=05.0 WIDTH=1280
# 1. topography raster & vector
make -f master.makefile topography NAME=India ISO2=IN WEST=67.0 NORTH=37.5 EAST=99.0 SOUTH=05.0 SLICES=8
# 2. hillshade module
make -f master.makefile hillshade  NAME=India ISO2=IN WEST=67.0 NORTH=37.5 EAST=99.0 SOUTH=05.0 SLICES=8
# 3. administrative module
make -f master.makefile administrative NAME=India ISO2=IN WEST=67.0 NORTH=37.5 EAST=99.0 SOUTH=05.0
# 4. water module
make -f master.makefile water NAME=India ISO2=IN WEST=67.0 NORTH=37.5 EAST=99.0 SOUTH=05.0
# 5. d3 module (depend on 1,2,3,4)
make -f master.makefile d3    NAME=India ISO2=IN WEST=67.0 NORTH=37.5 EAST=99.0 SOUTH=05.0

API

This API is inspired by ogr2ogr, topojson, gdal, and convert (imageMagick) APIs. Elements are ordered by order of apparition, from master, to administrative, to shaded relief, to topography.

Commonly used:

Advanced use:

Under consideration:

Note:

Ouput

Generated files are moved into ./output/<NAME>/.

Constitutive elements

Files below are generated as intermediate steps before the svg maps creation.

Attributes

Whenever available, these elements are transmitted into the final topojson files :

End products

Files below are complete web friendly maps.

We here mirror best practices refined by Wikipedia's cartographers over the past 10 years.

Reference

Tools

Help

Report issues or ideas on github.

Authorship

Supports:

Licence

MIT License or CC-by-sa-3.0 — LOPEZ Hugo (Yug), for the Wikimedia Foundation.