Jump to content

Википедиа:Graphic Lab/Resources/Wikimaps atlas/Lesson 1

Мавод аз Википедиа — донишномаи озод

master.makefile (0%)

[вироиши манбаъ]

Action: When run, this master.makefile runs other layer-specialized sub-makefiles. These sub-makefiles download the GIS sources, process them, output topojson file(s) which nodejs, jsdom, and D3js code can convert into stand alone SVGs.

master.makefile
Example
cd ./home/.../wikimaps/
make -f master.makefile WEST=-5.8 NORTH=51.5 EAST=10.0 SOUTH=41.0 ITEM=France


Parameters:

  • WEST=... : Western most longitude value of the frame to map. Accept integer between 90.0⁰ & -90.0⁰.
  • NORTH=... : Northern most latitude value ————. ————.
  • EAST=... : Eastern most longitude value ————. ————.
  • SOUTH= ... : Southern most latitude value ————. ————.
  • ITEM= ... : name of the target/central geographic item, according to Natural_Earth spelling.

shadedrelief.makefile (100%)

[вироиши манбаъ]

Action: When run, this shadedrelief.makefile download the raster GIS DEM sources, process them (unzip, crop, shaded relief, resize), to output an elegant shaded relief png (current) or topojson/svg.

shadedrelief.makefile
# ACTION: 
# When run, this shadedrelief.makefile download the raster GIS DEM sources, process them (unzip, crop, shaded relief, resize), to output an elegant shaded relief png (current) or topojson/svg.
# RUN:
#	cd ~/wikimaps/
#	make -f shadedrelief.makefile WEST=-5.8 NORTH=51.5 EAST=10.0 SOUTH=41.0 ITEM=France
# SOURCES:
#	http://www.imagemagick.org/script/command-line-options.php#alpha

#--------------------------------------------------------------------------

#DEFAULT VALUES (customizable):
WIDTH=1500
FUZZ=7
#MAKEFILE
progressive_transparency: grey_wiping
	convert shadedrelief.grey_no.png -alpha copy -channel alpha -negate +channel $(ITEM).shadedrelief.trans.png

grey_wiping: resizing
	convert $(ITEM).shadedrelief.grey.png -fuzz $(FUZZ)% -transparent "#DDDDDD" shadedrelief.grey_no.png

resizing: shading
	convert shadedrelief.tif -resize $(WIDTH) $(ITEM).shadedrelief.grey.png

shading: crop
	gdaldem hillshade crop.tif shadedrelief.tif -z 5 -s 111120 -az 315 -alt 60

#---- Crop
crop: unzip
	gdal_translate -projwin $(WEST) $(NORTH) $(EAST) $(SOUTH) ETOPO1_Ice_g_geotiff.tif crop.tif  #ETOPO1_Ice_g_geotiff.tif
	# ulx uly lrx lry (geodegrees)  // W N E S #todo: add name parameter

#---- Download
unzip: download
	unzip -n ../data/ETOPO1/ETOPO1.zip '*.tif' #-n: no overwrite if exist;
	touch ETOPO1_Ice_g_geotiff.tif

download: clean
	curl -o ../data/ETOPO1/ETOPO1.zip 'http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/georeferenced_tiff/ETOPO1_Ice_g_geotiff.zip'

clean:  
	# task commands to improve!
	echo "hello" > fakefile.ext
	rm `ls | grep -v '.makefile'| grep -v '.tif'`
Example
cd ~/wikimaps/
make -f shadedrelief.makefile WEST=-5.8 NORTH=51.5 EAST=10.0 SOUTH=41.0 ITEM=France

topography.makefile (0%)

[вироиши манбаъ]

Action: When run, this topography.makefile download the raster GIS DEM sources, process them (unzip, crop, slice, polygonize, merge), to output an elegant topographic stack topojson or svg file.

topography.makefile
[...]
Example
cd ./home/.../wikimaps/
make -f topography.makefile WEST=-5.8 NORTH=51.5 EAST=10.0 SOUTH=41.0 ITEM=France

The table above has links to various tutorials and resources which can help in the creation of Wikipedia maps from digital georeferenced data (GIS).