Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Generating map using python #8

Open
AgentSource opened this Issue · 2 comments

3 participants

AgentSource Kirill Lebedev James Boelen
AgentSource

Rig info:

Mac OS X 10.6.8
Python 3.2.2

Have issues creating a map, I have tried a few times in terminal and I keeps spitting back variables it doesn't like or won't run what so ever. The fallowing snippet it the command I run to attempt to create the map.

python \
converter.py \
mn.shp \
mnmap.js \
--width 900 \
--country_name_index 4 \
--where "ISO = 'USA'" \
--codes_file path/to/codes-en.tsv \
--insets '[{"codes": ["US-AK"], "width": 200, "left": 10, "top": 370}, {"codes": ["US-HI"], "width": 100, "left": 220, "top": 400}]' \
--minimal_area 4000000 \
--buffer_distance -3000 \
--simplify_tolerance 1000 \
--longtitude0 10w \
--name us

I apologize in advance if I'm missing something.

Kirill Lebedev

Actually this library doesn't include converter. The one which does is https://github.com/bjornd/jvectormap. What error do you have? It should work with Python 2.7, GDAL Shapely and anyjson installed.

James Boelen

I ended up editing the converter that @bjornd provides with his project to make it work properly with this one. As I'm sure others will need the same information, the command that I use to generate maps from the NaturalEarth Data (1:110m) is as follows:

 python converter.py \
      ne_110m_admin_0_countries.shp \
      result.js \
      --width 900 \
      --country_name_index 14 \
      --country_code_index 26 \
      --minimal_area 4000000 \
      --buffer_distance -3000 \
      --simplify_tolerance 1000 \
      --longtitude 11.5 \
      --name world

I would however really appreciate knowing what arguments were used to create the maps featured on the jqvmap site. I like a) how small it is (60Kb vs 130~Kb) and b) The cartoon-esque profile of the country boundaries.

If anyone is looking for my version of the converter, I have it in a personal fork jboelen/jqvmap@a85f3f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.