An automated d3 map maker in python
Python
Switch branches/tags
Nothing to show
Latest commit ecc7855 May 24, 2013 @climboid Update README.md
Permalink
Failed to load latest commit information.
README.md Update README.md May 24, 2013
fetch.py first push Feb 25, 2013
index.html first push Feb 25, 2013

README.md

d3MapMaker

There is currently a bug I'm fixing that prevents rendering of the chart, please do not download this repo.

An automated SVG map maker built with Python and d3.js

Instructions

You need to install the (GDLA) Geo spatial Data Abstraction Library. Mac users download from this link

Once you have downloaded GDAL install the complete package.

Create a repo for this map

  
    mkdir myMap
  

Cd to that repo

  
    cd myMap
  

Run the python script

  
    ./fetch.py
  

You will then be prompted to enter the name of the country that you want a map of. Type it in, hit enter and that should be it.

This will create the geoJSON object that the index.html file is expecting in order to render a map.

Once the geoJSON file is there the script will launch a localhost on port 7777 opening up the index file with your country.

Currently supports python verstion 2.7.2

Supported countries

  • Afghanistan
  • Aland Islands
  • Albania
  • Algeria
  • American Samoa
  • Andorra
  • Angola
  • Anguilla Island
  • Antarctica
  • Antigua and Barbuda
  • Argentina
  • Armenia
  • Aruba
  • Australia
  • Austria
  • Azerbaijan
  • Bahamas
  • Bahrain
  • Bangladesh
  • Barbados
  • Belarus
  • Belgium
  • Belize
  • Benin
  • Bermuda
  • Bhutan
  • Bolivia
  • Bosnia and Herzegovina
  • Botswana
  • Bouvet Island
  • Brazil
  • British Indian Ocean Territory
  • British Virgin Islands
  • Brunei Darussalam
  • Bulgaria
  • Burkina Faso
  • Burundi
  • Cambodia
  • Cameroon
  • Canada
  • Cape Verde
  • Cayman Islands
  • Central African Republic
  • Chad
  • Chile
  • China
  • Christmas Island
  • Cocos Islands
  • Colombia
  • Comoros
  • Congo Republic of
  • Congo The Democratic Republic of the
  • Cook Islands
  • Costa Rica
  • Cote d'Ivoire
  • Croatia
  • Cuba
  • Cyprus
  • Czech Republic
  • Denmark
  • Djibouti
  • Dominica
  • Dominican Republic
  • Ecuador
  • Egypt
  • El Salvador
  • Equatorial Guinea
  • Eritrea
  • Estonia
  • Ethiopia
  • Falkland Islands
  • Faroe Islands
  • Fiji
  • Finland
  • France
  • French Guiana
  • French Polynesia
  • French Southern Territories
  • Gabon
  • Gambia
  • Georgia
  • Germany
  • Ghana
  • Gibraltar
  • Greece
  • Greenland
  • Grenada
  • Guadeloupe
  • Guam
  • Guatemala
  • Guernsey
  • Guinea
  • Guinea-Bissau
  • Guyana
  • Haiti
  • Heard Island and McDonald Islands
  • Honduras
  • Hongkong
  • Hungary
  • Iceland
  • India
  • Indonesia
  • Iran
  • Iraq
  • Ireland
  • Isle of Man
  • Israel
  • Italy
  • Jamaica
  • Jersey
  • Japan
  • Jordan
  • Kazakhstan
  • Kenya
  • Kiribati
  • Kosova
  • Kuwait
  • Kyrgyzstan
  • Laos
  • Latvia
  • Lebanon
  • Lesotho
  • Liberia
  • Libya
  • Liechtenstein
  • Lithuania
  • Luxembourg
  • Macao
  • Macedonia
  • Madagascar
  • Malawi
  • Malaysia
  • Maldives
  • Mali
  • Malta
  • Marshall Islands
  • Martinique
  • Mauritania
  • Mauritius
  • Mayotte
  • Mexico
  • Micronesia Federated States of
  • Moldova
  • Monaco
  • Mongolia
  • Montenegro
  • Montserrat
  • Morocco
  • Mozambique
  • Myanmar
  • Namibia
  • Nauru
  • Nepal
  • Netherlands
  • Netherlands Antilles
  • New Caledonia
  • New Zealand
  • Nicaragua
  • Niger
  • Nigeria
  • Niue
  • Norfolk Island
  • North Korea
  • Northern Mariana Islands
  • Norway
  • Oman
  • Pakistan
  • Palau
  • Palestina
  • Panama
  • Papua New Guinea
  • Paraguay
  • Peru
  • Philippines
  • Pitcairn Islands
  • Poland
  • Portugal
  • Puerto Rico
  • Qatar
  • Reunion
  • Romania
  • Russian Federation
  • Rwanda
  • Saint Helena
  • Saint Kitts and Nevis
  • Saint Pierre and Miquelon
  • Saint Vincent and the Grenadines
  • Samoa
  • San Marino
  • Santa Lucia
  • Sao Tome and Principe
  • Saudi Arabia
  • Senegal
  • Serbia
  • Seychelles
  • Sierra Leone
  • Singapore
  • Slovakia
  • Slovenia
  • Solomon Islands
  • Somalia
  • South Africa
  • South Georgia and the South Sandwich Islands
  • South Korea
  • Spain
  • Sri Lanka
  • Sudan
  • Suriname
  • Svalbard and Jan Mayen
  • Swaziland
  • Sweden
  • Switzerland
  • Syria
  • Taiwan
  • Tajikistan
  • Tanzania
  • Thailand
  • Timor-Leste
  • Togo
  • Tokelau
  • Tonga
  • Trinidad and Tobago
  • Tunisia
  • Turkey
  • Turkmenistan
  • Turks and Caicos Islands
  • Tuvalu
  • Uganda
  • Ukraine
  • United Arab Emirates
  • United Kingdom
  • United States
  • United States Minor Outlying Island
  • Uruguay
  • Uzbekistan
  • Vanuatu
  • Vatican
  • Venezuela
  • Vietnam
  • Virgin Islands U.S
  • Wallis and Futuna
  • Western Sahara
  • Yemen
  • Zambia
  • Zimbabwe

Todos

  1. Make the dictionary of countries more robust to handle special characters, partial type ins etc.
  2. If the user types in an error make sure to catch it
  3. Some countries do not have regions only the country outlyer, add the option to fetch all availble shp files for a given country

Credit

I want to thank Jan van der Laan and Mike Bostock for their full and comprehensive responses to my stack overflow questions. With out their answers I would have never figured the centering of the map and the scaling of it on my own... believe me I tried.