Olexa's Logo


1999 2004
   Olexa Riznyk


Global Mapper ASCII to Polish Map Format elevation data Converter


  • Converts land contours from Global Mapper's Simple ASCII Text format (.xyz) to cGPSmapper's Polish Map Format (.mp)
  • Preserves original land contour classes (minor, intermediate, major)
  • Automatically generates map header (levels, etc.) and distributes contours among map levels
  • Allows to skip certain elevations (for cleaning noise on water in SRTM data)
  • Allows to specify custom map levels set
  • Allows to specify custom contours classes assignment
  • Allows to specify custom distribution of contours among map levels
  • Automatically generates IDs, names and backgrounds for SRTM data
  • Allows to avoid improper levels and background generation by freeware cGPSmapper for SRTM data


In 2003 NASA presented Digital Elevation Model (DEM) for most of the Earth (from 60 South latitude to 60 North latitude) sampled at 3 arcseconds (approximately 90 meters). It is called SRTM and located at ftp://e0srp01u.ecs.nasa.gov/srtm/. This data is presented as rectangular grid with elevations for each node and divided into files for each 1 by 1 area. Oceans and seas are not covered (it does not make sense to). Some data contain errors (noise on water and voids in mountains), but id does not decrease concernment of this data in general.

This data is a big advantage for using our Garmin GPS receiver in places, which we do not have good Garmin MapSource topo maps for. The only question is how to convert there grids into Garmin MapSource maps with land contours and how to merge it to other generic map, that do not have land contours, but has rivers, roads, etc. First task is how to make land contours out of those grids, second task is how to convert them to Garmin MapSource format and third task is how to merge them with existing maps.

xyz2pmf is a supplementary tool for one of the solutions. The idea of this solution is to:

  • Create land contours from SRTM data with help of Global Mapper
  • Convert obtained file with xyz2pmf to Polish map format for generating transparent map
  • Compile the map with cGPSmapper to Garmin MapSource format
  • Load the map to your GPS unit together with some other existing non-topo map by Garmin MapSource or sendMap

System requirements

  • Windows Script (Windows Script Host) 5.5 or later (is included in the latest versions of Internet Explorer and Windows, or can be freely downloaded from www.microsoft.com)

User requirements

  • Ability to work with command-line prompt
  • Ability to run Windows scripts in command-line mode with cscript.exe

Typical use


  • Download, install and register Global Mapper
  • Download and unpack cGPSmapper
  • Download and unpack xyz2pmf (see below)
  • Download necessary SRTM files from ftp://e0srp01u.ecs.nasa.gov/srtm/ (note that file name represents latitude and longitude of the south-west corner of covered area, and covered area is 1 by 1 in size)

Conversion (for each file; assumed that all files being used from command line are located in the same folder, or you should set all paths correctly)

  • Open .hgt file in Global Mapper
  • Select menu File -> Generate Contours
  • Set Contour Interval to 20 meters (or 50 feet), switch to Simplification tab, move slider leftmost, click OK
  • Select menu File -> Export Vector Data -> Export Simple ASCII Text File, clear Export Elevations for Each Vertex option, set Include Feature Attributes Before Coordinate Data option, be sure to save it with the same name as source SRTM file (this is important!); it will have .xyz extension
  • Convert this file to polish map format with xyz2pmf by running:

    cscript xyz2pmf.js xxxxxxx.xyz

    where xxxxxxx is actual file name; if you are using freeware cGPSmapper, run xyz2pmf in this way:

    cscript xyz2pmf.js /corners=y xxxxxxx.xyz

    also, if you want to skip contours with some elevation (for removing water noise), specify these elevations in /skip option:

    cscript xyz2pmf.js /skip=-40,-20,0 xxxxxxx.xyz

    do not put spaces around equal signs and commas; you can use /skip and /corners options together
  • Compile the map by running

    cGPSmapper -o yyyyyyyy.img xxxxxxx.mp

    where yyyyyyyy is map ID (see xxxxxxx.mp file)

Uploading to GPS

  • To upload maps without Garmin MapSource software, use sendMap or some other software
  • To upload maps with Garmin MapSource you need to create so-called preview .img and .tdb files and register this product in Windows registry; edit srtm.mp file included with xyz2pmf to add all your files to [Files] section like shown there (remember to remove exapmle entries if they are not among your files) and compile it by running

    cGPSmapper pvx srtm.mp

    then set correct paths in 88.reg file (remember to double the backslashes) and run it to add to registry; you should not have MapSource product with ID 88 registered, otherwise you need to set the ID in srtm.mp and 88.reg files to some free value: you can check which products are registered with RegEdit in HKEY_LOCAL_MACHINE\SOFTWARE\Garmin\MapSource\Products

Download xyz2pmf 1.0 beta 3

GPS Pages | Home