Warning, /education/marble/docs/dgml2.txt is written in an unsupported language. File is not indexed.

0001 III. DGML SYNTAX FOR LAYERS:
0002 ============================
0003 
0004 Marble uses its own XML format called "DGML" to load and save maps.
0005 The DGML map format describes the basic properties of a map. The format
0006 assumes that the map consists of data that gets imported and integrated
0007 from various data sources. So it's different from other map formats
0008 which try to describe all the features in a map themselves: DGML reuses
0009 existing map data from established file formats (e.g. KML, GPX, GeoRSS),
0010 arranges them in layers and compiles them together into a new map.
0011 
0012 Additionally DGML 2 provides means to connect the checkboxes used in the 
0013 legend to switch items on the map on and off. This is done using the
0014 "connect" attribute in a manner similar to Qt's Signals and Slots.
0015 
0016 The DGML 2 format has got four main sections:
0017 
0018 1. The HEAD section in which basic properties get defined.
0019 
0020 2. The MAP section in which the layer structure gets defined. 
0021 
0022    Via the CONNECT attribute the layers and dataSets
0023    can get connected to the properties provided by the settings section.
0024    This provides the ability to connect the checkboxes in the
0025    legend to the layers on the map being displayed. E.g. the attribute
0026    connect="borders" located in the "pborder" dataSet tag would 
0027    enable to switch the international border on and off on the map via 
0028    the associated property value.
0029 
0030 3. The SETTINGS section which contains all properties that can get stored.
0031    This section basically contains the model for all properties.
0032    Mostly it contains the information whether a particular 
0033    geographical feature is available (i.e. the map provides a "relief")
0034    and whether it is enabled by default.
0035 
0036 4. The LEGEND section in which the markup of custom legend elements 
0037    get defined (to be done in the future: the whole legend should get 
0038    defined here).
0039    Via the CONNECT attribute the checkable legend sections and items
0040    can get connected to the properties provided by the settings section. 
0041 
0042 The order inside the map section follows the rendering process:
0043 
0044 1.) The rendering order starts at some distant point ( z = -infinity )
0045     behind earth and approaches the observer until it reaches the
0046     globe. Obviously this range is only relevant for projections
0047     similar to the spherical one.
0048 
0049 2.) Then the rendering order continues projection based from the
0050     surface up into the lower atmosphere.
0051 
0052 3.) At last all layers between the earth's orbit (satellites!) up to
0053     the observer get rendered (z > 0).
0054 
0055 
0056 EXAMPLE 1 : ATLAS ( filename: srtm.dgml )
0057 -----------------------------------------
0058 
0059 
0060 <?xml version="1.0" encoding="UTF-8"?>
0061 <dgml xmlns="http://edu.kde.org/marble/dgml/2.0">
0062     <document>
0063         <head>
0064             <name>Atlas</name>
0065             <target>earth</target>
0066             <theme>srtm</theme>
0067             <icon pixmap="srtm-preview.png"/>
0068     
0069             <!-- describes whether the map theme item will be hidden (e.g.
0070                 for a clouds layer): -->
0071             <visible> true </visible>
0072         
0073             <!-- The description allows for rich text of course: -->
0074             <description><![CDATA[A <i>classic topographic map</i>. It uses vector lines to
0075                         mark coastlines, country borders etc. and bitmap
0076                         graphics to create the height relief.]]></description>
0077     
0078             <zoom>
0079                 <minimum>   900  </minimum>
0080                 <maximum>  2100  </maximum>
0081     
0082                 <!-- describes whether you can zoom trough the levels
0083                     continuously -->
0084                 <discrete> false </discrete> 
0085             </zoom>
0086         </head>
0087         
0088             <!-- Now we create the layer structure that gets handled by the
0089     layer management class -->
0090         
0091         <map bgcolor="#000000">
0092             <canvas/>
0093             <!-- In this place one could e.g. insert a sky plugin -->
0094             <target/>
0095         
0096             <!-- This layer creates the elevation model -->
0097             <layer name="srtm" backend="texture" role="dem">
0098                 <texture name="srtm_data"><!-- type="texture"-->
0099                     <sourcedir format="JPG"> earth/srtm </sourcedir>
0100                     <installmap> srtm.jpg </installmap>
0101                 </texture>
0102             </layer>
0103             
0104             <!-- This layer creates the coastlines that are needed to
0105                 colorize the elevation model properly -->
0106             <layer name="mwdbii-canvas" backend="vector" role="filterhelper">
0107                 <vector name="pcoast" feature="land">
0108                     <sourcefile format="PNT"> earth/mwdbii/PCOAST.PNT </sourcefile>
0109                 </vector>
0110                 <vector name="pisland" feature="land">
0111                     <sourcefile format="PNT"> earth/mwdbii/PISLAND.PNT </sourcefile>
0112                 </vector>
0113                 <vector name="plakeisland" feature="land" connect="waterbodies">
0114                     <sourcefile format="PNT"> earth/mwdbii/PLAKEISLAND.PNT </sourcefile>
0115                 </vector>
0116                 <vector name="plake" feature="sea" connect="waterbodies">
0117                     <sourcefile format="PNT"> earth/mwdbii/PLAKE.PNT </sourcefile>
0118                 </vector>
0119                 <vector name="pglacier" feature="sea">
0120                     <sourcefile format="PNT"> earth/mwdbii/PGLACIER.PNT </sourcefile>
0121                 </vector>
0122             </layer>
0123         
0124             <!-- This layer provides the colorization -->
0125             <layer name="colorme" backend="filter">
0126                 <filter name="texturecolorizer" type="colorize">
0127                     <dem>srtm</dem>
0128                     <coastline>mwdbii</coastline>
0129                     <!-- If these don't get defined the default palettes get
0130                     used -->
0131                     <palette type="sea">seapalette.pal</palette>
0132                     <palette type="land">landpalette.pal</palette>
0133                 </filter>
0134             </layer>
0135         
0136             <layer name="mwdbii" backend="vector" role="polyline">
0137                 <vector name="pdiffborder" feature="border" connect="borders">
0138                     <sourcefile format="PNT"> earth/mwdbii/PDIFFBORDER.PNT </sourcefile>
0139                     <pen color="#f29b68" />
0140                 </vector>
0141                 <vector name="pusa48" feature="border" connect="borders">
0142                     <sourcefile format="PNT"> earth/mwdbii/PUSA48.DIFF.PNT </sourcefile>
0143                     <pen color="#f29b68" />
0144                 </vector>
0145                 <vector name="international dateline" feature="border">
0146                     <sourcefile format="PNT"> earth/mwdbii/DATELINE.PNT </sourcefile>
0147                     <pen color="#000000" />
0148                 </vector>
0149                 <vector name="rivers" feature="river" connect="waterbodies">
0150                     <sourcefile format="PNT"> earth/mwdbii/RIVER.PNT </sourcefile>
0151                     <pen color="#637bff" />
0152                 </vector>
0153             </layer>
0154         
0155             <layer name="standardplaces" backend="geodata">
0156                 <geodata name="cityplacemarks">
0157                     <sourcefile format="KML">cityplacemarks.kml</sourcefile>
0158                 </geodata>
0159                 <geodata name="baseplacemarks">
0160                     <sourcefile format="KML">baseplacemarks.kml</sourcefile>
0161                 </geodata>
0162                 <geodata name="elevplacemarks">
0163                     <sourcefile format="KML">elevplacemarks.kml</sourcefile>
0164                 </geodata>
0165                 <geodata name="otherplacemarks">
0166                     <sourcefile
0167                     format="KML">otherplacemarks.kml</sourcefile>
0168                 </geodata>
0169                 <geodata name="boundaryplacemarks">
0170                     <sourcefile format="KML">boundaryplacemarks</sourcefile>
0171                 </geodata>
0172             </layer>
0173         </map>
0174 
0175         <settings>
0176             <group name="Boundaries">
0177                 <property name="boundaries">
0178                     <available>true</available>
0179                     <value>true</value>
0180                 </property>
0181                 <property name="international-boundaries">
0182                     <available>true</available>
0183                     <value>true</value>
0184                 </property>
0185                 <property name="state-boundaries">
0186                     <available>true</available>
0187                     <value>true</value>
0188                 </property>
0189             </group>
0190             <group name="Water Bodies">
0191                 <property name="waterbodies">
0192                     <available>true</available>
0193                     <value>true</value>
0194                 </property>
0195                 <property name="lakes">
0196                     <available>true</available>
0197                     <value>true</value>
0198                 </property>
0199                 <property name="rivers">
0200                     <available>true</available>
0201                     <value>true</value>
0202                 </property>
0203             <group>
0204         </settings>
0205         
0206         <!-- At last we define some legend properties -->
0207         
0208         <legend>
0209             <section name="boundaries" checkable="true" connect="boundaries" spacing="12">
0210                 <heading>Boundaries</heading>
0211 
0212                 <item name="international-boundary">
0213                     <icon color="#f29b68" pixmap="bitmaps/border_1.png"/>
0214                     <text>International</text>
0215                 </item>
0216                 <item name="state">
0217                     <icon color="#f29b68" pixmap="bitmaps/border_2.png"/>
0218                     <text>State</text>
0219                 </item>
0220             </section>
0221     
0222             <section name="waterbodies" checkable="true" connect="waterbodies" spacing="12">
0223                 <heading>Water Bodies</heading>
0224 
0225                 <item name="lake">
0226                     <icon color="#d0dff1" pixmap="bitmaps/lake.png"/>
0227                     <text>Lake</text>
0228                 </item>
0229                 <item name="river">
0230                     <icon color="#637bff" pixmap="bitmaps/river.png"/>
0231                     <text>River</text>
0232                 </item>
0233             </section>
0234     
0235             <section name="elevation" checkable="false" spacing="12">
0236                 <heading>Elevation</heading>
0237 
0238                 <item name="topography7000">
0239                     <icon color="#c39d55"/>
0240                     <text>7000 m</text>
0241                 </item>
0242                 <item name="topography5000">
0243                     <icon color="#dcbd80"/>
0244                     <text>5000 m</text>
0245                 </item>
0246                 <item name="topography3500">
0247                     <icon color="#f0da96"/>
0248                     <text>3500 m</text>
0249                 </item>
0250                 <item name="topography2000">
0251                     <icon color="#f1e7ad"/>
0252                     <text>2000 m</text>
0253                 </item>
0254                 <item name="topography1000">
0255                     <icon color="#d7d399"/>
0256                     <text>1000 m</text>
0257                 </item>
0258                 <item name="topography500">
0259                     <icon color="#bcc48a"/>
0260                     <text>500 m</text>
0261                 </item>
0262                 <item name="topography200">
0263                     <icon color="#98b47a"/>
0264                     <text>200 m</text>
0265                 </item>
0266                 <item name="topography50">
0267                     <icon color="#81a96d"/>
0268                     <text>50 m</text>
0269                 </item>
0270                 <item name="topography0">
0271                     <icon color="#689961"/>
0272                     <text>0 m</text>
0273                 </item>
0274                 <item name="topography-0">
0275                     <icon color="#e3ecf5"/>
0276                     <text>0 m (Water)</text>
0277                 </item>
0278                 <item name="topography-50">
0279                     <icon color="#d0def2"/>
0280                     <text>-50 m</text>
0281                 </item>
0282                 <item name="topography-200">
0283                     <icon color="#bfd5ee"/>
0284                     <text>-200 m</text>
0285                 </item>
0286                 <item name="topography-2000">
0287                     <icon color="#a3c3e6"/>
0288                     <text>-2000 m</text>
0289                 </item>
0290                 <item name="topography-4000">
0291                     <icon color="#89b0da"/>
0292                     <text>-4000 m</text>
0293                 </item>
0294                 <item name="topography-6500">
0295                     <icon color="#6b99c9"/>
0296                     <text>-6500 m</text>
0297                 </item>
0298                 <item name="topography-11000">
0299                     <icon color="#5182b4"/>
0300                     <text>-11000 m</text>
0301                 </item>
0302             </section>
0303         </legend>
0304     </document>
0305 </dgml>