Next / Previous / Contents / TCC Help System / NM Tech homepage

4.áBuilding the map base

Once you have entered your waypoints, the next step is to build up local copies of the TerraServer's map data for the area of interest.

First, designate or create a specific directory as the root of the map base. By default, this is directory tiles/ in the current directory. You will also need to create a subdirectory, under the map base root directory, named tiles-n, for each magnification you will need, where n is the magnification code.

For each area, you will need to find the geographic coordinates that delimit it. In practice, an area is defined by minimum and maximum latitude and longitude values, which define a rectangle in the usual Mercator projection.

Once you have the coordinates of the target area, you will then run the buildmapbase script to download local copies of the relevant map data.

4.1.áThe routebox script

To find the geographic limits of one route or all routes in a given waypoint file, use the routebox script:

    routebox wayfile [route-id]

where wayfile is the name of the waypoint file, and route-id is the optional route name. The program will print a line like this:

34.02417n107.18114w 34.05033n107.13056w

4.2.áThe buildmapbase script

Then, assuming you have an Internet connection, the buildmapbase script will add the necessary data to your map base root directory:

    buildmapbase [option ...] c1 c2

where the options include:

-m mag

Specifies the magnification code of the desired map base. Good first guesses for this argument are 1 for photoquad tiles and 4 for topo map tiles. The default value is 4.

-k kind

specifies a kind of tile, 1 for photoquad tiles, 2 for topo map tiles. The default is 2.

-b map-base

Specifies the directory containing the map base (see building the map base, above). The default is subdirectory tiles/ in the current directory.

-x margin

Specifies an extra margin to be shown around the rectangle defined by the waypoints. The units of margin are in tiles. For example, if you are using topo maps at the recommended 4 meters/pixel scale, the default margin is half a tile, or 400 meters; if you set the option -x 2.0, you would get a margin of 1600 meters.

Two positional arguments are required:

c1

Specifies one corner of the area to be covered. as a The notation is like that used in the raw waypoints file, except that the latitude and longitude are concatenated into a single item. For example, 3404n10654w means 34░4' N. Lat., 106░54' W. Long.

c2

Specifies the opposite corner of the area to be covered, in the same way.

So, if the output of the routebox script looks like this:

    34.02417n107.18114w 34.05033n107.13056w

To load up a map base in directory mtns for this area with 4-meter/pixel topo maps, insure that there is a subdirectory mtns/tiles-4, and then use this command:

    buildmapbase -b mtns -m 4 -k 2 34.02417n107.18114w 34.05033n107.13056w