My favorites | Sign in
Project Logo
                
Search
for
Updated May 29, 2009 by jerome077
Labels: Featured
MapConfiguration  
Syntax of the configuration files for user defined raster maps

Introduction

January 14th, 2009: This feature is now available in the official version of gpsVP (from version 0.4.16).

Through configuration files it is possible to define new raster maps in gpsVP. This can be used in two ways:

Web based map

Configuration file

For a web based map gpsVP will download parts of the map when needed. The parts ("tiles") are then stored in a cache, exactly like for the already existing maps.

First simple example

Create a text file called OpenStreetMapViaIni.ini in the MapConfigs with the following text:

[Tiled MAP]
gpsVPVersionMin=0.4.16
Filename=x=%X&y=%Y.png
URL=http://tile.openstreetmap.org/%ZOOM_00/%X/%Y.png

Ok it’s not very interesting because this map already exist in gpsVP. But you can just change the URL to access other maps. For example the Cycle map of OpenStreetMap should accessible at http://andy.sandbox.cloudmade.com/tiles/cycle/%ZOOM_00/%X/%Y.png.

Other uses

This can be also used to access some WMS maps, see examples in MapExamples.

File based map

Configuration file

A file based map must be cut in tiles to be used with gpsVP. Assuming that you already have such tiles:

Where to get tiles for a file based map?

A few possibilities:

See also UsingScannedMaps.

Syntax of a configuration file

It’s an ini file with at least a section called [Tiled MAP].

Section [Tiled MAP]

Following entries are available:

Entry Example Description
gpsVPVersionMin 0.4.16 Versions 0.4.16 and newer support the syntax of this configuration file. A warning will be displayed if the map is loaded with an older version of gpsVP.
Filename x=%X&y=%Y.png Filename of a tile in the cache. Variables allowed. Just make sure that there won’t be two tiles with the same name in the same folder.
URL URL of a tile. Variables allowed (of course!).
Subpath level=%ZOOM_01/x=%X Path to the tile relative to the cache folder of the map. Variables allowed. Omit it for web based map, it will used the example as default value.
DemoPointLon 11.04791164 Longitude of a demo point for the map. Useful for map that doesn’t cover the whole Earth. It should be a point where the map is visible. A menu entry in the context menu of gpsVP allows to center the map on this point.
DemoPointLat 47.43018866 Latitude of the demo point.
DemoPointZoomOne 16 Zoom level of the demo point from 1 for the whole Earth to currently max 18.
ZoomOne1 RefMap1 Reference on another section for a different URL for this zoom level. Override the default configuration. Allow the configuration composite maps.
... ...
ZoomOne18 See ZoomOne1.

Variables

Following variables are available for the entries Filename, URL and Subpath:

Variable Description Required version
%LONG1 Longitude of the west side of the tile. Can be used to get tiles from a WMS Server. 0.4.16
%LAT1 Latitude of the south side of the tile. 0.4.16
%LONG2 Longitude of the east side of the tile. 0.4.16
%LAT2 Latitude of the north side of the tile. 0.4.16
%X X-Coordinate as Google maps tile (Origin in the upper-left corner). 0.4.16
%Y Y-Coordinate as Google maps tile (Origin in the upper-left corner). 0.4.16
%ZOOM_17 Zoom level, value 17 for the whole Earth. 0.4.16
%ZOOM_01 Zoom level, value 1 for the whole Earth. 0.4.16
%ZOOM_00 Zoom level, value 0 for the whole Earth. 0.4.16
%TMSX X-Coordinate as TMS tile (Origin in the lower-left corner). 0.4.16
%TMSY Y-Coordinate as TMS tile (Origin in the lower-left corner). 0.4.16
%QRST Tile reference as for Google Satellite (quadtree string using the characters q, r, s and t). 0.4.16
%nQRST Part of a %QRST tile reference. Replace n through the desired length. Example %5QRST returns the first 5 characters. 0.4.16
%n,mQRST Part of a %QRST tile reference. Replace n through the desired length and m through the first character to use. Example %6,7QRST returns the 6 characters starting at the 7th one. 0.4.18
%QKEY Tile reference as for Microsoft Live Satellite (quadtree string using the characters 0, 1, 2 and 3). 0.4.16
%nQKEY Part of a %QKEY tile reference. Replace n through the desired length. Example %4QKEY returns the first 4 characters. 0.4.16
%n,mQKEY Part of a %QKEY tile reference. Replace n through the desired length and m through the first character to use. Example %6,7QKEY returns the 6 characters starting at the 7th one. 0.4.18

Details for %ZOOM_00:

Details for %ZOOM_01:

Details for %ZOOM_17:

Referenced sections

The entries ZoomOne1 to ZoomOne18 in [Tiled MAP] allow the definition of composite maps. For each value there should a corresponding "referenced" section in the ini file. The same value can be used for several zoom levels.

The referenced sections must have exactly the same name as in the entry (Example: [RefMap1]) and can use the following entries: Filename, URL, Subpath.

"ZoomOne" in the entry name has the same zoom definition as the variable %ZOOM_01, i.e. ZoomOne1 corresponds to the Earth in 1 tile.

Character encoding

You can use ANSI or UTF-8.

The Windows XP version of Notepad can save file using ANSI or UTF-8. For UTF-8 files it will automatically add a mark called BOM at the beginning of the file. If you use another text editor, make sure that it add a BOM at the beginning of the file if you want to use UTF-8.

NB: You can use Unicode characters for file or folder names but it probably won't work for the URLs.

More examples

See MapExamples.


Sign in to add a comment
Hosted by Google Code