Difference between revisions of "Projects/Marble/MoonMaps"

Jump to: navigation, search
(Created page with "=Moon Maps for Marble= So you want to add moon maps to Marble. This is great since we want to see lots of maps in Marble where the user can browse through space and time. Ther...")
 
(Step 5: Add placemarks)
 
(6 intermediate revisions by one user not shown)
Line 3: Line 3:
  
 
You'll find a lot of maps at sites like:
 
You'll find a lot of maps at sites like:
*[http://en.wikipedia.org/| Wikipedia]
+
*[http://en.wikipedia.org/ Wikipedia]
*[http://www.mapaplanet.org/| Mapaplanet]
+
*[http://www.mapaplanet.org/ Mapaplanet]
*[http://astrogeology.usgs.gov/| USGS Astrogeology]
+
*[http://astrogeology.usgs.gov/ USGS Astrogeology]
  
  
Before start creating a map, check if its also created at [http://marble.kde.org/maps.php| Marble Maps.]
+
Before start creating a map, check if its also created at [http://marble.kde.org/maps.php Marble Maps.]
Normally these type of maps or rather images, are uploaded in several projections, to create our map, we need a simple cylindrical version. If the map that you want it's not available in a simple cylindrical version, you can follow the steps that are explained at [http://techbase.kde.org/Projects/Marble/HistoricalMaps| Historical Maps]
+
Normally these type of maps or rather images, are uploaded in several projections, to create our map, we need a simple cylindrical version. If the map that you want it's not available in a simple cylindrical version, you can follow the steps that are explained at [http://techbase.kde.org/Projects/Marble/HistoricalMaps Historical Maps]
  
  
===Downloading textures===
+
===Step 1: Downloading textures===
  
 
As an example we start off with this nice map of Iapetus from the Cassini and Voyager missions:
 
As an example we start off with this nice map of Iapetus from the Cassini and Voyager missions:
  
- [http://www.mapaplanet.org/explorer-bin/explorer.cgi?map=Iapetus&layers=iapetus_cv_bw&west=180&south=-90&east=-180&north=90&center_lat=0&center=0&defaultcenter=on&grid=none&stretch=none&projection=SIMP&r=1&g=1&b=1&advoption=NO&info=YES&resolution=2 |Mapaplanet: Iapetus]
+
- [http://www.mapaplanet.org/explorer-bin/explorer.cgi?map=Iapetus&layers=iapetus_cv_bw&west=180&south=-90&east=-180&north=90&center_lat=0&center=0&defaultcenter=on&grid=none&stretch=none&projection=SIMP&r=1&g=1&b=1&advoption=NO&info=YES&resolution=2 Mapaplanet: Iapetus]
  
 
This map has a resolution of 2880 × 5760 which gives us good details, and marble can create the tiles automatically, because it's under 60000x120000. <!--needs to be reviewed-->
 
This map has a resolution of 2880 × 5760 which gives us good details, and marble can create the tiles automatically, because it's under 60000x120000. <!--needs to be reviewed-->
  
We create a directory "hondius1595" and save our file "1595_Vera_Totius_Hondius.jpg" there.
+
We create a directory "Iapetus" that it's the nome of the planet/moon, and inside it, another one "iapetus", that it's the name of the maptheme. We need to change the name of the file downloaded and save it as "iapetus.jpg" at /Iapetus/iapetus.
 +
 
 +
===Step 2: Create a dgml file===
 +
 
 +
Next you have a template for creating the dgml file. Copy it inside a plain text editor (like Kate or Gedit) and save it as a .dgml file.
 +
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
 +
&lt;dgml xmlns="http://edu.kde.org/marble/dgml/2.0"&gt;
 +
    &lt;document&gt;
 +
        &lt;head&gt;
 +
            &lt;name&gt;$YourMapName&lt;/name&gt;
 +
            &lt;target&gt;$YourMapTarget&lt;/target&gt;
 +
            &lt;theme&gt;$YourMapTheme&lt;/theme&gt;
 +
            &lt;icon pixmap="$PreviewImage"/&gt;
 +
            &lt;visible&gt;true&lt;/visible&gt;
 +
            &lt;description&gt;&lt;![CDATA[$YourMapDescription]]&gt;&lt;/description&gt;
 +
            &lt;zoom&gt;
 +
                &lt;discrete&gt; true &lt;/discrete&gt;
 +
                &lt;minimum&gt; 900 &lt;/minimum&gt;
 +
                &lt;maximum&gt; 3500 &lt;/maximum&gt;
 +
            &lt;/zoom&gt;
 +
        &lt;/head&gt;
 +
 
 +
        &lt;map bgcolor="#000000"&gt;
 +
            &lt;canvas/&gt;
 +
            &lt;target/&gt;
 +
            &lt;!-- insert layers here --&gt;
 +
        &lt;/map&gt;
 +
 
 +
        &lt;settings&gt;
 +
            &lt;property name="coordinate-grid"&gt;
 +
                &lt;value&gt;true&lt;/value&gt;
 +
                &lt;available&gt;true&lt;/available&gt;
 +
            &lt;/property&gt;
 +
            &lt;property name="overviewmap"&gt;
 +
                &lt;value&gt;true&lt;/value&gt;
 +
                &lt;available&gt;true&lt;/available&gt;
 +
            &lt;/property&gt;
 +
            &lt;property name="compass"&gt;
 +
                &lt;value&gt;true&lt;/value&gt;
 +
                &lt;available&gt;true&lt;/available&gt;
 +
            &lt;/property&gt;
 +
            &lt;property name="scalebar"&gt;
 +
                &lt;value&gt;true&lt;/value&gt;
 +
                &lt;available&gt;true&lt;/available&gt;
 +
            &lt;/property&gt;
 +
        &lt;/settings&gt;
 +
 
 +
        &lt;legend&gt;
 +
            &lt;section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12"&gt;
 +
                &lt;heading&gt;Coordinate Grid&lt;/heading&gt;
 +
            &lt;/section&gt;
 +
        &lt;/legend&gt;
 +
    &lt;/document&gt;
 +
&lt;/dgml&gt;
 +
</pre>
 +
 
 +
Now we need to change some things in this template, like the name of the map, what moon is, etc.
 +
 
 +
First, we change the $YourMapTheme by the name of the second directory that you create in this case "iapetus"
 +
 
 +
Second, we need to replace $YourMapTarget by the name of the frist directory that we create in this case "Iapetus"
 +
 
 +
Third, we have to change $YourMapName by the name that will be displayed in the map selection, in the case "Iapetus"
 +
 
 +
Fourth, we need to change $YourMapDescription by a short description that will be showed when the user leaves his pointer over the preview image.
 +
 
 +
Fifth, inside settings you change somethings like if you want to show coordinate grid, compass or scale when the map first start.
 +
 
 +
===Step 3: Define the main texture layer===
 +
 
 +
Add this code inside the <map> tag in the dgml file and replace the variables according to the instructions below.
 +
<pre>
 +
<layer name="$YourMapTheme" backend="texture">
 +
      <texture name="$YourMapTheme_data" expire="604800">
 +
          <sourcedir format="JPG"> $YourMapTarger/$YourMapTheme </sourcedir>
 +
          <installmap> YourMapTheme.jpg </installmap>
 +
      </texture>
 +
</layer>
 +
</pre>
 +
 
 +
Now, we need to replace $YourMapTheme and $YourMapTarger by the name of your map and the name of the moon that you are creating the map. In our case by iapetus and Iapetus.
 +
 
 +
===Step 4: Create a preview icon===
 +
 
 +
Now we can start the map inside marble, to show this prelease version of the map, you need to copy it inside the marble maps folder. You can use (if your folder is at your user folder):
 +
 
 +
<pre>
 +
cp ~/$YourMapTarger/$YourMapThem ~/.local/share/marble/maps
 +
</pre>
 +
 
 +
Then you can open Marble and see the texture layer at the marble globe. Now, you need to create a preview icon, to do that you need to take an screenshot of the view of the map at marble. If you want, you can activate the shadow, and then press the PrintScreen Button of your keyboard.
 +
 
 +
Now you need to cut and resize the image (you can do it with GIMP). The final image will be had a resolution of 136x136, so you need to cut the image into a square and then resize it to 136x136 pixels.
 +
 
 +
Now you can add change $PreviewImage (of the dgml file) by the name of the image that we created for the preview image, in our case "iapetus-preview.jpg".
 +
 
 +
===Step 5: Add placemarks===
 +
 
 +
Now what we need to do is add the placemarks like craters and others to our map. To this issue we can use the [http://planetarynames.wr.usgs.gov Planetary Names USGS] site to download the placemarks data. Now we need to find our moon inside this site, and go to the bottom of the page to click on the KML download.
 +
 
 +
When our download is finished we move the kml to the root folder of your map (the same folder that the.dgml file)
 +
 
 +
Now we need to add a code inside the .dgml file that says to Marble where is the kml file, copy the following code inside the .dgml file, before the <> tag.
 +
 
 +
<pre>
 +
code
 +
</pre>
 +
 
 +
===Step 6: Setting up the legend (A)===
 +
 
 +
Also we need to add some checkbuttons to the legend to show or hide our placemarks.
 +
 
 +
===Step 7: Adding the legend (B)===
 +
===Step 8: Package the Map===

Latest revision as of 19:09, 4 February 2013

Contents

[edit] Moon Maps for Marble

So you want to add moon maps to Marble. This is great since we want to see lots of maps in Marble where the user can browse through space and time. There are lots of maps that are under the public domain.

You'll find a lot of maps at sites like:


Before start creating a map, check if its also created at Marble Maps. Normally these type of maps or rather images, are uploaded in several projections, to create our map, we need a simple cylindrical version. If the map that you want it's not available in a simple cylindrical version, you can follow the steps that are explained at Historical Maps


[edit] Step 1: Downloading textures

As an example we start off with this nice map of Iapetus from the Cassini and Voyager missions:

- Mapaplanet: Iapetus

This map has a resolution of 2880 × 5760 which gives us good details, and marble can create the tiles automatically, because it's under 60000x120000.

We create a directory "Iapetus" that it's the nome of the planet/moon, and inside it, another one "iapetus", that it's the name of the maptheme. We need to change the name of the file downloaded and save it as "iapetus.jpg" at /Iapetus/iapetus.

[edit] Step 2: Create a dgml file

Next you have a template for creating the dgml file. Copy it inside a plain text editor (like Kate or Gedit) and save it as a .dgml file.

<?xml version="1.0" encoding="UTF-8"?>
<dgml xmlns="http://edu.kde.org/marble/dgml/2.0">
    <document>
        <head>
            <name>$YourMapName</name>
            <target>$YourMapTarget</target>
            <theme>$YourMapTheme</theme>
            <icon pixmap="$PreviewImage"/>
            <visible>true</visible>
            <description><![CDATA[$YourMapDescription]]></description>
            <zoom>
                <discrete> true </discrete>
                <minimum> 900 </minimum>
                <maximum> 3500 </maximum>
            </zoom>
        </head>

        <map bgcolor="#000000">
            <canvas/>
            <target/>
            <!-- insert layers here -->
        </map>

        <settings>
            <property name="coordinate-grid">
                <value>true</value>
                <available>true</available>
            </property>
            <property name="overviewmap">
                <value>true</value>
                <available>true</available>
            </property>
            <property name="compass">
                <value>true</value>
                <available>true</available>
            </property>
            <property name="scalebar">
                <value>true</value>
                <available>true</available>
            </property>
        </settings>

        <legend>
            <section name="coordinate-grid" checkable="true" connect="coordinate-grid" spacing="12">
                <heading>Coordinate Grid</heading>
            </section>
        </legend>
    </document>
</dgml>

Now we need to change some things in this template, like the name of the map, what moon is, etc.

First, we change the $YourMapTheme by the name of the second directory that you create in this case "iapetus"

Second, we need to replace $YourMapTarget by the name of the frist directory that we create in this case "Iapetus"

Third, we have to change $YourMapName by the name that will be displayed in the map selection, in the case "Iapetus"

Fourth, we need to change $YourMapDescription by a short description that will be showed when the user leaves his pointer over the preview image.

Fifth, inside settings you change somethings like if you want to show coordinate grid, compass or scale when the map first start.

[edit] Step 3: Define the main texture layer

Add this code inside the <map> tag in the dgml file and replace the variables according to the instructions below.

<layer name="$YourMapTheme" backend="texture">
       <texture name="$YourMapTheme_data" expire="604800">
           <sourcedir format="JPG"> $YourMapTarger/$YourMapTheme </sourcedir>
           <installmap> YourMapTheme.jpg </installmap>
       </texture>
</layer>

Now, we need to replace $YourMapTheme and $YourMapTarger by the name of your map and the name of the moon that you are creating the map. In our case by iapetus and Iapetus.

[edit] Step 4: Create a preview icon

Now we can start the map inside marble, to show this prelease version of the map, you need to copy it inside the marble maps folder. You can use (if your folder is at your user folder):

cp ~/$YourMapTarger/$YourMapThem ~/.local/share/marble/maps

Then you can open Marble and see the texture layer at the marble globe. Now, you need to create a preview icon, to do that you need to take an screenshot of the view of the map at marble. If you want, you can activate the shadow, and then press the PrintScreen Button of your keyboard.

Now you need to cut and resize the image (you can do it with GIMP). The final image will be had a resolution of 136x136, so you need to cut the image into a square and then resize it to 136x136 pixels.

Now you can add change $PreviewImage (of the dgml file) by the name of the image that we created for the preview image, in our case "iapetus-preview.jpg".

[edit] Step 5: Add placemarks

Now what we need to do is add the placemarks like craters and others to our map. To this issue we can use the Planetary Names USGS site to download the placemarks data. Now we need to find our moon inside this site, and go to the bottom of the page to click on the KML download.

When our download is finished we move the kml to the root folder of your map (the same folder that the.dgml file)

Now we need to add a code inside the .dgml file that says to Marble where is the kml file, copy the following code inside the .dgml file, before the <> tag.

code

[edit] Step 6: Setting up the legend (A)

Also we need to add some checkbuttons to the legend to show or hide our placemarks.

[edit] Step 7: Adding the legend (B)

[edit] Step 8: Package the Map


This page was last modified on 4 February 2013, at 19:09. This page has been accessed 786 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal