KGeography/Making Maps: Difference between revisions
No edit summary |
(Marked this version for translation) |
||
(14 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
<languages /> | |||
<translate> | |||
==Making Maps== <!--T:1--> | |||
<!--T:2--> | |||
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. | |||
===Description file=== | <!--T:22--> | ||
{{Info|Please read [http://docs.kde.org/stable/en/kdeedu/kgeography/how-to-maps.html How to make maps] for up to date information}} | |||
===Helper tool=== <!--T:3--> | |||
<!--T:4--> | |||
[https://projects.kde.org/projects/kde/kdeedu/kgeography/repository/revisions/master/changes/tools/gen_map.pl Here] you can find a tool made by Yann Verley to help with the maps. 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=== <!--T:5--> | |||
<!--T:6--> | |||
Its file extension is .kgm | Its file extension is .kgm | ||
It should begin with <map> and end with </map>. | |||
Inside of that | Inside of that there should be the following tags: | ||
<!--T:7--> | |||
* < | * <nowiki><mapFile></nowiki> and <nowiki></mapFile></nowiki>: the name of the file containing the map image. e.g: europe.png | ||
* <nowiki><name></nowiki> and <nowiki></name></nowiki>: the name of map. e.g: Europe | |||
* < | * A <nowiki><division></nowiki> and <nowiki></division></nowiki> for each division in the map. | ||
* < | |||
<!--T:8--> | |||
Each division has these tags: | |||
<!--T:9--> | |||
* <nowiki><name></nowiki> and <nowiki></name></nowiki>: the name of the division. e.g: Albania | |||
* <nowiki><capital></nowiki> and <nowiki></capital></nowiki>: the name of the capital of the division. e.g: Tirana | |||
* <nowiki><ignore></nowiki> and <nowiki></ignore></nowiki>: 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 | |||
* <nowiki><flag></nowiki> and <nowiki></flag></nowiki>: 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 | |||
* <nowiki><color></nowiki> and <nowiki></color></nowiki>: the color the division has in the map. | |||
<!--T:10--> | |||
The color is defined using three tags: | 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. | <!--T:11--> | ||
* <blue> and </blue>: blue component of the color. Valid values are between 0 and 255. | * <nowiki><red></nowiki> and <nowiki></red></nowiki>: red component of the color. Valid values are between 0 and 255. | ||
* <nowiki><green></nowiki> and <nowiki></green></nowiki>: green component of the color. Valid values are between 0 and 255. | |||
* <nowiki><blue></nowiki> and <nowiki></blue></nowiki>: 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. | It is convenient to create 2 or 3 false divisions like Water, Frontier and Coast and set them with ignore=yes. | ||
Line 28: | Line 48: | ||
Important: All names (capital and division) must be in English. | Important: All names (capital and division) must be in English. | ||
===Map file=== | ===Map file=== <!--T:12--> | ||
<!--T:13--> | |||
The map file is quite simple but laborious to create. It has to be in PNG format. | 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 [https://www.cia.gov/ | You can find some maps to transform at [https://www.cia.gov/library/publications/the-world-factbook/docs/refmaps.html CIA Reference Maps]. If no map fits your needs you can download [https://www.cia.gov/library/publications/the-world-factbook/reference_maps/pdf/political_world.pdf 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 | 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 [[Special:myLanguage/KolourPaint|KolourPaint]]. | ||
===Flags=== | ===Flags=== <!--T:14--> | ||
<!--T:15--> | |||
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 [http://www.sodipodi.com/index.php3?section=clipart/flags Sodipodi flags collection]. | 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 [http://www.sodipodi.com/index.php3?section=clipart/flags Sodipodi flags collection]. | ||
===How to test=== | ===How to test=== <!--T:16--> | ||
Before sending your map to me you should test | |||
<!--T:17--> | |||
Before sending your map to [mailto:[email protected] me] you should test to make sure it does not have errors. To do it you have to do the following: | |||
<!--T:18--> | |||
* Put the map description and map image file in $(KDEDIR)/share/apps/kgeography/ | * 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 | * Put the flag PNG files (if any) in $(KDEDIR)/share/apps/kgeography/flags | ||
Once that has been done you should be able | Once that has been done you should be able to open your map from inside '''KGeography'''. | ||
If you don't know which is your $(KDEDIR) type kde4-config --prefix in a shell. | If you don't know which is your $(KDEDIR) type{{Input|1=kde4-config --prefix}}in a shell. | ||
===Non political maps=== | ===Non political maps=== <!--T:19--> | ||
Is it possible to do non-political maps? | |||
Of course, the division concept can be extended to a river or a mountain. In the making of the map you should keep in mind that most times the river or mountain will be too small that you should provide an additional clicking area. | <!--T:20--> | ||
In this example the river would have the | ;Is it possible to do non-political maps? | ||
:Of course, the division concept can be extended to a river or a mountain. In the making of the map you should keep in mind that most times the river or mountain will be too small that you should provide an additional clicking area. | |||
:In this example the river would have the dark green area and color <20,76,34> as its identifier. | |||
[[File:River.png]] | [[File:River.png]] | ||
<!--T:21--> | |||
[[Category:Education]] | |||
[[Category:Advanced Users]] | |||
[[Category:Development]] | |||
</translate> |
Latest revision as of 17:51, 18 May 2013
Making Maps
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 with the maps. 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 It should begin with <map> and end with </map>. Inside of that there should be the following tags:
- <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 these 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 you should test to make sure it does not have 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 to open your map from inside KGeography.
If you don't know which is your $(KDEDIR) type
kde4-config --prefix
in a shell.
Non political maps
- Is it possible to do non-political maps?
- Of course, the division concept can be extended to a river or a mountain. In the making of the map you should keep in mind that most times the river or mountain will be too small that you should provide an additional clicking area.
- In this example the river would have the dark green area and color <20,76,34> as its identifier.