GeoLayout

Extensions and customization
Alexis Jacomy
Gephi Plugin Developer
Posts: 8
Joined: 11 Dec 2009 12:22
Contact:

GeoLayout

Post by Alexis Jacomy » 14 May 2010 17:13

Hi all,

This thread is related to the new Gephi plugin, GeoLayout (here is the homepage: http://bit.ly/bflTBU). I heard that some people would be interested in a plugin like this, so you can ask your questions here.

Currently, the available projections are Mercator, Transverse Mercator, Miller cylindrical, Gall-Peters, Sinusoidal and Lambert cylindrical, but it's pretty easy to add some more from the formulae (x,y) = f(latitude,longitude) (most are available at http://bit.ly/2DVjQa).

So, for any question or suggestion (other useful projections/features, bugs, what next,...), here is the place!

User avatar
mbastian
Gephi Architect
Posts: 728
Joined: 10 Dec 2009 10:11
Location: San Francisco, CA

Re: GeoLayout

Post by mbastian » 14 May 2010 21:10

That is wonderful work. I'm sure that will be one of the most downloaded plugin!

I noticed an issue, the layout doesn't seem to work until I change the projection in the Projection Combo Box. Also I think checking the 'Center' checkbox by default would make more sense.

I used the airlines network dataset to see how it fits to the USA map from Google Maps. I used Mercator projection and it works well :-)

I attach the GraphML file with latitude and longitude, you can play with.
geolayout-airlines.png
I'm curious to see your plugin applied to real datasets, lots of fun I guess. Congrats!
Attachments
airlines.graphml.zip
(14.28 KiB) Downloaded 2095 times

Alexis Jacomy
Gephi Plugin Developer
Posts: 8
Joined: 11 Dec 2009 12:22
Contact:

Re: GeoLayout

Post by Alexis Jacomy » 14 May 2010 22:29

Oups, sorry for this, it has been fixed (it was an "orthographical" issue), and I agree with you about the initial value of center, so this has been changed to "true" (more user friendly, it prevents to search for the graph after the layout). The fixed version has been already uploaded. And thanks for the feedback!

quantanglement
Posts: 1
Joined: 22 Jun 2010 15:48

Re: GeoLayout

Post by quantanglement » 22 Jun 2010 15:57

Hi,

I'm new to Gephi (and XML, and this sort of network analysis in general). I'm trying to use GeoLayout to plot migration patterns across the U.S. I have an MS Excel file which contains the nodes, edges, the latitude/longitude coordinates of the nodes, and a column containing the edge attributes (which is a number which corresponds to the weighted number of individuals who move from one node to another).

Since the dataset I have is hierarchical-panel data, it is a huge file. Can someone provide some guidance on how to get/import this data into Gephi and use GeoLayout to plot it?

Any assistance is greatly appreciated!

Alexis Jacomy
Gephi Plugin Developer
Posts: 8
Joined: 11 Dec 2009 12:22
Contact:

Re: GeoLayout

Post by Alexis Jacomy » 22 Jun 2010 18:34

quantanglement wrote:Hi,

I'm new to Gephi (and XML, and this sort of network analysis in general). I'm trying to use GeoLayout to plot migration patterns across the U.S. I have an MS Excel file which contains the nodes, edges, the latitude/longitude coordinates of the nodes, and a column containing the edge attributes (which is a number which corresponds to the weighted number of individuals who move from one node to another).

Since the dataset I have is hierarchical-panel data, it is a huge file. Can someone provide some guidance on how to get/import this data into Gephi and use GeoLayout to plot it?

Any assistance is greatly appreciated!
This thread is about the GeoLayout itself more than about the import/export questions (I think the place of your question is more here).

Nevertheless, you do not have to use necessarily an XML format (like GEXF) to import a graph with Gephi since Gephi can import CSV or GDF files (and some other formats here). It will probably require some do-it-yourself with Notepad++ (or equivalent) on a CSV export of your data, but it might be easier for you to use one of these formats (also, if you need examples of GDF and CSV files, you can directly export any graph you want from Gephi to this format).

Also, as soon as you can import your data in Gephi, including the latitude and longitude attributes, there might not be any problem to use GeoLayout on your graph.

Alexis.

User avatar
mbastian
Gephi Architect
Posts: 728
Joined: 10 Dec 2009 10:11
Location: San Francisco, CA

Re: GeoLayout

Post by mbastian » 22 Jun 2010 19:42

Hi, your problem fits to exporting your data in the GDF format, which looks like CSV.

So first export your node table as CSV (with coma as separator) and then edit your file in a text editor. Add a header like below:

Code: Select all

nodedef>name VARCHAR,label VARCHAR, latitude DOUBLE, longitude DOUBLE
The name column is basically your id, that your edge table uses.

Then export your edge table in CSV as the two first columns are the pair of nodes identifiers and the third is the weight. Append this to your GDF file and add the following header in between:

Code: Select all

edgedef>node1 VARCHAR,node2 VARCHAR, weight DOUBLE
You can add more attributes as columns also, Gephi will import them. To have the geolayout working, the latitude and longitude columns should be DOUBLE type.

maustwick
Posts: 1
Joined: 15 Jul 2010 10:17

Re: GeoLayout

Post by maustwick » 15 Jul 2010 10:28

Hi all

My first post, so congratulations to everyone on a fantastic tool (both Gephi and GeoLayout).

I found that explanation of formatting GDF file *very* helpful, thank you; now, how did you produce the image with the US map behind it? Did you have to export into some kind of KML format and reopen the file or can you create the background map directly in the UI of GePhi?

Thanks!

User avatar
mbastian
Gephi Architect
Posts: 728
Joined: 10 Dec 2009 10:11
Location: San Francisco, CA

Re: GeoLayout

Post by mbastian » 15 Jul 2010 22:57

I found that explanation of formatting GDF file *very* helpful, thank you; now, how did you produce the image with the US map behind it? Did you have to export into some kind of KML format and reopen the file or can you create the background map directly in the UI of GePhi?
I simply exported the graph as SVG and put the US map behind in Illustrator :)

User avatar
rotten
Posts: 34
Joined: 27 Aug 2010 14:42
Location: Columbus, Ohio

Re: GeoLayout

Post by rotten » 22 Dec 2010 23:11

I was experimenting with GeoLayout this afternoon (in 0.7 Beta) and imported a graph with no edges. (Just a bunch of locations around the world. (I was playing with sizing the nodes based on data about those locations.)

I'm trying to put several thousand nodes over a map. Thus far I've tried it with Protovis http://vis.stanford.edu/protovis/, and it worked, but the results were way too slow. So then I tried it with OpenLayers http://openlayers.org solution. That was even slower(!).

Gephi hardly bats an eye at laying out and allowing exploration of a few thousand nodes. Performance is great. I just need a map behind it.

SVG export and PDF export both threw NPE's.

FWIW, the GEXF export didn't throw an NPE however GexfExplorer didn't like it.

Are there any other ways to put a map behind the dots? (I can change my background color, it would be great if I could set a background map or image instead.)

I could try a screen shot and then image editing software. I'm not sure that is the best solution - if I just wanted that I could just take a screenshot of the Protovis or OpenLayers solutions. The problem is I'd like to be able to zoom in on areas of the graph, and pan around...


FYI - Save and reload as Gephi worked even though there were no edges. (As did all of the stats functions -- not that the results were all that interesting.).

admin
Gephi Community Manager
Posts: 964
Joined: 09 Dec 2009 14:41

Re: GeoLayout

Post by admin » 23 Dec 2010 10:55

Hi,

Please report the NPE's as bugs on launchpad: https://launchpad.net/gephi

SVG export is what you need, as we can't set background images.

cheers

Post Reply