Википедиа:Graphic Lab/Resources/Wikimaps atlas/Lesson a1
Ubuntu/Linux
[вироиши манбаъ]- The project is prototyped with and currently requires Linux/Ubuntu
Installing MAKE
[вироиши манбаъ]MAKE is an utility helping to serialized shell commands while stating the pre-required elements for each of these commands. As such, running a well conceived makefile
allow to reproduce a complexe tree-like network of commands, in the right order, despite several starting points and bricks required for a final output or group of outputs. To install MAKE:
sudo apt-get install make #for linux>Ubuntu
Therefore, Wikiatlas modules use a makefiles to gather all commands to perform on the relevant GIS data, raster or shapefiles, from downloading the source GIS file to generating the final SVG or bitmap map file.
How to use makefiles
[вироиши манбаъ]- 1. Create a directory :
mkdir ~/wikiatlas #aka /home/<username>/wikiatlas
- 2. Copy a valid MAKE code from Wikipedia
- 3. In directory > save code as text file
script.makefile
- 4. Terminal > get to relevant folder & run the makefile
cd ~/wikiatlas # get terminal on right directory
make -f script.makefile # run the target makefile (here with 0 parameters)
Installing utilities
[вироиши манбаъ]For the whole "Wikimaps Atlas: stand alone" system, bellow are the list of required utilities and a valid makefiles version of it.
Commands to run | To save as utilities.makefile
|
---|---|
success: utilities something low_level nodejs #a task with 4 requirements
echo "======================================" #this is the 1st command
echo "Wikiatlas setup: done --------> 100% !"
#tab before each command is COMPULSORY (spaces will bug!).
utilities: # a task with no dependency
sudo apt-get install make curl unzip unrar gdal-bin
something:
sudo apt-get install build-essential #comment, is this needed ?
nodejs: #for d3js & svg generation
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo npm install -g topojson jsdom
low_level: #for more advanced coding
sudo apt-get install python-software-properties python g++
| |
To do | To do |
(copy-paste in terminal) | run mkdir ~/wikiatlas
cd ~/wikimaps
make -f utilities.makefile
|
Utilities:
- make - GNU make utility to maintain groups of programs
- curl - utility to downaload URLs
- unzip - list, test and extract compressed files in a ZIP archive
- gdal? - a translator library for raster geospatial data formats, comes with a variety of useful commandline utilities for data translation and processing. www.gdal.org
- gdaldem - gdaldem Tools to analyze and visualize DEMs.
- ogr2ogr - ogr2ogr converts simple features data between file formats
- gdal_polygonize.py - creates vector polygons for all connected regions of pixels in the raster sharing a common pixel value.
- gdal_calc.py - command line raster pixels calculator with numpy syntax
- convert - convert images for formats, size, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and more. http://www.imagemagick.org/script/convert.php
- node - Server-side JavaScript with helpful internal librairies
- topojson - NPM command-line application for converting data to the TopoJSON format. https://github.com/mbostock/topojson/wiki/Command-Line-Reference
- jsdom - NPM module to generate webpage on serverside, and to output console.log into real files.
- D3js - D3.js is a JavaScript library for manipulating HTML-CSS documents based on data. https://github.com/mbostock/d3/wiki/API-Reference
Action: When run, utilities.makefile
downloads and installs one after another the needed scripts and dependencies required by Wikiatlas, either stand alone and server versions.
See also
[вироиши манбаъ]The table above has links to various tutorials and resources which can help in the creation of Wikipedia maps from digital georeferenced data (GIS).