TWiki home TWiki > GPS > English Stuff > PFMsyntaxDescr TWiki webs:
GPS/ | Uzytkownicy | Dokumentacja | Piaskownica
GPS . { GPS/ | Zmiany | Indeks | Szukaj | Stats | Idź }
Revision: 2003-11-16, for cGPSmapper v.0071, GPSMapEdit v. 0.90

cGPSmapper map files: Description of the "Polish format"

Table of Contents

Introduction

PFM (Polski Format Mapy -- Polish Map Format), also known as the "Polish format", is the source language for the cGPSmapper compiler. Creating a map to be uploaded to a GPS receiver may be compared to programming: you write a program (i.e. a map) in the programming language (i.e. in PFM) and then compile it. Alternatively -- just as with programming -- tools exist that generate the source code automatically or semi-automatically. An example of such tool is GPSMapEdit described elsewhere on this site.

A source file (map file) in PFM is a plain text file with the .mp extension and may be prepared using any text editor (in previous versions the .txt extension was used which is still referred to in legacy documentation and other resources). The remaining part of this article describes the syntax and semantics of PFM at the basic level, which means that some advanced and obsolete statements and features are omitted. The full syntax is described in comments in the Test_img.txt file (in the GPSMapper directory).

The cGPSmapper compiler is available in the following editions: Freeware, Shareware, Standard, Pro, and Routing. All editions except for Freeware are referred to as the "advanced" editions.

Conventions

Strings typed in the Monospace font are to be inserted literally, except for metavariables. Metavariables are lowercase strings appearing to the right of the equal sign (=) in many statements: they should be replaced with appropriate values, as described in the explanation (or self-evident). Texts in normal font like here are explanations and should not be inserted into the source file.

The special metavariable # takes a numeric value, e.g. Data# stands for Data0, Data1, etc.

The special iteration operator ... in a statement line has its intuitive meaning. This operator in a separate line denotes that the preceding statement may be repeated zero or more times with various (typically consecutive) values of the metavariable # . If the iteration operator is preceded by a pair of statements with # metavariables, the whole pair should be repeated (see specific statements for examples).

Statements typed in orange color (e.g. Name=) are mandatory in the given section. Statements typed in olive color (e.g. Label=) are optional.

General syntax of a PFM file

A PFM file contains comment lines and sections. A comment line starts with the ; character. A comment line may appear at any place in the file and is ignored by the compiler. (However, GPSMapEdit uses special syntax of comments to specify attachments and such comments are interpreted by GPSMapEdit).

The following sections exist:

The header section is mandatory and must appear as the first section in the source file. All other sections are optional (except that GPSMapEdit gives an error message when opening a map file with no objects defined). Declaration sections (if any) must appear after the header section, in the order specified here. Object sections must appear after declaration sections (if any), may be in any order, and may be repeated as many times as necessary to define all objects.

Each section starts with a section keyword statement (e.g. the [RGN10] statement) and ends with the [END] statement. (In previous versions, there were different END statements for various sections, e.g. [END-RGN10]. This syntax is still acceptable and may be seen in some legacy programs or source files.) The order of statements in the section body (i.e. between the section keyword statement and the [END] statement) is insignificant.

The header section


[IMG ID]
ID=nnnnnnnn -- 8 decimal digits, must be unique for each map
Name=map_name -- map name to be displayed in the GPS receiver's Map Info menu
LBLcoding=x -- (default: LBLcoding=6) Codepage=xx -- (default: Codepage=0) Datum=xxx -- (default: Datum=W84) specifies the datum of object data Elevation=x -- (default: Elevation=f) TreSize=n -- maximal allowed region size; a higher value increases the allowable region size, but may decrease the map performance; a lower value may increase the map size; suggested values for n: RgnLimit=n -- maximal number of elements in one region Levels=n -- number of levels (layers) in the map (at least 1, not more than 10) Level#=g -- grid size for layer # (layer 0 is the most detailed one) Zoom#=#
...

The following statements are supported only by the advanced editions of the compiler
POIIndex=x -- (default: POIIndex=N)

DefaultCityCountry=country_name
DefaultRegionCountry=region_name [END] -- ends the header section

Declaration sections

All the following declaration sections are supported only by the advanced editions of the compiler


[COUNTRIES] -- this section declares all countries used for city indexing
Country#=country_name~[0x1d]abbreviation
... -- the above statement may be repeated for Country2, Country3, etc. (see Conventions above)
[END]
[REGIONS] -- this section declares all regions used for city indexing
Region#=region_name~[0x1d]abbreviation
CountryIdx#=country_index -- the number in the corresponding Country# statement
... -- the above pair may be repeated (see Conventions above)
[END]
[CITIES] -- this section declares all cities used for city indexing
City#=city_name
RegionIdx#=region_index -- the number in the corresponding Region# statement
...
[END]

Object sections


[RGN10] -- this section defines a POI (point of interest) object
Type=object_type Label=object_name
Levels=n -- the object will be replicated ("extended") onto higher layers, up to layer n inclusive
Data#=(lat1,lon1) -- the object data for layer #
... Origin#=(lat1,lon1) -- this is a legacy statement with the same meaning and usage as Data#. However, GPSMapEdit uses Origin# rather than Data#.
...
[END]
[RGN20] -- this section defines a point object, not being a POI. Statements are as for the [RGN10] section.
Type=object_type
Label=object_name
Levels=n
Data#=(lat1,lon1)
...
Origin#=(lat1,lon1)
...
[END]
[RGN40] -- this section defines a polyline (linear object, e.g. street, stream)
Type=object_type
Label=object_name
Levels=n
Data#=(lat1,lon1),(lat2,lon2),... -- as many coordinate pairs as there are vertices in the object (see Conventions above)
...
[END]
[RGN80] -- this section defines a polygon (area object, e.g. lake, forest)
Type=object_type
Label=object_name
Levels=n
Data#=(lat1,lon1),(lat2,lon2),...
...
[END]
[PLT] -- this section defines a polyline or polygon, with data imported from an OziExplorer's .plt file
RgnType=object_category Type=object_type
Label=object_name
Levels=n
File#=file_name -- specifies a .plt file from which data will be imported to layer #
...
[END]
[WPT] -- this section defines a POI or point, with data imported from an OziExplorer's .wpt file
RgnType=object_category Type=object_type
Levels=n
File#=file_name -- specifies a .wpt file from which data will be imported to layer # ...
[END]

Special features

Importing track segment names

If the track imported in the [PLT] section contains multiple segments (i.e. objects), all segments will take the same label (name), as defined by the Label statement. However, it is possible to give a different name to each segment. To achieve this, omit the Label statement and specify the names in an additional file, which should have the same name as the .plt file (including the extension) and the additional extension .txt, e.g. Highways.plt.txt). The file must be in the same directory as the .plt file. Each line in this file specifies the name for the corresponding track segment.

Object elevation

You may define elevation for such objects as summit (RgnType=0x10, Type=0x6616), height point (RgnType=0x20, Type=0x62...0x63), and land/depth contours (RgnType=0x40, Type=0x20...0x25).

By default, the elevation is defined in feet. To define the elevation in meters, the Elevation=m statement should be defined in the header section.

The elevation is defined not as a distinct parameter, but is appended to the object label after the ~[0x1f] delimiter. The following section defines a summit with the defined elevation of 2499 meters (provided that Elevation=m is declared in the header section):
[RGN10]
Type=0x6616
Label=Mt. Rysy~[0x1f]2499
Levels=2
Data0=(49.17958,20.08800)
[END]

The elevation may be also provided with an empty label. The following section defines a land contour line of the elevation of 115 meters:
[PLT]
RgnType=0x40
Type=0x20
Label=~[0x1f]115
Levels=1
File0=Contour115.plt
[END]

Road numbers

You may define road numbers in a similar way as object elevation, by placing the number after a delimiter. The following delimiters for road numbers are available:

For example, the statement Label=~[0x2d]619 defines a road with the number 619, displayed as a small symbol (blue/red).

Note: If full-byte coding is used, the delimiters are different, namely:

Descriptive type names

It is possible to define object type with a descriptive name instead of numeric code. For example:
Type=Dining(Asian)
The descriptive name must be entered exactly as it appears in the file RGNtype.txt (in the GPSMapper directory).

Advanced sections and statements

Most of the following are supported only by the advanced editions of the compiler. They are described in the Test_img.txt file (in the GPSMapper directory) which provides also an example of usage. The list below gives you some idea of advanced features supported by those advanced editions.

[BACKGROUND]
[DICTIONARY]
[FILE]
[HIGHWAYS]
[POI]
[SHP]
[ZIPCODES]
Cities
CityField
CityIdx
CityRegionIdx
Countries
CountryField
DefaultType
DirField
DirIndicator
ExitDirectionField
ExitFacilitiesField
ExitN
ExitNameField
ExitServices
ExitServicesEnd
ExitServicesStart
ExitTypeField
HighwayField
HighwayIdx
HighwayN
HighwayRegionIdx
Highways
HouseNumber
LabelField
LeftCity
LeftEnd
LeftStart
LeftType 
LeftZip
Level
LevelsNumber
Node
OvernightParking
PhoneNumber
POINumberFirst
POIOnly
POIZipFirst
PreProcess
RegionCountryIdx
RegionField
RegionIdxN
Regions
RightCity
RightEnd
RightStart
RightType 
RightZip
StreetDesc
StreetDesc
StreetNumbers
StreetNumbersEnd
StreetNumbersStart
Transparent
TreMargin
TypeField
ZipCodeField
ZipCodeN
ZipCodes
ZipIdx

Obsolete statements

AlignMethod
BlockSize
LevelFill 
LevelLimit
WorldMap

-- Janusz Snay

Topic PFMsyntaxDescr . { Edit | Załącz | Linkujące | Do druku | Wersje | r1.9 | > | r1.8 | > | r1.7 | Więcej }
Revision r1.9 - 17 Nov 2003 - 15:55 GMT - Janusz Snay
Parents: Web Home > English Stuff
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.