GSoC, Programming, Life !!

I am glad that I accomplished my first task to integrate political map with marble. :) . I finished its implementation last week.

Here is a look must1

The main feature I implemented is the support to specify different colors for different regions of map in .dgml file ( theme file for Marble ) . So, if the placemarks in map data file contains color indices then the placemarks are assigned different fill colors based upon the color index they have. The different color indices of placemarks are mapped to the colors you specify in theme file. Political map uses the same logic. So, one can customize the colors with which the countries are being colored by specifying the custom colors in theme file. Further to achieve this I also modified the pn2 format ( a memory efficient format that Marble uses to store map data ) to store color indices in it

must3

Other than this I fixed the issue of correctly determining inner and outer boundary of a polygon. I found this problem when I noticed that some of the countries are not being displayed on map and I need to zoom in to see them. This was the most challenging thing in whole task to figure out why it’s happening.  At last I tracked down this weird problem and fixed it. Meanwhile I also designed a patch for not parsing the map data file again on theme change ( if it has been parsed already ) if the new theme just changes the fill color or pen color, instead just change the style  info of placemark.

Currently you can browse through political map and get basic information ( like population, some basic history, area, flag etc. ) about a country by clicking on its name. The image below displays the information about Egypt :

must2

So, continuing my work this week I started working on highlighting a particular region on map when you click on it. I have designed an initial patch for it. Tosten and Dennis gave it a quick review and suggested me some changes. So, I need to fix them all first. Anyways, here is a quick view what it looks like ( Italy has been highlighted image below ) :

must4

So, I’ll be busy this week fixing the issues with ‘highlight on click’ patch. Stay tuned as more interesting feature to come ahead :-) .

About these ads

Comments on: "Political Map for Marble" (8)

  1. anonymous said:

    In your 4th image only part of the Italian territory is highlighted (islands like Sardinia and Sicily are excluded), is this intended?

    • Thanks for reporting. This is because the polygons containing the islands Sardinia and Sicily are in different placemarks than the placemarks containing the highlighted portion of Italy. That’s why clicking on the larger polygon applied highlighted style to only one placemark and left the placemarks containing Sardinia and Sicily with normal style. If all the polygons which constitute Italy in map are in same placemark then clicking anywhere on territory of Italy will highlight whole of Italy area. I’ll fix it. Thanks again.

  2. redsteakraw said:

    Is this going to be the basis for a Marble based Kgeogray and Krisk?

  3. Richard said:

    Thanks, for the update! :-)
    I noticed in the screenshots, that at least one color appears twice. Is the number of colors hardcoded or theme specific? In any case I think it should be increased.

    Also it would be nice if this could be used for federal states, too. E.g. you select one country and there would be an option to show the federal states of just that country.

    • Hi Richard, Thanks for suggestion. Yes, I agree that map would look nicer if we’re able to get more colors. Map data from naturalearthdata.com provides three versions of color indices – mapcolor7, mapcolor8, mapcolor9 and mapcolor13 . Also, mapcolor 7 has vaues in range [1,7] , mapcolor8 lies in range [1,8] and so on. We are using mapcolor13. So, at maximum I can map these color indices values to 13 different color. These color indices, in data file ,are written in way so that no two adjacent countries get same color. You can specify, in theme file, which 13 colors you want ( but the no. is currently restricted to 13 ). So, I’m afraid that we can’t increase color number until we find a way to assign countries color indices keeping the constraint that no adjacent countries get same color index.
      It would be great to have federal states for countries but IIRC currenlty naturalearthdata.com provides federal states data only for Unites States.

  4. […] GSoC project is to design an educational game using Marble . For that I have already designed a political theme for marble and it’s currently in git master ( and also in KDE/4.14 branch ). Based on this […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

Follow

Get every new post delivered to your Inbox.

Join 295 other followers

%d bloggers like this: