Vector map package: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
No edit summary
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The mappackage XML (.m6mmappackages.xml) is used to setup and describe a collection of map datasets and thus enable the creation of a complete, complex map.
The vector mappackage XML (.m6mmappackage.xml) is used to setup and describe a collection of vector map datasets and thus enable the creation of a complete, complex map.


Note that scalebase and/or nominalscalefactor specified in the mappackage XML will override settings for scalebase and/or nominalscalefactor in the multidatasetfiles.
Maria GDK 4.0 has added support for MBTiles-datasets with MapBox-styling using the <tileset>-parameter instead of <multidataset>. Note that only a subset of the Mapbox-style specification is supported so far.


Example:
Example:


<source lang="xml">
<source lang="xml">
<mappackage visibility="Visible">
<mappackage visibility="Visible" name="Mappackage example">
   <mapversion value="1.0.0"/>
   <mapversion value="1.0.0"/>
  <scalebase type="nominal"/>
  <nominalscalefactor value="1.0"/>
   <vectormapdataset id="Norge 0-25M">
   <vectormapdataset id="Norge 0-25M">
     <multidataset name="OpenStreet" file="OpenStreetDataset/OpenStreetMap.m6mmultidataset.xml" minscale="500" maxscale="15000"/>  
     <multidataset name="OpenStreet" file="OpenStreetDataset/OpenStreetMap.m6mmultidataset.xml" minscale="500" maxscale="15000"/>  
Line 18: Line 16:
     <multidataset name="Norge N2000" file="n250-5mShape\NorgeN2000.m6mmultidataset.xml" maxscale="2000000"/>  
     <multidataset name="Norge N2000" file="n250-5mShape\NorgeN2000.m6mmultidataset.xml" maxscale="2000000"/>  
     <multidataset name="Norge N5000" file="n250-5mShape\NorgeN5000.m6mmultidataset.xml" maxscale="25000000"/>
     <multidataset name="Norge N5000" file="n250-5mShape\NorgeN5000.m6mmultidataset.xml" maxscale="25000000"/>
  </vectormapdataset>
  <vectormapdataset id="OSM Bright">
    <tileset name="Bright" file="osm-bright.mbtiles" stylefile="\osm-bright-gl-style-master\style.json" minscale="20L" maxscale="1L" overzoom="6" resources="osm-bright-gl-style-master\icons"/>
   </vectormapdataset>
   </vectormapdataset>
</mappackage>
</mappackage>
</source>
</source>
{{Note|Properties: A (has attributes), C (has child elements), R (is repeatable), O (is optional).}}


== Mappackage ==
== Mappackage ==
Line 33: Line 36:
| visibility
| visibility
| Valid values are "Visible" and "Hidden". Defines the map visibility in the map catalog service. If attribute not present the default value is Visible.
| Valid values are "Visible" and "Hidden". Defines the map visibility in the map catalog service. If attribute not present the default value is Visible.
|
|-
|name
| Human readable name for the mappackage
|
|
|}
|}
Line 41: Line 48:
!width="15%"| '''Properties'''
!width="15%"| '''Properties'''
|-
|-
| [[#scalebase|scalebase]]
| [[#Mapversion|mapversion]]
| Map scale base.
| O A
|-
| [[#mapversion|mapversion]]
| Semantic version number for map package.
| Semantic version number for map package.
| O A
| O A
|-
|-
| [[#nominalscalefactor|nominalscalefactor]]
| [[#Tilesettings|tilesettings]]
| Scale factor.
| O A
|-
| [[#tilesettings|tilesettings]]
| Settings for maptiles.
| Settings for maptiles.
| O A
| O A
|-
|-
| [[#vectormapdataset|vectormapdataset]]
| [[#Vectormapdataset|vectormapdataset]]
| Adds a group of multidatasets. Enables serverside merging of datasets at the same scale level. Can be referenced from other mappackages.
| Adds a group of multidatasets or tilesets. Enables serverside merging of datasets at the same scale level. Can be referenced from other mappackages.
| O R C A
| O R C A
|-
|-
| [[#group|group]]
| [[#Group|group]]
| Group of multidatasets. Can be used for serverside merging of datasets at the same scale level.
| Group of multidatasets/tilesets. Can be used for serverside merging of datasets at the same scale level.
| O R C A
| O R C A
|-
|-
| [[#vectordataref|vectordataref]]
| [[#Vectordataref|vectordataref]]
| References a vectormapdataset defined in another mappackage.
| References a vectormapdataset defined in another mappackage.
| O R A
| O R A
|}
==== Scalebase ====
{| class="wikitable"
!width="15%"| '''Attribute'''
!width="35%"| '''Description'''
!width="15%"| '''Properties'''
|-
| type
| Valid values are "nominal" and "actual". Default value is "nominal".
| O
|}
|}


Line 93: Line 80:
| O
| O
|}
|}
==== Nominalscalefactor ====
{| class="wikitable"
! '''Attribute'''
! '''Description'''
! '''Properties'''
|-
| value
| Factor used to adjust scale. Default value is 1.0.
| O
|}
[[File:maria2012 vectormaps html 59748625.png|none|thumb|900px|(Left) nominal scalebase, scalefactor 3.0. (Right) nominal scalebase, scalefactor 0.5.]]
[[File:Maria2012_vectormaps_html_mfa1b6b.jpg|none|thumb|900px|(Left) actual scalebase. (Right) nominal scalebase.]]


==== Tilesettings ====
==== Tilesettings ====
Line 134: Line 105:
   <multidataset name="Norge N2000 2013" file="Norge 2013\N2000\NorgeN2000.m6mmultidataset.xml" maxscale="2500000"/>
   <multidataset name="Norge N2000 2013" file="Norge 2013\N2000\NorgeN2000.m6mmultidataset.xml" maxscale="2500000"/>
   <multidataset name="Norge N5000 2013" file="Norge 2013\N5000\NorgeN5000.m6mmultidataset.xml" maxscale="25000000"/>
   <multidataset name="Norge N5000 2013" file="Norge 2013\N5000\NorgeN5000.m6mmultidataset.xml" maxscale="25000000"/>
</vectormapdataset>
<vectormapdataset id="OSM Bright">
  <tileset name="Bright" file="osm-bright.mbtiles" stylefile="\osm-bright-gl-style-master\style.json" minscale="20L" maxscale="1L" overzoom="6" resources="osm-bright-gl-style-master\icons"/>
</vectormapdataset>
</vectormapdataset>
</source>
</source>
Line 142: Line 116:
! '''Properties'''
! '''Properties'''
|-
|-
| [[#multidataset|multidataset]]
| [[#Multidataset|multidataset]]
| Adds map multidataset information.
| Adds map multidataset information.
| O R A
| O R A
|-
| [[#Tileset|tileset]]
| Adds tileset information.
| O R A C
|}
|}


Line 170: Line 148:
| name
| name
| Key that identifies the multidataset.
| Key that identifies the multidataset.
| \
|  
|-
|-
| file
| file
| Relative path to the map multidataset xml file.
| Relative path to the map multidataset xml file.
| \
|  
|-
|-
| minscale
| minscale
| Minimum valid map scale for this multidataset. Use of scale factors (k/K/m/M) are allowed.
| Minimum valid zoomlevel (use postfix 'L') or map scale for this tileset. Use of mapscale factors (k/K/m/M) are allowed.
| O
| O
|-
|-
| maxscale
| maxscale
| Maximum valid map scale for this multidataset. Use of scale factors (k/K/m/M) are allowed.
| Maximum valid zoomlevel (use postfix 'L') or map scale for this tileset. Use of mapscale factors (k/K/m/M) are allowed.
| O
| O
|}
===== Tileset =====
Use the tileset-parameter if you have a MBTiles-vectordataset with Mapbox-styling. Note that only a subset of the Mapbox styling specification is supported.
<source lang="xml">
<vectormapdataset id="OSM Bright">
  <tileset name="Bright" file="osm-bright.mbtiles" stylefile="\osm-bright-gl-style-master\style.json" minscale="20L" maxscale="1L" overzoom="6" resources="osm-bright-gl-style-master\icons"/>
</vectormapdataset>
</source>
Overzoom is used for drawing maps on levels where no data exists. The number of levels specified by the overzoom parameter controls the number of levels the mapservice can search upwards in the maplevel tree for data to draw. The first level encountered to contain data will be used.
Remember to specify relative path to additional resourcefiles (f.x. symbolfiles) using the "resources"-attribute if necessary.
{| class="wikitable"
!width="15%"| '''Attribute'''
!width="35%"| '''Description'''
!width="15%"| '''Properties'''
|-
| name
| Key that identifies the tileset.
|
|-
| file
| Relative path to the MBTiles-file (vector tiles). Ignored if [[#Source][source]] is specified.
|
|-
| stylefile
| Relative path to the Mapbox-stylefile (json).
|
|-
| resources
| Relative path to folder containing additional resourcefiles (symbols, patterns etc).
| O
|-
| minscale
| Minimum valid zoomlevel (use postfix 'L') or map scale for this tileset. Use of mapscale factors (k/K/m/M) are allowed.
| O
|-
| maxscale
| Maximum valid zoomlevel (use postfix 'L') or map scale for this tileset. Use of mapscale factors (k/K/m/M) are allowed.
| O
|-
| overzoom
| Number of zoomlevels. Default value is 0.
| O
|-
|}
{| class="wikitable"
! '''Child element'''
! '''Description'''
! '''Properties'''
|-
| [[#Source|source]]
| Setup for multiple sources referenced in Mapbox style. Supported since Maria GDK 4.3+.
| O A R
|}
==== Source ====
Maria GDK 4.3+ supports Mapbox styling referencing multiple datasources.
<source lang="xml">
<vectormapdataset>
  <tileset name="norway" stylefile="norway_style.json" minscale="20L" maxscale="1L" overzoom="2" resources="\norway\icons">
      <source name="norway_simple" file="norway_simple.mbtiles" />
      <source name="contours" file="norway_contours.mbtiles" />
  </tileset>
</vectormapdataset>
</source>
{| class="wikitable"
!width="15%"| '''Attribute'''
!width="35%"| '''Description'''
!width="15%"| '''Properties'''
|-
| name
| Key that identifies the source. Must match source-definition in corresponding Mapbox style.
|
|-
| file
| Relative path to the MBTiles-file (vector tiles).
|
|-
|}
|}


Line 192: Line 257:


<source lang="xml"><mappackage>
<source lang="xml"><mappackage>
  <scalebase type="nominal"/>
  <nominalscalefactor value="1.0"/>   
   <group maskcoverage="MaskSemiTransparent">         
   <group maskcoverage="MaskSemiTransparent">         
     <multidataset file="mgcp\FMGTMGCPTestdata.m6mmultidataset.xml" minscale="5000" maxscale="25000000"/>
     <multidataset file="mgcp\FMGTMGCPTestdata.m6mmultidataset.xml" minscale="5000" maxscale="25000000"/>
Line 206: Line 269:
! '''Properties'''
! '''Properties'''
|-
|-
| [[#multidataset|multidataset]]
| [[#Multidataset|multidataset]]
| Adds map multidataset information.
| Adds map multidataset information.
| O R A
| O R A
Line 231: Line 294:
<source lang="xml">This mappackage...
<source lang="xml">This mappackage...
<mappackage>     
<mappackage>     
  <scalebase type="nominal"/>
  <nominalscalefactor value="1.0"/>
   <vectordataref id="Norge2013 0-25M" maskcoverage="MaskSemiTransparent"/>
   <vectordataref id="Norge2013 0-25M" maskcoverage="MaskSemiTransparent"/>
</mappackage>
</mappackage>
Line 238: Line 299:
...references dataset in this mappackage:
...references dataset in this mappackage:
<mappackage>
<mappackage>
  <scalebase type="nominal"/>
  <nominalscalefactor value="1.0"/>
   <vectormapdataset id="Norge2013 0-25M" maskcoverage="MaskOpaque">
   <vectormapdataset id="Norge2013 0-25M" maskcoverage="MaskOpaque">
     <multidataset name="N50" file="Norge\N50\N50.m6mmultidataset.xml" maxscale="40000"/>
     <multidataset name="N50" file="Norge\N50\N50.m6mmultidataset.xml" maxscale="40000"/>

Latest revision as of 14:08, 15 November 2021

The vector mappackage XML (.m6mmappackage.xml) is used to setup and describe a collection of vector map datasets and thus enable the creation of a complete, complex map.

Maria GDK 4.0 has added support for MBTiles-datasets with MapBox-styling using the <tileset>-parameter instead of <multidataset>. Note that only a subset of the Mapbox-style specification is supported so far.

Example:

<mappackage visibility="Visible" name="Mappackage example">
  <mapversion value="1.0.0"/>
  <vectormapdataset id="Norge 0-25M">
    <multidataset name="OpenStreet" file="OpenStreetDataset/OpenStreetMap.m6mmultidataset.xml" minscale="500" maxscale="15000"/> 
    <multidataset name="Norge N50" file="Datasets N50/NorgeN50.m6mmultidataset.xml" maxscale="50000"/> 
    <multidataset name="Norge N250" file="n250-5mShape\NorgeN250.m6mmultidataset.xml" maxscale="250000"/> 
    <multidataset name="Norge N500" file="n250-5mShape\NorgeN500.m6mmultidataset.xml" maxscale="500000"/> 
    <multidataset name="Norge N1000" file="n250-5mShape\NorgeN1000.m6mmultidataset.xml" maxscale="1000000"/> 
    <multidataset name="Norge N2000" file="n250-5mShape\NorgeN2000.m6mmultidataset.xml" maxscale="2000000"/> 
    <multidataset name="Norge N5000" file="n250-5mShape\NorgeN5000.m6mmultidataset.xml" maxscale="25000000"/>
  </vectormapdataset>
  <vectormapdataset id="OSM Bright">
    <tileset name="Bright" file="osm-bright.mbtiles" stylefile="\osm-bright-gl-style-master\style.json" minscale="20L" maxscale="1L" overzoom="6" resources="osm-bright-gl-style-master\icons"/>
  </vectormapdataset>
</mappackage>
Properties: A (has attributes), C (has child elements), R (is repeatable), O (is optional).

Mappackage

<mappackage> is the root node of the mappackage-xml.

Attribute Description Properties
visibility Valid values are "Visible" and "Hidden". Defines the map visibility in the map catalog service. If attribute not present the default value is Visible.
name Human readable name for the mappackage
Child element Description Properties
mapversion Semantic version number for map package. O A
tilesettings Settings for maptiles. O A
vectormapdataset Adds a group of multidatasets or tilesets. Enables serverside merging of datasets at the same scale level. Can be referenced from other mappackages. O R C A
group Group of multidatasets/tilesets. Can be used for serverside merging of datasets at the same scale level. O R C A
vectordataref References a vectormapdataset defined in another mappackage. O R A

Mapversion

Attribute Description Properties
value String representing semantic version number, MAJOR.MINOR.PATCH[-RELEASESTATE], for instance "2.1.1-RC" O

Tilesettings

Attribute Description Properties
serveemptytiles If true, map service will return tiles even if empty. Default value is true. O

Vectormapdataset

Vectormapdataset enable serverside merging of datasets. These can be referenced from other mappackages using vectordataref elements.

<vectormapdataset id="Norge2013 0-25M" maskcoverage="MaskOpaque">
  <multidataset name="Norge N50 2013" file="Norge 2013\N50\NorgeN50.m6mmultidataset.xml" maxscale="40000"/>
  <multidataset name="Norge N250 2013" file="Norge 2013\N250\NorgeN250.m6mmultidataset.xml" maxscale="200000"/> 
  <multidataset name="Norge N500 2013" file="Norge 2013\N500\NorgeN500.m6mmultidataset.xml" maxscale="400000"/>
  <multidataset name="Norge N1000 2013" file="Norge 2013\N1000\NorgeN1000.m6mmultidataset.xml" maxscale="800000"/>
  <multidataset name="Norge N2000 2013" file="Norge 2013\N2000\NorgeN2000.m6mmultidataset.xml" maxscale="2500000"/>
  <multidataset name="Norge N5000 2013" file="Norge 2013\N5000\NorgeN5000.m6mmultidataset.xml" maxscale="25000000"/>
</vectormapdataset>
<vectormapdataset id="OSM Bright">
  <tileset name="Bright" file="osm-bright.mbtiles" stylefile="\osm-bright-gl-style-master\style.json" minscale="20L" maxscale="1L" overzoom="6" resources="osm-bright-gl-style-master\icons"/>
</vectormapdataset>
Child element Description Properties
multidataset Adds map multidataset information. O R A
tileset Adds tileset information. O R A C
Attribute Description Properties
id Key that identifies the vectormapdataset. Used when referencing a dataset from another mappackage. O
maskcoverage Mask mode. Valid values are "NoMasking" (no pixels included in mask), "MaskSemiTransparent" (all not fully transparent pixels included in mask), "MaskOpaque" (only fully opaque (a=255) pixels included in mask). Default value is "MaskSemiTransparent". O
Multidataset
Attribute Description Properties
name Key that identifies the multidataset.
file Relative path to the map multidataset xml file.
minscale Minimum valid zoomlevel (use postfix 'L') or map scale for this tileset. Use of mapscale factors (k/K/m/M) are allowed. O
maxscale Maximum valid zoomlevel (use postfix 'L') or map scale for this tileset. Use of mapscale factors (k/K/m/M) are allowed. O
Tileset

Use the tileset-parameter if you have a MBTiles-vectordataset with Mapbox-styling. Note that only a subset of the Mapbox styling specification is supported.

<vectormapdataset id="OSM Bright">
  <tileset name="Bright" file="osm-bright.mbtiles" stylefile="\osm-bright-gl-style-master\style.json" minscale="20L" maxscale="1L" overzoom="6" resources="osm-bright-gl-style-master\icons"/>
</vectormapdataset>

Overzoom is used for drawing maps on levels where no data exists. The number of levels specified by the overzoom parameter controls the number of levels the mapservice can search upwards in the maplevel tree for data to draw. The first level encountered to contain data will be used.

Remember to specify relative path to additional resourcefiles (f.x. symbolfiles) using the "resources"-attribute if necessary.

Attribute Description Properties
name Key that identifies the tileset.
file Relative path to the MBTiles-file (vector tiles). Ignored if [[#Source][source]] is specified.
stylefile Relative path to the Mapbox-stylefile (json).
resources Relative path to folder containing additional resourcefiles (symbols, patterns etc). O
minscale Minimum valid zoomlevel (use postfix 'L') or map scale for this tileset. Use of mapscale factors (k/K/m/M) are allowed. O
maxscale Maximum valid zoomlevel (use postfix 'L') or map scale for this tileset. Use of mapscale factors (k/K/m/M) are allowed. O
overzoom Number of zoomlevels. Default value is 0. O
Child element Description Properties
source Setup for multiple sources referenced in Mapbox style. Supported since Maria GDK 4.3+. O A R

Source

Maria GDK 4.3+ supports Mapbox styling referencing multiple datasources.

<vectormapdataset>
  <tileset name="norway" stylefile="norway_style.json" minscale="20L" maxscale="1L" overzoom="2" resources="\norway\icons">
      <source name="norway_simple" file="norway_simple.mbtiles" />
      <source name="contours" file="norway_contours.mbtiles" />
  </tileset>
</vectormapdataset>
Attribute Description Properties
name Key that identifies the source. Must match source-definition in corresponding Mapbox style.
file Relative path to the MBTiles-file (vector tiles).

Group

Mappackage groups enable serverside merging of datasets. This functionality is largely replaced by vectormapdataset.

Example:

<mappackage>
  <group maskcoverage="MaskSemiTransparent">        
    <multidataset file="mgcp\FMGTMGCPTestdata.m6mmultidataset.xml" minscale="5000" maxscale="25000000"/>
  </group>
  <group>
    <multidataset file="vmap0/vmap0.m6mmultidataset.xml" minscale="10000" maxscale="50000000"/> 
  </group>
</mappackage>
Child element Description Properties
multidataset Adds map multidataset information. O R A
Attribute Description Properties
maskcoverage Mask mode. Valid values are "NoMasking" (no pixels included in mask), "MaskSemiTransparent" (all not fully transparent pixels included in mask), "MaskOpaque" (only fully opaque (a=255) pixels included in mask). Default value is "MaskSemiTransparent". O

Vectordataref

Using <vectordataref> makes it possible for a mappackage to reference datasets located in other mappackages. The dataset(s) to reference must be wrapped inside a <vectormapdataset>-block and the <vectormapdataset> must have an defined id (f.ex. id="Norge2013 0-25M").

The maskcoverage-attribute on a vectordataref will override the maskcoverage-attribute on the referenced vectormapdataset.

Example:

This mappackage...
<mappackage>    
  <vectordataref id="Norge2013 0-25M" maskcoverage="MaskSemiTransparent"/>
</mappackage>

...references dataset in this mappackage:
<mappackage>
  <vectormapdataset id="Norge2013 0-25M" maskcoverage="MaskOpaque">
    <multidataset name="N50" file="Norge\N50\N50.m6mmultidataset.xml" maxscale="40000"/>
    <multidataset name="N250" file="Norge\N250\N250.m6mmultidataset.xml" maxscale="200000"/>
  </vectormapdataset>
</mappackage>