KGeography/Making Maps: Difference between revisions

From KDE UserBase Wiki
No edit summary
No edit summary
Line 27: Line 27:
   
   
Important: All names (capital and division) must be in English.
Important: All names (capital and division) must be in English.
===Map file===
The map file is quite simple but laborious to create. It has to be in PNG format.
You can find some maps to transform at Cia Reference Maps. If no map fits your needs you can download the world pdf, take a screenshot of it and work from it.
Each division in the map should have one and only one color. To achieve this you can use image processing programs like The Gimp and Kolourpaint.
===Flags===
If you have used the flag tag you should provide a flag file. They have to be in PNG format and better if they are 300x200 pixels and you provide a SVG file for it. To obtain SVG flags of almost all countries in the world and some other divisions you can consult Sodipodi flags collection.
===How to test===
Before sending your map to me (see Contact section for details) you should test it to see it has not errors. To do it you have to do the following:
* Put the map description and map image file in $(KDEDIR)/share/apps/kgeography/
* Put the flag PNG files (if any) in $(KDEDIR)/share/apps/kgeography/flags
Once that has been done you should be able of opening your map from inside kgeography.
If you don't know which is your $(KDEDIR) type kde4-config --prefix in a shell.

Revision as of 10:02, 10 March 2011

A map in KGeography is formed at least by two files, one is the image of the map and another is the description of it.

Helper tool

Here you can find a tool made by Yann Verley to help him with the map of France. To see its usage simply execute it and see the help message, but it basically creates the .kgm from a plain text file and creates a file with the colors it has assigned to each division so you can fill the map according to them.

Description file

Its file extension is .kgm Should begin with <map> and end with </map>. Inside of that tags there should be:

  • <mapFile> and </mapFile>: the name of the file containing the map image. e.g: europe.png
  • <name> and </name>: the name of map. e.g: Europe
  • A <division> and </division> for each division in the map.

Each division has this tags:

  • <name> and </name>: the name of the division. e.g: Albania
  • <capital> and </capital>: the name of the capital of the division. e.g: Tirana
  • <ignore> and </ignore>: must be yes if the division should be ignored when asking for divisions in that map. This tag is optional e.g: Algeria has this tag set to yes in Europe map
  • <flag> and </flag>: the file containing the flag of the division. This tag is optional. Not needed for the divisions whose ignore tag is set to yes e.g: albania.png
  • <color> and </color>: the color the division has in the map.

The color is defined using three tags:

  • <red> and </red>: red component of the color. Valid values are between 0 and 255.
  • <green> and </green>: green component of the color. Valid values are between 0 and 255.
  • <blue> and </blue>: blue component of the color. Valid values are between 0 and 255.

It is convenient to create 2 or 3 false divisions like Water, Frontier and Coast and set them with ignore=yes.

Important: All names (capital and division) must be in English.

Map file

The map file is quite simple but laborious to create. It has to be in PNG format. You can find some maps to transform at Cia Reference Maps. If no map fits your needs you can download the world pdf, take a screenshot of it and work from it. Each division in the map should have one and only one color. To achieve this you can use image processing programs like The Gimp and Kolourpaint.

Flags

If you have used the flag tag you should provide a flag file. They have to be in PNG format and better if they are 300x200 pixels and you provide a SVG file for it. To obtain SVG flags of almost all countries in the world and some other divisions you can consult Sodipodi flags collection.

How to test

Before sending your map to me (see Contact section for details) you should test it to see it has not errors. To do it you have to do the following:

  • Put the map description and map image file in $(KDEDIR)/share/apps/kgeography/
  • Put the flag PNG files (if any) in $(KDEDIR)/share/apps/kgeography/flags

Once that has been done you should be able of opening your map from inside kgeography.

If you don't know which is your $(KDEDIR) type kde4-config --prefix in a shell.