USAPhotoMaps downloads U.S.Geological Survey aerial photos / topos from http://terraserver-usa.com/ (available at no charge, courtesy of Microsoft) and creates a map from them.

To download the aerial photos, select File -Download Map Data -Fill Screen.

When the screen has filled with photos, you've begun your map! To enlarge it, zoom out and/or scroll the map. Then select File -Download Map Data -Fill Screen again. 

Select GPS -Help if you have a GPS (and then read the rest of this).

The Details:

Photo/topo data is saved on your computer's hard drive after each row is downloaded. You can cancel the downloading by clicking on [ Stop Downloading ] on the Menu bar (or by pressing Alt-S).

You can mark a location (waypoint) on your map by pointing and clicking with the left Mouse button. To view your waypoints, select Waypoints -List on the Menu bar, or press the right Mouse button, or press Enter.

If you have a problem with USAPhotoMaps, read all of this, and then get the latest version - and un-zip it to the the existing USAPhotoMaps' folder (over-write the existing files). If this doesn't solve the problem, email me at jdmcox@jdmcox.com.

My Web site is at  http://jdmcox.com/
If that's not working, try http://jdmcox.home.comcast.net/

Minutes, seconds, and decimal fractions are optional when you enter a latitude or longitude. Longitude is presumed to be a west longitude, so (for example) you can enter 122 instead of -122.

You can get latitude/longitude (and photo/topo creation date) from
http://terraserver-usa.com
1. In Search Terraserver, enter a city name.
2. On the next screen, click on Aerial Photo or Topo Map (note date).
3. On the next screen, click on Info (above the photo) to get a screen with latitude/longitude.

If you're using Windows XP, you may not be able to download the aerial photos without turning off its built-in Internet Connection Firewall, or making it recognize USAPhotoMaps (in Network Connections in Control Panel).

If you select File -Download Map Data -Fill Screen on the Menu bar, 1 meter/pixel photos will be downloaded if the zoom level is 1 thru 8, and 8 meters/pixel photos will be downloaded if the zoom level is 8 thru 64. Or, if you've selected View -Map Type -Topo on the Menu bar, 4 meters/pixel topographical maps will be downloaded.

If a photo or topo map doesn't download, either there aren't any images available (possibly because you're past the edge of the current UTM Zone), in which case an X will fill the square, or it's not a JPEG image, in which case it will be saved in "DownloadError.htm" for you to read, or it was just a bad download, and you should try again. There's no photo data for Hawaii, and no topo data for Puerto Rico, and there's a lot of missing photo data in the contiguous U.S. You can check at http://terraserver-usa.com/ to see if a location has the photo or topo data you're looking for.

If you select File -Download Map Data -Enter Lat/Lon on the Menu bar, you can download an area larger than your screen, but you'll need to know the bounding latitudes and longitudes, and they need to be in the same UTM Zone. Before you select this option, you may need to select File -New Map to create the appropriate map area, or select View -Goto to go to the area you're interested in.

The map system used on Microsoft's Terraserver Web site (and this program) is based on a flat UTM (Universal Transverse Mercator) grid. This projection very closely approximates global coordinates on 60 flat rectangular zones, each 6 degrees of longitude wide. UTM ADDRESSING IS IN METERS. The Northing address increases to the North, and the Easting address increases to the East. The Northing address is 0 at the equator, and the Easting address is 500,000 in the middle of each zone. USAPhotoMaps can translate between UTM and Lat/Lon coordinate systems. Since the smallest measurement is one meter (one pixel), UTM addresses are rounded to whole numbers.

UTM Zone   Longitude Degree Range
    10               120.00001 thru 126.0
    11               114.00001 thru 120.0
    12               108.00001 thru 114.0
    13               102.00001 thru 108.0
    14                96.00001 thru 102.0
    15                90.00001 thru  96.0
    16                84.00001 thru  90.0
    17                78.00001 thru  84.0
    18                72.00001 thru  78.0
    19                66.00001 thru  72.0

Because the aerial photos are based on this flat UTM grid, aerial photos from two adjacent UTM Zones won't match up with each other, and therefore every photo map you create in USAPhotoMaps has a limit (the photos become blank) at the edges of each UTM Zone. 

The 1 meter aerial photos are 200 by 200 meters, and are identified by the UTM address of their lower left corner divided by 200.

When you create a New Map, its name, UTM Easting, Northing and Zone are saved in  USAPhotoMaps.ini, which can be changed (with Notepad). An asterisk has to be at the beginning of the current map name, and a blank line at the end of the file. In this file, the UTM Easting and Northing coordinates are divided by 200, and are preceded by "&X=" (Easting) and "&Y=" (Northing), and the UTM Zone is preceded by "&Z=".

USAPhotoMaps saves the downloaded 1 meter photo data in .dta files that contain the photo data by row. These files are in a sub-folder (\USAPhotoMapsData) of the folder where you put USAPhotoMaps.exe. They're named "z<UTM Zone>y<UTM Northing address divided by 200>". Each row-of-data file has an associated .ptr (pointer) file. All data in the .ptr file is in 32-bit integer format; the first integer is the left-most photo's UTM Easting address divided by 200, the second is the number of photos/blanks in the .dta file, and the rest are the offsets of each photo/blank into the .dta file (after the left-most photo, which has an offset of 0). If consecutive offsets are identical, that means all but the first one are blanks.

Topo data is named with an "a" instead of a "z", and UTM addresses are divided by 800 instead of 200 because the downloaded images are 4 meters/pixel instead of 1 meter/pixel.

Topos can be zoomed from 4 meters/pixel thru 32 meters/pixel. When you switch between topo and photo images, the image might shift due to the different image sizes (compare the square sizes on a screen with no photo or topo maps). But if you change from smaller topo or photo images to larger photo or topo images, everthing will stay in the same place (some topo maps are a little off). Therefore, at the 4 meters/pixel resolution, there may be a shift going from photos to topos, but there won't be any shift going from topos to photos. And therefore again, if you've chosen a fade rate for the 4-meter resolution, there won't be a fade unless the images match up.

The 8 meter photo data is saved in a sub-folder named \BigPhotoMapsData (the UTM addresses are divided by 1600).

Press the Q key to see the name of the data file that contains the image that the mouse pointer is over. Press any other key to see Lat/Lon again.

To delete a photo/topo image, move the mouse pointer to it and press the Delete key.

If you press Ctrl-PageUp or Ctrl-PageDown, the photos will zoom out or in, and the location at the mouse pointer will go to (roughly) the center of the screen.

The F key is a shortcut to download aerial photos.
The T key is a shortcut to switch to topographical images.
The P key is a shortcut to switch to photo images.

The 1 key: if you press and hold the 1 key while looking at 8 meters/pixel aerial photos (at 8 thru 64 Zoom level), missing underlying 1 meter/pixel aerial photos will show as grey.

The X key: Press it to display the lat/lon and UTM at the mouse pointer.

The 7 key: Toggles a 7.5 minute grid on the screen. This grid is only useful for getting elevation data. It shows the 7.5 minute boundaries of elevation data files that you can download from http://64.83.8.153/SDTS_DL_b.htm  If you press the X key while these grids are showing (select 64 meters/pixel Zoom level to see enough 7.5' grids), the lat/lon under the mouse cursor will be written to a file named ElevationLocs.txt in the format required by that Web site. Then, using Notepad, you can cut and paste each lat/lon into that Web site to download elevation data (see the paragraph below beginning with "Elevation data").

If you select Waypoints -Show on the Menu bar (or press Enter, or click the right mouse button), the closest waypoint to the mouse pointer location will be highlighted on the waypoint list.

If you select Name instead of Comment/Description on the waypoint list, the waypoints will be sorted by name instead of by Comment/Description, and its name will be shown when you pass the mouse pointer over a waypoint, instead of its comment/description.

If you select Waypoints -Open File, you can either open an existing waypoint file, or name a new empty one. An empty waypoint file is useful for downloading waypoints from a GPS without mixing them with any others. To make a waypoint when you have the lat/lon or UTM, select View -Goto on the Menu bar, and when you're sent to that location, you'll also see a waypoint name entry box for that lat/lon.

Waypoint data is saved in an XML format (.xml). You can view an XML file with Notepad, or with your Internet Browser if you just click on that file. This specific XML format follows the EasyGPS GPX specification. If you change the file extension from .xml to .gpx, EasyGPS can read it. Elevation data is in Meters. The number of waypoints in each file is limited to 1,000.

To import waypoints (pushpins) from Microsoft's Streets & Trips, you first have to export them from that program by selecting File -Export Map for Pocket Streets. They'll be saved in a .psp file. In USAPhotoMaps, select File -Import S & T Pushpins, and click on that .psp file. They'll be added to the current waypoints if they're in the same UTM zone.

The LineTo distance (in the Waypoints and Text Entries dialog boxes) is in miles. The line is drawn from the mouse position when you press Enter or click the right mouse button or press Alt-W and then L to select Waypoints (or when you press Alt-T and then L to select Text Entries).

Text can be entered and viewed at the 1 or 2 meter zoom levels. Hold the Shift key down and move the Mouse pointer to draw a line on which the text will be entered (any angle between straight up and to the right and almost straight down). When you release the Shift key, a dialog box will appear for entering the text to be drawn on the line (which disappears). Text is limited to 60 characters per entry. Add as many entries as you like. The text data is saved in a file with the same name as the current map, with a .not extension.

If you select Text -List on the Menu bar, the entries are sorted alphabetically, and when the entries are the same, by the most northerly location.

If you've selected Routes -Create on the Menu bar:
Click the left mouse button to make a point.
Move the mouse pointer to make a line.
Click again to continue the route.
Press Ctrl-Z to delete last point.
Double-click or press Escape when finished.
The cumulative distance shown is in feet if it's less than 1,000 feet, or decimal miles if over.
You can enter a maximum of 14,400 route points, but if you send a route to a GPS, it will only accept 30 or 50 points, depending on which one it is.
Routes are saved in a .txt file (in comma separated variable format). The data format is: UTM Zone, UTM Northing, and UTM Easting. You can change the data, but don't change the format.
While creating a route, when you press the left mouse button, the cumulative number of route points will show in the top left of the screen if you've selected a GPS comm port.

If you select
  View - Goto Lat/Lon, 
  Waypoints -Open File,
  Routes -Display, or
  GPS -Tracks -Display,
and the selection is in a different UTM Zone than the one you're viewing, the map will change to the closest one in that UTM Zone. If no map exists for that UTM Zone, then a new map (and USAPhotoMaps.ini entry) will be created (with the name 'ZoneXX' (where XX is the new UTM Zone)).

You can use your computer's Print Screen key to save a screen of your map to the Windows Clipboard (in bmp format).

Elevation data can be obtained by downloading "ConvertSDTSData" from my Web site, reading its instruction file on how to download USGS elevation data from the Web, and using it to convert that elevation data to a format readable by USAPhotoMaps. After doing this for the area you're interested in, the elevation at the mouse pointer will be displayed on the Title bar.
Contour lines can be toggled on and off by pressing the C key (up to a zoom level of 8 meters/pixel). They're 20*zoom feet apart (e.g. 160 feet apart at 8 meters/pixel). The lowest elevation contour lines on the screen are green, and the color is graduated to the highest elevation contour lines, which are tan-colored. The contour lines get less accurate as you zoom out.

USAPhotoMaps can work with the photo data on a CD (or a different hard-drive partition). The data MUST be in a top-level folder named "PhotoMapsData" (CAUTION: not "USAPhotoMapsData"). I recommend that you copy the desired .dta and .ptr files from the \USAPhotoMapsData folder to a folder you've created on your hard-drive named "PhotoMapsData", and then burn that folder with its contents onto the CD. The data in \BigPhotoMapsData is normally too small to bother making USAPhotoMaps able to read it from anywhere but its original sub-folder of  USAPhotoMaps.exe.

There are two ways to use the data on the CD:
1) Use Window's "Run..." (on the Start Menu), and enter something like: "C:\My Documents\USAPhotoMaps\USAPhotoMaps" -X (where X is the letter assigned to your CD drive). Quotation marks are necessary if there's a space in the folder name, and there has to be a single space between the ending quotation mark and the -X.
2) Create a shortcut to USAPhotoMaps, and then right-click on the shortcut icon, and select Properties. In the Properties Target box, add the space and the -X at the end (remember -X is really -D or whatever your CD-ROM drive is).

Don't forget that data on a CD is changed to read-only, so if you copy it back, you'll have to remove the read-only attribute (right-click on a group of files that you've highlighted (selected) and select Preferences and un-check the Read-only box).

If you change anything in File -Preferences, it's saved in USAPM.ini. The colors are in hexadecimal and in BlueGreenRed order.

The map datum used by the Terraserver Web site is NAD83, which is effectively identical to the GPS default datum, WGS84.

The file ijl15.dll is Intel's public domain JPEG conversion library, and can be placed either in the same folder as USAPhotoMaps, or \Windows\System (or \WINNT\System32).

The conversion routines between UTM and Lat/Lon were found at:
http://www.gpsy.com/gpsinfo/geotoutm/index.html
Chuck Gantz wrote a response there entitled "Source Code", with the relevant enclosures. Thanks again, Chuck.

Thanks to Paul Bourke for the contouring method in his article "Conrec - A Contouring Subroutine" in Byte magazine (June (or July), 1987).

Thanks especially to Charles Petzold for his book "Programming Windows".

Congratulations to you if you've read and understood all of the above.

Please email me with comments, suggestions, etc.
jdmcox@jdmcox.com
Doug Cox
140 Monroe Dr
Palo Alto, CA 94306
N37.40750 W122.11645
