Version: 2.3.2
Homepage: http://members.shaw.ca/davepatton/drgmapcal/
DRGMapCal is a program which automates the process of generating map calibration files for Digital Raster Graphics(DRG) map images. DRGMapCal can:
DRGMapCal Copyright © 2010, Dave Patton, CIS Canadian Information Systems.
DRGMapCal is Shareware. The unregistered version is fully functional, but is limited to operating on a small number of files at a time. Registration removes the limitation on the number of files.
Individuals may use DRGMapCal for recreational, non-commercial, not-for-profit activities. An individual may have multiple copies of DRGMapCal installed at the same time on multiple computers, provided they own the computers, and provided only one copy of DRGMapCal is in use at any time.
Use of DRGMapCal for Commercial, Government, or for-profit activities is not permitted for an unregistered copy of DRGMapCal, other than for the purposes of evaluating the program. Use of DRGMapCal for Commercial, Government, or for-profit activities requires a different registration fee than for individual use. Contact the program's author for more information.
The cost for an individual to register DRGMapCal for recreational, non-commercial, not-for-profit activities is $20.00CAD. You can use the button below to make your payment through PayPal.
You must use a valid email address when making your payment. When I receive notification from PayPal of your payment, I will email you a registration code. You then enter both the email address and the registration code by using the Help menu from the DRGMapCal program main window.
If you have any problems with the registration payment, or want to use DRGMapCal for Commercial, Government, or for-profit activities, contact me by sending an email to dave at patton dot org and please include "DRGMapCal" in the subject line of the email.
If you have any comments, suggestions, or questions, or experience any problems with DRGMapCal, please send an email to dave at patton dot org and please include "DRGMapCal" in the subject line of the email. Please provide as much detail as possible about the problem. If you are having a problem related to a specific map(or group of maps), you can include one of the map calibration files as an email attachment, but please do not include the map image unless it is fairly small. Please make sure you are using the latest version of DRGMapCal before reporting a problem.
DRGMapCal is written using Visual Basic, and therefore requires the Visual Basic runtime files. These files may already be installed on your PC. I suggest you try out DRGMapCal first before spending any time wondering if you need to bother with the runtime installation.
For more information, you can read the Microsoft Knowledge Base article "VBRun60sp6.exe installs Visual Basic 6.0 SP6 run-time files". If you require this file, you can download it from Microsoft.
DRGMapCal uses a couple of the Microsoft Common Controls, so you will get an error if you run DRGMapCal and these controls are not installed on your system. The error message will be something like "Run time error '339': Component 'MSCOMCTL.OCX' or one of its dependencies not correctly registered: a file is missing or invalid". I suggest you download and try DRGMapCal first. If you get the error, you can download a ZIP file containing MSCOMCTL.OCX from the Download section of the DRGMapCal homepage.
For some conversions of OziExplorer .map files to JPR files(e.g. when calibration points are specified via grid coordinates, and the projection is not latitude/longitude or UTM), DRGMapCal makes use of the OziExplorer API. For this to work, you must have both OziExplorer and the API installed, and you must have a registered version of OziExplorer. Using DRGMapCal in these situations with an unregistered version of OziExplorer may cause DRGMapCal to 'hang'(i.e. stop responding).
The minimum supported screen resolution is 640 x 480 pixels. You may have problems using the program if you have enabled "Large Fonts". OziExplorer .map files are assumed to have Windows line endings (Carriage Return + Line Feed).
The original Toporama website provided computer-generated GIF images at both 1:50,000 and 1:250,000 scales. The original Toporama website is no longer available. The comments below that refer to Toporama map image files all apply to these original Toporama GIF map images, as well as to the Atlas of Canada Toporama GeoTIFF map images.
The "Toporama" name from the original Toporama website (Toporama I) is now being used by the Atlas of Canada Toporama website (Toporama II). Version 2.3.1 of DRGMapCal added support for generation of OziExplorer map calibration files for the Toporama II GeoTIFF map image files that use the geographic (latitude/longitude) projection. Using DRGMapCal to generate OziExplorer .map files for the Atlas of Canada Toporama map images that use the UTM projection is not supported.
The Toporama map image files must have an identifiable version of their NTS designation in their filename. The preferred format is the full NTS designator, such as 092G.GIF or 001M02.GIF, however shortened versions such as 92G.GIF or 1M2.GIF will work.
The NTS designation can be at the start of the filename, or as the last part of the filename immediately preceding the file extension, or can be immediately after the "prefix" or immediately before the "suffix" part of the filename.
For example, all of the following filenames would be interpreted as being for mapsheet 092G: 092G.GIF, 092G_TOPO.GIF, 92G_TOPO.GIF, 92G TOPO.GIF, TOPO_92G.GIF, TOPO 092G.GIF, 92Great_big_balloons.GIF
Starting from the full file name, DRGMapCal will remove the number of characters specified by the 'Filename Prefix Length' field from the start of the filename. Then DRGMapCal will remove the number of characters specified by the 'Filename Suffix Length' field from the end of the filename (prior to the file extension). DRGMapCal then checks the remaing part of the filename, begining at the start of the filename, and if it doesn't find the NTS designation there, then it checks the last part of the filename. Because DRGMapCal allows for this flexibility, it is possible for DRGMapCal to attempt to use non-Toporama files if they have names similar to the Toporama naming convention and are located in the Input directory that you specify.
An example of using the 'Filename Prefix Length' and 'Filename Suffix Length' for dealing with the Atlas of Canada Toporama images would be for image "toporama_092g06_1_0_geo.tif". 'Filename Prefix Length' would be 9 ("toporama_") and 'Filename Suffix Length' would be 8 ("_1_0_geo"). It is also possible, given this example, to specify one or the other of 'Filename Prefix Length' or 'Filename Suffix Length', and DRGMapCal will find the NTS designation (092g06) and generate the map calibration file.
It is possible for DRGMapCal to generate incorrect calibration files when selecting the Map Scale of 1:250,000 and selecting a directory containing files that are 1:50,000 scale, or vice versa. For example, selecting to generate calibration files for 1:250,000 for a directory containing the file 094E01.GIF would result in generating a calibration file for the 1:250,000 scale map 094E. Incorrect files could also be generated when using 'Filename Prefix Length' and/or 'Filename Suffix Length' for a directory containing files with multiple naming conventions.
Some people modify the Toporama images by "stretching" them. Because DRGMapCal reads the width and height of the image, it will work with such modified images, provided they have not had other modifications made such as rotation, rubbersheeting, addition of a map collar, etc.
Versions of DRGMapCal prior to 2.1.6 generated World Files(TFW) for Toporama images that had a file extension of ".tfw". Now, there is an option to be able to specify the file extension to be used. If "Other" is selected for the "World File extension", no checking is done on the entered value - if it results in an invalid filename for the World File(s) being generated, there will be errors reported. To have the "tfw" option generate files with an extension other than ".tfw", see the 7.2.6 INI file - World Files(TFW) section for more information.
Versions of DRGMapCal prior to 2.1.6 generated World Files(TFW) for Toporama images that specified the latitude/longitude coordinates for the upper left corner of the upper left pixel of the Toporama image. That may cause a problem with GIS systems that expect the World File to contain the latitude/longitude coordinates for the center of the upper left pixel. There is now an option to control how the World Files are generated, with the default being the pixel center, rather than the old behaviour of the pixel corner.
Some older versions of OziExplorer .map files may not verify properly. Not all possible checks for validity have been implemented. Files which fail to verify may be able to be loaded into OziExplorer, as it will ignore, or compensate for, some errors, sometimes with no warning messages.
When the option to "Generate Warning if map image does not exist" is selected, two checks may be performed. The first is to see if the map image exists at the location specified in the .map file, with that location being assumed to be a full path. If that check fails, then the map image filename is extracted from the .map file, and a check is done to see if that file exists in the same folder as the .map file that is being verified. If that check fails, a Warning message is generated.
Convert verifies the .map files before conversion, and files which fail to verify are not converted. Invalid information in the .map files may be copied to the converted files. Not all map projections and datums supported by OziExplorer are supported by the converted file formats.
JPR "reference points" have to be specified using latitude/longitude. OziExplorer .map files can have their calibration point geographic locations specified as latitude/longitude, grid coordinates, or both. Convert will use the latitude/longitude values if they are specified. If grid coordinates are specified, DRGMapCal can convert them to latitude/longitude if the .map file specifies UTM as the map's projection. Grid coordinates specified using other grids may be able to be converted, if the INI file has the appropriate entries, and if DRGMapCal can access OziExplorer via it's API. See the 7.2.4 INI file - Projections section for more information.
When converting OziExplorer calibration files that use the Mercator projection to JPR files, the JPR file will contain a "projection" (pr) line, but not a "Latitude of origin" (p1) line, because OziExplorer doesn't support specification of origin latitude for maps using the Mercator projection.
The Fugawi JPR file format document includes a "zn" line, to specify the UTM zone number and letter. When creating JPR files from OziExplorer .map files that use the UTM projection, a "zn" line will be included, where possible. The value is based on the coordinates of the corner markers. The line will not be included if the corner markers are not all in the same East/West UTM zone (i.e. same zone number), or not all in the same North/South hemisphere.
It is possible that JPR files created by DRGMapCal may not work with Fugawi, Memory-Map Navigator, or PathAway. For example, they all use different variations of the JPR file specification, and they also support various image types(e.g. GIF, PNG, etc.).
If you think there is a problem with a JPR file that DRGMapCal has generated, you can email me, and include the JPR file(and .map file if it was converted). Other than that, I can't troubleshoot problems with Fugawi, Memory-Map Navigator, or Pathaway. I'd suggest you read the JPR-related documentation for your program, and if that doesn't help, contact the company's support department.
According to the Customer Service department of Northport Systems Inc., the authors of Fugawi, "The reference points must be on the map image or on the edge of the map image - not outside the map image.".
When generating calibration files for Toporama images for use with OziExplorer, DRGMapCal places the reference points for the right-hand edge and lower edge of the map image one pixel outside the map image, which is the correct way to calibrate the Toporama map images.
Although this method also appears to work in Fugawi, the above statement indicates it isn't supported, so by default DRGMapCal generates the JPR files for Toporama map images with reference points 2 and 3 being on the map image. To change this, see the 7.2.2 INI file - JPR options section.
Fugawi seems to silently ignore JPR files that it considers to have errors, including JPR files with only two reference points. If the JPR file generated by DRGMapCal meets the JPR specification, but does not work in Fugawi, you will have to contact the Customer Service department of Northport Systems Inc. to find out why, before I can consider changes to DRGMapCal.
The generated JPR files for Toporama allow the map images to be imported into Memory-Map Navigator, however, Memory-Map Navigator requires the images to be PNG images(16 or 256 color), so the Toporama GIF images will have to be converted to PNG format.
DRGMapCal supports GEM map images from 2004 or newer with prefixes "maq" or "maz". DRGMapCal makes certain assumptions about GEM map images, including the format of the image name, the image size and the area covered by the image. So long as the GEM map images match with the information in the DRGMapCal INI file (e.g. have the specified pixel size) the OziExplorer map calibration files that DRGMapCal generates for GEM map images provide a 'fairly close' calibration. Discrepancies will be most noticable at the largest map scale(i.e. Street' maps). See the 7.2.5 INI file - GEM map images section for more information.
DRGMapCal will process a single directory of GEM map images at a time. It does not 'follow the directory tree' of directories that GEM uses to store its map image.
GEM's "gem_ini.txt" file allows you to specify a path for the "Maps" directory, under which GEM stores all it's map images. When using DRGMapCal to generate map calibration files for GEM map images, browse to this directory, and navigate to the first of the lowest level subdirectories. Leave all the 'Zoom Levels' checked. Specify the Output Directory. If you want to use the same output directory for all the map calibration files, then select 'Image Filename' for the 'File Name Type', otherwise you will get naming conflicts if you have both small("maq") and large("maz") map images for the same latitude/longitude. Use the "Generate map calibration files" button. Now repeat the generation process, selecting a new GEM map image subdirectory each time, until you have processed all the subdirectories.
The accuracy of the MapQuest map images is unknown, as is the map projection and datum. DRGMapCal assumes a geographic(lat/lon) projection, and WGS84 datum. MapQuest may not have map data available for all areas, or may not have the data at all zoom levels. MapQuest automatically adds their logo, a copyright notice, the scale, and the "center star" to all the map images.
If you wish to make use of the MapQuest "street maps" generated by GEM, I suggest first installing the GEM program, because you will need to have it working in order to generate the map images.
You can unzip the Zip file contents directly to whatever directory you wish to use for the DRGMapCal program. There is no setup program. The INI and map template files are required for DRGMapCal to run. The first time DRGMapCal is run, it will create a file "DRGMapCal.log". This file contains a log of all the actions for each time you run DRGMapCal. The file is cleared each time DRGMapCal.exe is run.
If you already have DRGMapCal installed, and want to upgrade to a newer version, just replace your existing files with those contained in the DRGMapCal Zip file. This will work for both registered and unregistered copies of DRGMapCal. If you have made any changes to your DRGMapCal.ini file, you should save a copy before replacing it. Depending on your changes, you may need to make similar changes to the new INI file. Do not use the old INI file with the new version of DRGMapCal.
DRGMapCal requires an INI file, and by default looks for DRGMapCal.ini in the same directory as DRGMapCal.exe. A different INI file name, or location, can be specified by using a command line switch when starting DRGMapCal.
Using "/INI=MyIniFile.ini" will cause DRGMapCal to look for MyIniFile.ini in the same directory as DRGMapCal.EXE. Using "/INI=X:\Some Path\MyIniFile.ini" will cause DRGMapCal to use the specified INI file. Enclosing the command line INI parameter string in quotes is required if the file or path name includes spaces.
Most of the content of the INI file should not be changed. Exceptions are listed below.
OTFDir= OTFFile=DRGMapCal.map.txtLeaving OTFDir blank means DRGMapCal will look for the OTFFile in the DRGMapCal.EXE directory.
LOGDir= LOGFile=DRGMapCal.logLeaving LOGDir blank means DRGMapCal will create the Log File in the DRGMapCal.EXE directory.
RAMADataDir= RAMAData250=NTSData250.txt RAMAData50K=NTSData50K.txtLeaving RAMADataDir blank means DRGMapCal will look for the NTS data files in the DRGMapCal.EXE directory.
GEMDir=For example, if you installed GEM into "C:\Program Files\GEM\", and it is creating the map image files in "C:\Program Files\GEM\Maps\", you might want to change GEMDir:
GEMDir=C:\Program Files\GEM\Maps\
RAMADir=For example, if the Toporama map images are in "T:\My Maps\":
RAMADir=T:\My Maps\
OutputDir=
VOMInputDir=
COTInputDir=
COTOutputDir=
RAMAJPRCalPtOffsetX=0,-1,-1,0 RAMAJPRCalPtOffsetY=0,0,-1,-1to this:
RAMAJPRCalPtOffsetX=0,0,0,0 RAMAJPRCalPtOffsetY=0,0,0,0For more, see the Fugawi section under 3.2 Notes and Limitations above.
When generating JPR files, if you select File Format JPR1, the contents of the JPR file will be based on the full range of options that can be used in JPR files.
If you select File Format JPR2, you can specify lines that will not be included in the generated JPR files. This is done by adding the lowercase two-letter prefix for the JPR line to be excluded to a comma-separated list on the "JPR2Exclude" line in the INI file:
JPR2Exclude=
For example, when DRGMapCal generates JPR files for the Toporama map images, it includes a map projection line of "pr=Equirectangular". While such JPR files can be used in Fugawi and Memory-Map Navigator 3.1.1, that line causes a problem in Memory-Map Navigator 4.0.0(to be fixed in version 4.1). To generate the Toporama JPR files without a "pr" line, modify the "JPR2Exclude" line in the INI file:
JPR2Exclude=pr
If you wanted to generate JPR files and exclude any possible projection-related lines:
JPR2Exclude=pr,pp,p1,p2,p3,p4,p5,p6,zn
When converting OziExplorer .map files to JPR files, you may get a message that files have not been converted because of "unsupported Datum". What this means is that the Datum used in the .map file is not listed in the JPR File Format specification as being a supported value in JPR files. You may be able to work around this by following these steps:
NAD27 Canada=175
175=North American Datum 1927|Canada|6|-10|158|187
North American 1927 (Canada Mean)=175
When converting OziExplorer map calibration files to JPR files, there are two Projection-related issues:
DRGMapCal has built-in support to convert calibration points specified by UTM grid coordinates to latitude/longitude, when the map's projection is UTM. Other grid coordinate conversions are supported via use of OziExplorer and the OziExplorer API. This means that in those cases, the API DLL must be installed and available to DRGMapCal, and that a registered version of OziExplorer must be running.
When converting OziExplorer .map files to JPR files, you may get a message that files have not been converted, with a message of "Grid Convert Error(Latitude/Longitude not supported by OziExplorer API)". This happens when the .map file specifies that the map's projection is Latitude/Longitude, but the map calibration points have their geographic coordinates specified via grid coordinates. You can get around this by changing the map projection to UTM, or by specifying the map calibration points via latitude/longitude.
When converting OziExplorer .map files to JPR files, you may get a message that files have not been converted because of "unsupported Projection". What this means is that the Projection used in the .map file is not listed as being a supported value in JPR files. You may be able to work around this by following these steps:
(BNG) British National Grid=[JPRProjectionParameters]
(BNG) British National Grid=pr=Transverse Mercator|pp=-2.0|p1=49.0|p2=.9996012717|p3=-100000|p4=400000
When GEM creates map images, the filename includes the longitude and latitude of the center of the map image. For DRGMapCal to be able to calibrate the map image, the size of the map image, both in pizels and geographic extent, must be known.
It is unclear if the MapQuest map images, which GEM uses to create the map image files, are always consistent with respect to their geographic coverage. For example, the coverage may differ slightly for various parts of the world. Differences that have been seen are fairly small, and are likely to be a factor only in regards to calibrations for the larger-scale maps, such as GEM's "Street" level. Any error in the calibration will be noticed more towards the edges of the map image - the center of the calibrated map image should always have the correct latitude/longitude.
INI file settings that control how DRGMapCal deals with GEM map images are in the "[InputGEM]" section:
GEMLatSecs = ((Image height in pixels) * (3600 seconds/degree)) / (pixels per degree)
GEMLonSecs = ((Image width in pixels) * (3600 seconds/degree)) / (pixels per degree)
When you select "TFW" as the output file type when processing Toporama images, and also select "tfw" for "World File extension", the generated files will have the extension ".tfw". That is because of this line in the INI file, in the "[Output]" section:
TFWFileExt=tfwIf you want to use a different file extension when "tfw" is selected for "World File extension", change the above line.