Best way to plot data to a map?

520 views
Skip to first unread message

Mikayla Thompson

unread,
Jun 20, 2014, 9:43:26 AM6/20/14
to julia...@googlegroups.com
Hi everyone,

I'm new to Julia and trying it out for some data analysis projects with twitter data. 

In particular, I'd like to plot tweets to a map, using a different color/icon for various categories of tweet.  It'd also be useful to color various regions.  

Something similar to or wrapping d3.js would be perfect. I don't need the animation/interactive features, but they'd be useful if available. So far, I haven't been able to find any Julia packages that might work for something like this. Am I just overlooking it, or is there no such functionality at this point?

I'm aware that there is the matplotlib route.  I haven't had much luck in python with mapping using matplotlib, so I'm eager for an alternative. However, is that the most practical choice at this point?

Thanks!
--Mikayla

Jake Bolewski

unread,
Jun 20, 2014, 9:58:48 AM6/20/14
to julia...@googlegroups.com
The most practical choice would be to do all the data processing in Julia and then spit out your data in a text file, which could be read by any number of languages or tools.  I used R to do map plotting in the past this way.

Tim Holy

unread,
Jun 20, 2014, 10:31:58 AM6/20/14
to julia...@googlegroups.com
Gadfly has a d3 backend. But others will have to comment about whether it can
handle the mapping part.

--Tim

On Friday, June 20, 2014 06:43:25 AM Mikayla Thompson wrote:
> Hi everyone,
>
> I'm new to Julia and trying it out for some data analysis projects with
> twitter data.
>
> In particular, I'd like to plot tweets to a map, using a different
> color/icon for various categories of tweet. It'd also be useful to color
> various regions.
>
> Something similar to or wrapping d3.js would be perfect. I don't *need* the

Aerlinger

unread,
Jun 20, 2014, 4:05:36 PM6/20/14
to julia...@googlegroups.com
I don't believe there are currently any Julia packages that do this, but you could utilize or extend Gadfly's D3 engine with polymaps.js (http://polymaps.org/). Assuming you have a set of lat/lon pairs in GeoJSON, you could essentially create a function that transforms your lat/lon coordinates to those that would fit on a 2D canvas viewport.

This is essentially the approach that the ggmap R package called uses, which is built on top of ggplot2 (the equivalent of Gadfly for R). 

Let me know if you have any luck, I'm interested in this capability as well.

On Friday, June 20, 2014 9:43:26 AM UTC-4, Mikayla Thompson wrote:

Daniel Jones

unread,
Jun 20, 2014, 6:06:00 PM6/20/14
to julia...@googlegroups.com

There's not support for maps yet. But if someone wanted to develop a
package for handling geographical data, I'd be keen to make it
plot-able. I've not worked with this sort of data before, but I'm
guessing the main things we'd need are map projections and a database of
borders of countries, provinces, states, etc.

Aerlinger

unread,
Jun 20, 2014, 6:16:47 PM6/20/14
to julia...@googlegroups.com
Yeah, it will get complicated with polygon data for Country -> State -> Region -> Zipcode. I think the best place to start would be parsing a set Lat/Lon data (perhaps from GeoJSON, there are tons of examples onine), converting those lat/lon coordinates to 2D Cartesian coordinates within the canvas, then bounding and aligning the points on top of a bitmap/svg map such that it can be panned, zoomed etc. Then from there you could process sets of points to render polygonal data for choropleths, etc.
Reply all
Reply to author
Forward
0 new messages