blankblank blank


Archive for the 'aerial imagery' Category

TrekBuddy: Offline Map Viewer And GPS Tracker For Android I

Application Name: TrekBuddy

Description: Displays offline mapsets, GPS tracking, records waypoints and tracks, more.

Publisher’s website: TrekBuddy

Cost: Free (donationware)

Version/date reviewed: v.0.9.99  /  9-14-10

Phone/OS: Droid X / Android 2.1

tb_qr

Android Market link (mobile app only)
Android Market link (browser)


After too many recent posts on creating offline maps with MOBAC and MAPC2MPAC, and transferring them over to an Android unit, I’m finally back to actual GPS map apps. First up is TrekBuddy, a J2ME app originally written about 4 years ago, used on devices with Java Virtual Machines (Blackberry, Symbian, Palm, Windows Mobile), and more recently ported over to Android. The good part of its long history is that it’s fairly stable and reliable; the bad part is that it become clear fairly quickly that it wasn’t written originally as an Android app. Some operational quirks in Android are pretty minor, but others can be a real annoyance to deal with.

First off, the app comes with only a rudimentary low-zoom basemap (Figure 1):

trekbuddyopen

… so you’ll need to prepare maps to use with it using MOBAC or MAPC2MAPC. There are essentially two loadable formats:

  • Maps (which MAPC2MAPC creates). In compressed format, these come as a *.tmi and *.tar file, containing map imagery and calibration data for a single zoom level.
  • Atlases (which MOBAC creates). These are collections of different kinds of maps, each of which can have multiple zoom detail levels. These come with a single atlas file (in .tar format) that contains catalogue information for all the maps in the atlas collection. You can also access individual mapsets independently of their atlas context.

You first need to copy an atlas collection, or a mapset, onto your Android unit (see this post for some ways to do that). These should normally go into the “maps” subfolder of the main TrekBuddy data folder, since that’s where the program looks for them first. However, it appears as though you can navigate within the app to folders in other locations on your memory card, so you could put them elsewhere; you can also change the default directory for data in the program Settings section. For this review, I copied the atlas created in this post, which consists of a single atlas index file (renamed to “kv.tar”), and three folders with OSM, MS and topo maps data. I also copied over a folder containing a mapset created with MAPC2MAPC, a converted USGS aerial photo.

Loadatlas

Figure 2: To choose an atlas, select “Load Atlas” from the menu. Here, I first I select the kv.tar atlas file to open the atlas …

atlasmaps

Figure 3: Then only the mapsets in the atlas are displayed. Choosing the “Topo Maps” mapset …

atlastopo

Figure 4: I see the three zoom layers I chose. Selecting the “17” level …

atlastopoview

Figure 5: The topo map for that zoom level pops up. If I start GPS tracking (Menu => Start), my location will be marked with a compass circle.

“Load Map” works in a similar fashion, except that you’ll have to manually select the “.tar” file that contains individual mapset data, even if it’s the only file in a directory. You’ll also always be asked if you want to set this map as the default, which is annoying. And if you change your mind, and decide you don’t want to select an atlas or map, there’s no way to back out gracefully. Either choose a map, even the one you’re currently using, or you’ll have to exit the program by selecting “Exit” from the menu (back key doesn’t get you out of the program at any time).

But there’s a bigger problem. With three zoom levels for the topo mapset in the atlas, I expected to see some kind of zoom control in the map display to let me zoom in and out through the three available levels. I finally figured out that there is no zoom control; if you want to switch to a map of the same type, but at a different zoom detail, you’ll have to manually select it using the “Load Atlas” or “Load Map” function again. You can’t zoom in or out on a single detail level either; it’s always displayed at the native resolution. This is a huge pain; I don’t understand why mapsets in an atlas can’t automatically be loaded/unloaded with zoom buttons. On the plus side, GPS tracking was accurate, with the map scrolling fairly smoothly as I moved. Tapping and dragging to scroll the map also worked well.

The main TrekBuddy menu has six functions:

  • Start – Starts up GPS tracking; when started, this splits into GPS “Pause” tracking and “Stop”  tracking buttons
  • Load Map, Load Atlas – Described above
  • Info – Brings up a helpful screen describing keyboard shortcuts, which are the only way to bring up some functions. The problem is that these require a physical keyboard; there’s no option with touchscreen-only Android models to bring up the virtual keyboard, which locks out some of the functionality.
  • Exit – The only way to stop the program; you can’t get out using the back key.
  • Settings – Lets you modify the program configuration:
    • Basic – Set the default map, folder, startup screen, units and coordinate system. On the plus side, it supports 15 datums, along with UTM and lat/long coordinates. On the down side, setting the default map and folder is a pain, as you have to type out the full file path for it; would be better if there were a file/directory screen to do that.
    • Desktop – Set parameters for onscreen display (OSD), like scale, font size/transparency, decimal precision, etc.. The program seems to be optimized for low- pixel-pitch screens, as even the largest font size results in a fairly small on-screen size for my Droid X; other features also display so small that they can be hard to make out sometimes.
    • Location – Lets you set the tracklog recording to never/ask/always, track export format (GPX/NMEA), and the track interval in time or distance; it appears as though entering a negative value for time or distance renders that interval parameter inoperative. Also in this section is TrekBuddy’s big killer feature, the ability to use an external Bluetooth GPS unit instead of the built-in GPS for location tracking. I’ll cover Bluetooth GPS in future posts, but I’ll say now that this option is a huge plus for TrekBuddy.
    • Navigation – Lets you set parameters for navigation like waypoint/track display, proximity parameters and more.
    • Misc – Some cryptic operating options; I’m guessing there’s documentation at the website, but I couldn’t find it.

The first time I tried setting some of these options, I got incredibly frustrated – the program kept reverting back to the starting defaults. I finally figured out that if you change any option in a Settings section, you need to press the menu button to bring up an “OK” menu listing, then tap on that. Then, before exiting the main Settings list to go back to the map, you need to press the menu button, then tap on “Save” to permanently record your option changes. I don’t see why the program can’t just automatically save whatever changes you’ve made after exiting a section.

I knew from the main website and some of the settings that TrekBuddy had options for recording/navigating tracks and waypoints. There was also supposed to be a compass screen, and a computer mode screen (CMS), displaying numerical data like GPS satellite info, position, etc.. But without a physical keyboard, it looked like some of these were totally inaccessible on my Droid X. Then I accidentally stumbled on a partial solution: some key features could be accessed by tapping on specific parts of the Droid’s touchscreen:

  • Upper-left corner tap brings up a screen for waypoint and track control (Figure 6).

navigation

  • Lower-left corner brings up all the options accessible with the menu button; tap anywhere else to make it disappear (Figure 7)

main

  • With an atlas loaded, tapping just above the lower left corner brings up the atlas layers; you’ll still have to select the zoom level you want.
  • Bottom-center fills in the circle/compass display that marks your position, making it easier to see the compass points and the direction-of-movement arrow
empty
“Empty” circle
full
“Filled-in” circle
  • Bottom-right switches from the map screen to compass to CMS back to map
  • Left-center, right-center and top-center pause tracking
  • Tapping in the middle resumes paused GPS tracking, and also brings you back to your current position if you’ve scrolled the map to a different spot

More tomorrow on the compass/CMS screens, and waypoint/track management.




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

Continued from Part I, Part II is a walkthrough of converting a calibrated map or aerial image into an Android-app-friendly format.

There are a number of ways to get calibrated maps and aerial photos that MAPC2MAPC can convert to Android-app friendly format.

– GIS/mapping programs can usually export maps into “raster”/digital formats that MAPC2MAPC can use. These can also display GIS vector data like shapefiles, then convert it into a compatible rasterized format. This is useful since there currently aren’t any good Android apps that can directly display such vector data.

– Some US state and government agencies provide easy online access to calibrated scanned maps and aerial imagery. Data for the US is particularly easy to find:

For this walkthrough, I’m going to download an aerial photograph and topographic map for my neighborhood from the USGS Seamless Server Site.  I won’t go through the exact details of the process (there’s a tutorial on using the Seamless Server available at that site). But I will point out that when you select a data type for downloading, the Seamless Server will conveniently tell you the projection and datum the data is in, which you’ll need for MAPC2MAPC. Here, both the aerial imagery and topographic map are in the UTM projection, Zone 12N; however, the aerial imagery is in the NAD83 datum, while the topo map is in the NAD27 datum:

seamlessinfo

If you miss it there, or can’t find it, the downloaded zip file will include a .prj text file that has this information, and which can be opened in any text editor:

sszip

ssprj

The two files you will need for use with MAPC2MAPC are the image file (with the .tif file extension) and the “worldfile” with coordinate calibration data (.tfw file extension). In the MAPC2MAPC program, choose File => Open Calibration. In the lower-right corner will be a drop-down menu that lets you select the type of calibration file you’re using from the ones that MAPC2MAPC supports; here, I’ll choose “World files”, then select the .tfw file.

selecttfw

Because worldfiles do not contain map projection/datum info, MAPC2MAPC will prompt me for projection/datum info:

wfparams

From the Seamless Server or PRJ file, I know that the image is in the UTM coordinate system, Zone 12; the numbers in this listing box represent the UTM zones. If it were in a different coordinate system, I could scroll in the box and see if it was available at the bottom; MAPC2MAPC currently supports about 22 additional coordinate systems along with UTM. If I didn’t find it, I’d have to recalibrate the map manually using one of MAPC2MAPC’s built-in utilities, or a separate program (see post I for more info on datums, projections and map calibration). The default datum for MAPC2MAPC is WGS84; if the map is in a different datum (NAD83 in this case), I click the “Not WGS84” button, and choose the correct datum from the next window:

datum

If successful, you should get a screen that looks something like this:

2010-09-14_172052

Now the map image can easily be converted into the Android-app-friendly format. In this case, I’m converting it to TrekBuddy format, so File => Write map as Trekbuddy files converts the original calibrated map image into the TrekBuddy-compatible format.. You’ll find the generated map files in a subfolder located in the same directory as the original image file, with the same name as the image plus “_tiles” appended. The other Android-friendly format MAPC2MAPC supports is the “Mobile Atlas” format; you’ll find that export function in the File menu as well.

The mapset and tiles will be in the uncompressed TrekBuddy format, as MAPC2MAPC doesn’t currently support the compressed tared TrekBuddy format. However, there’s a free Java utility called jtbtar that can convert the uncompressed mapset into a smaller compressed one. Run jtbtar, select the folder with the map tiles, click on “Pack Map”:

jtbtar

And jtbtar will create a compressed .tar file and .tmi file containing the mapset data.

For this example, I didn’t actually notice any substantial space savings by going through this process. However, copying a large compressed file from your computer to your Android unit takes far less time than copying many individual tile files. The process of copying the data over to your Android unit is the next topic on this blog; there are several options, each with advantages and disadvantages.




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.