blankblank blank

Archive for the 'map display' Category Page 2 of 2

Convert Scanned/Digital Map Images Into Offline Android Format With MAPC2MAPC – Part I

The previous two posts (one,two) have been on Mobile Atlas Creator (MOBAC), a program that can download map data from online services, and convert it into offline formats compatible with some Android map apps. But MOBAC can’t process your own scanned maps, or digital maps / aerial photographs you’ve downloaded off the web.To do that, there’s MAPC2MAPC, a free image conversion program (Windows only) that can turn stand-alone digital map images into several Android-app-compatible formats. Note: The latest version of MAPC2MAPC is no longer free; you might still be able to find the older free version on the web if you search a bit. But to fully understand how to use it, you’ll  need to know some basics about how digital map images are calibrated, i.e. how do you know which geographic coordinates are associated with each individual pixel element in the image.

Broadly speaking, digital map images can come in one of two formats:

Uncalibrated. Just a basic digital image with no information about which geographic coordinates go with which pixel.

Calibrated (aka “georeferenced” or “registered”). A digital image that comes with basic geographic coordinate calibration data, either embedded in the image file itself, or in a separate file, often plain text,  that can be loaded in with the image to tell the program what location each pixel is at.

For both kinds of maps, you’ll also need to know two more pieces of information that describe how the maps was drawn:

– The map’s “projection”. Maps are flat representations of the earth’s curved surface, and the projection describes geometrically both how they are flattened (in a manner usually designed to minimize distortions from the flattening process) and also the coordinate system that assigns a set of numbers to every point. Examples of projections include Universal Transverse Mercator (UTM) (which uses meters for coordinate units), Lambert Conformal Conic (also meters), and equirectangular/Plate Carree (which uses meters).

– The map’s “datum”. A datum is a set of equations that describes both the curvature of the Earth, and also the zero-zero reference point for coordinate systems. As technology has improved, the accuracy of the datum has also improved, which means that positions given in older datums may be a long distance away from the same position in a modern datum. Examples of datums include WGS84, NAD27, and ED50.

Uncalibrated maps will, by definition, lack embedded information about the projection and datum used to draw the map. MAPC2MAPC has a calibration utility that lets you calibrate the map for a limited number of projections (and a larger number of datums); this will also assign geographic coordinates to every pixel. If your map was created with one of those projections, you should use that one to calibrate your map; you will commonly find the projection and datum printed somewhere on the map, often at the bottom near the map title and scale. If the projection is not defined for your uncalibrated map, or it’s drawn in an oddball calibration, using/choosing the wrong projection can result in a distorted and miscalibrated map. MAPC2MAPC includes utilities for this that requires more calibration points, but can “warp” the map into an acceptable shape. One of those utilities lets you select points in Google Earth, and use those for the calibration process. Check the readme.txt file that comes with the MAPC2MAPC program for more info on these functions. There are also a fair number of free programs that can geographically calibrate an uncalibrated image (“georeferencing”); you can find a list of them here.

For many uncalibrated map images, though, the easiest way to calibrate the map for use in MAPC2MAPC might be to create a Google Earth image overlay file in KMZ format, then load it into the program. MAPC2MAPC accepts these KMZ files as input, and if created successfully, they’re already fully calibrated in the equirectangular/Plate Carree projection, WGS84 datum. You will likely find that most maps can be calibrated reasonably well using this process, although not all. Check out this tutorial by Garmin on the process for creating a KMZ image overlay (note: unlike images destined for Garmin units, it doesn’t have to be in JPG format, and it can be up to 100 million pixels in size). You might also check out this YouTube video tutorial and associated linked tutorials on the right of the video’s page.

For calibrated maps, the geographic coordinate data will always be included somehow in a calibration file. For some types of calibrated maps, the projection/datum information will be included in the calibration file, while for others, you’ll have to specify it. If full projection/datum data is needed for any calibration file, it will be requested by the program. Types of calibrated map files accepted by MAPC2MAPC include:

  • World files (.tfw, pgw, jgw); these always require projection and datum information
  • OziExplorer .map files; these usually have projection/datum information embedded within them
  • Google Earth overlay files (KMZ); these are implicitly in a known projection/datum
  • … and a bunch of less common ones(e.g. gux, gmi, jpr, etc). Not fully familiar with these formats, but I believe some of them have full calibration/projection/datum data, while others only have calibration data.

The MAPC2MAPC website has PDF documentation of how to load a calibration file for a USGS topo map with a tfw world file obtained from a site like LibreMap; by following this, you’ll get a feeling for how to load similar calibration files.

Tomorrow: Some sources for calibrated maps and aerial imagery, and a walkthrough on downloading and converting a calibrated aerial photo into an Android-app-ready map with MAPC2MAPC.

Creating Offline Maps For Android Apps With MOBAC – I

Some Android apps can download and store cached map data from online data sources like Google Maps and OpenStreetMap servers. I’ve already posted about a few of these:

.. and expect to post about many more of them in the future. But in-app caching has limitations:

  • Map sources are limited to online map services
  • Map variety is usually fairly limited
  • Map selection process is limited by the size of the Android unit
  • Issues with download speed and bandwidth caps (WiFi and cellular data connections)

There are also a fair number of Android apps that don’t cache map data directly, but instead use offline mapsets created with desktop software. While perhaps less convenient than direct in-app caching in that they require you to prepare the mapsets on a desktop and then transfer them to your Android unit, they have some significant advantages:

  • Desktop interface usually offers more options, and is easier to use
  • Choice of online map servers can be larger
  • Map management is somewhat easier
  • In addition to online map sources, you can also create mapsets from scanned maps, aerial/satellite photos, and output from mapping software (GIS)

I’m going to be posting on a number of these offline mapset apps in the coming months. Some of them have their own custom mapset creation software, and I’ll cover those separately. But there are several free programs out there that can create mapsets for more than one of these apps, and I thought I’d cover a couple of these first before moving on to the apps themselves. After all, the apps aren’t worth that much without usable maps already in hand.

The first program I’ll be looking at is Mobile Atlas Creator, aka MOBAC, which downloads map tiles from online map services, and converts them into an app-appropriate format. This is a Swiss army knife app, as it creates offline maps not only for a fair number of Android apps, but also for programs that run on Windows, Windows Mobile and Symbian platforms, and even some standard handheld GPS units from Garmin and Magellan. It’s a Java program, so it should run in Windows, Linux and OS X; Java 1.6 required (check this at the Java website). While the current stable release is version 1.7, I’ll be looking at the most recent 1.8 beta release.

No program installation required; just unzip the contents into Start the program up using the .jar program file. There’s a separate Window executable in the distribution, but I think that’s just a stub to start up the .jar file. Documentation is minimal. Program screen looks like this:


There are two sections to the program view. The left pane contains program controls, while the larger right pane has the map view. Navigating the map view is a little different than other programs:

  • To scroll the map view, click and drag with the right mouse button (not the usual left button).
  • Zoom in and out using either the zoom control at upper left, or with the mouse wheel.
  • Use the left mouse button to select an area you want to download map data for. With the grid control at upper left “disabled”, you can freely select any area. With the grid enabled for a particular zoom level, a red grid is laid on top of the map, and selection is automatically “quantized” to full grid squares:



You have to select grid squares in adjacent groups by clicking and dragging; you can’t turn on/off individual squares separate from the rest with Alt-click or Ctrl-click, as you can with some other similar mapset programs (e.g. Garmin’s Mapsource).

The control panel consists of a number of discrete sections, which can be minimized/maximized by clicking on the blue arrows. First section displays the area you’ve selected at right:


You can also enter coordinates manually, then press the “Select entered coordinates” button to refresh the selected area.

Next, there’s a dropdown menu with a list of preprogrammed map sources:


There are currently 56 map sources in this list, some of which cover all of the world, others which are only good for limited areas (and some, like the server, that don’t seem to be currently working at all). Using the Settings section, you can choose to turn off mapsets that you’re not interested in, as well as update the map sources:


You can even add your own map services, though the process is a bit technical, and requires that the map tiles be in a very specific format. Most of these map sources are freely redistributable, and aren’t limited by licensing terms. For some of the commercial sources, (Google Maps, Microsoft/Bing), it’s not clear. In my post on MultiMap, I noted that caching of map tiles is allowed by Google under certain circumstances, and I thought that MultiMap met those restrictions; for MOBAC, I’m not so sure. Bing’s map licensing tends to be a bit looser than Google’s, but even there I’m not sure. Consult a lawyer.

Next post: Creating a mapset for use with an Android app.