Skip to content

melalj/topojson-map-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TopoJSON Map Generator

This script that generates TopoJSON maps with one command line.

Prerequisites

  • Node 8 with NPM
  • GDAL

Usage

Script usage: ./generate.sh [OPTIONS]

  • -r | --resolution=<string> : Map resolution (10m, 50m, 110m) [default: 110m]
  • -a | --skip-antarctica : Remove Antarctica from the map [default: false]
  • -s | --include-states : Include States/Provinces lakes on the map [default: false]
  • -l | --include-lakes : Include Great lakes on the map [default: false]
  • -p | --include-projection : Embed projection into the topojson file
  • -c | --clean : Remove all generated maps and downloaded assets
  • -h | --help : Showing this useful message

Example

# Generate a topojson file at a 50m resolution, skipping antartica and including lakes
./generate.sh -r 50m -a -l

World Maps

The dataset comes from NaturalEarth

Preserved properties

  • NAME
  • CONTINENT
  • ISO_A2
  • ISO_A3

Projection

At the moment the only projection used on this script, when you add the parameter -p, is an equirectangular and a size 960x500:

width = 960, height = 500, d3.geo.equirectangular().rotate([-11.0, 0.0, 0.0]).scale(width /(2 * Math.PI)).translate([width / 2, height / 2])

You can edit it on the script if you targeting another projection. Here's [an example](Here's an example of where it's used) of where it has been used

Contribute

You are welcomed to fork the project and make pull requests. Be sure to create a branch for each feature!

About

Script that generates TopoJSON maps with one script

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages