Thanks both of you for help! I think I have enough to figure it out.
···
2015-05-19 10:46 GMT+02:00 Ben Laken [email protected]:
Hi Martin, I did something similar a while ago, so I wrote up my solution and pushed it to github for you.
It includes a few lines to automatically download the required shape file data to whatever (local) folder you run the script from.
I requires you to have a few packages like osgeo, but it should work as is, all you would need to do is use the name of your country in the highlighted line and it will show you how to pull out the shape from the shapeless and plot it for you. I didn’t retroject or anything like that, so if you want it in a different co-ordinate system (which is very doable with PROJ4 and Pyproj) you will need to add a bit more work.
Also, there are a few bugs in some countries, as I did a bit of a hack job, just pulling out polygons from the shape files (which is why some of the countries are missing over Africa). I didn’t solve this before as I was focused on Scandinavia.
Anyway, the code is at: https://github.com/benlaken/Nbks (Bokeh_CountryMaps.ipynb)
Best,
—Benjamin
………………………………………………………………………………
Dr. Benjamin A. Laken FRMetS
www.benlaken.com Skype ben.laken
Postboks 1047 Blindern, Tel.+47-2855827
0316, Oslo, Norway Twitter benlaken
On 19 May 2015, at 06:54, Sarah Bird [email protected] wrote:
Hi Martin,
I’m sorry I don’t have time to give you a more detailed answer. In my case I very crudely pulled the coordinates out of geojson Polygons (http://geojson.org/geojson-spec.html#id4) & Multipolygons (http://geojson.org/geojson-spec.html#id7). You can see the code here: https://github.com/birdsarah/pycon_2015_bokeh_talk/blob/master/washmap/main/utils.py#L43
The core bokeh examples (http://bokeh.pydata.org/en/latest/docs/gallery/choropleth.html & http://bokeh.pydata.org/en/latest/docs/gallery/texas.html) have data from a different source where it was slightly easier to pull it out.
I know that having better mapping support is something people want, but it’s not super easy just yet.
Best,
Bird
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CA%2BEr%2BdRUS_hzw0VSZMFSPyHHje2ZRe%3DhwoE4TJO-cU6Dir1Uow%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/391510A0-63AF-4995-8FCA-74112DC12091%40gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
On Mon, May 18, 2015 at 4:31 AM, Martin Frlin [email protected] wrote:
Thank you for the pointers in the code but could you also tell me some keywords to google the original data I need?
For example in the table we see that there are a lot of xs and ys which are some kind of coordinates. I believe glyphs representing each country in Africa are constructed from those coordinates. Could you tell me what those are and how do I find/construct them?
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CAMgiKoyuKncevt14dD9V_Zqf9LvPhAVqyGSPjABRE%2BAAhE6uPA%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
2015-05-18 2:36 GMT+02:00 Sarah Bird [email protected]:
Hi Martin,
All the code for the talk is available: https://github.com/birdsarah/pycon_2015_bokeh_talk/.
In particular, the map construction is here:
https://github.com/birdsarah/pycon_2015_bokeh_talk/blob/master/washmap/washmap/washmap_static.py#L38
and the function construct_map:
https://github.com/birdsarah/pycon_2015_bokeh_talk/blob/master/washmap/washmap/water_map.py#L24
but the hard thing is getting the data in the right shape…you can browse around to see all the code that does that, but you can see the table here:
http://nbviewer.ipython.org/github/birdsarah/pycon_2015_bokeh_talk/blob/master/notebooks/Building%20the%20static%20visualization.ipynb
Hope that helps,
Sarah Bird
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CA%2BEr%2BdR6Nu5ewwc%3DvPfLx5D-LM6H%2BvoxUbPn%2Bd1%2Bnkyu4Wi-Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
On Sat, May 16, 2015 at 1:04 PM, [email protected] wrote:
I’ve searched but were unable to find how do I create a map for my country.
The example US and Texas maps are already made and you only need to import them, but how do I make my own maps?
I’ve also seen example with the map of Africa https://github.com/birdsarah/pycon_2015_bokeh_talk but I am also lost on how that map was constructed.
Any help appreciated.
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/21a6d8aa-b1fc-464b-b21e-e86f01ccab94%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.