# Documentation

## Working with the UTM System

### What Is the Universal Transverse Mercator System?

So far, this chapter has described types and parameters of specific projections, treating each in isolation. The following sections discuss how the Transverse Mercator and Polar Stereographic projections are used to organize a worldwide coordinate grid. This system of projections is generally called Universal Transverse Mercator (UTM). This system supports many military, scientific, and surveying applications.

The UTM system divides the world into a regular nonoverlapping grid of quadrangles, called zones, each 8 by 6 degrees in extent. Each zone uses formulas for a transverse version of the Mercator projection, with projection and ellipsoid parameters designed to limit distortion. The Transverse Mercator projection is defined between 80 degrees south and 84 degrees north. Beyond these limits, the Universal Polar Stereographic (UPS) projection applies.

The UPS has two zones only, `north` and `south`, which also have special projection and ellipsoid parameters.

In addition to the zone identifier—a grid reference in the form of a number followed by a letter (e.g., `31T`)—each UTM zone has a false northing and a false easting. These are offsets (in meters) that enable each zone to have positive coordinates in both directions. For UTM, they are constant, as follows:

• False easting (for every zone): 500,000 m

• False northing (all zones in the Northern Hemisphere): 0 m

• False northing (all zones in the Southern Hemisphere): 1,000,000 m

For UPS (in both the `north` and `south` zones), the false northing and false easting are both 2,000,000.

### Understanding UTM Parameters

You can create UTM maps with `axesm`, just like any other projection. However, unlike other projections, the map frame is limited to an 8-by-6 degree map window (the UTM zone), as the following steps illustrate.

1. Create a UTM map axes:

`axesm utm`
2. Get the map axes properties and inspect them in the Command Window or with the MATLAB® Variables editor. The first few illustrate the projection defaults:

```h = getm(gca) mapprojection: 'utm' zone: '31N' angleunits: 'degrees' aspect: 'normal' falsenorthing: 0 falseeasting: 500000 fixedorient: [] geoid: [6.3782e+006 0.082483] maplatlimit: [0 8] maplonlimit: [0 6] mapparallels: [] nparallels: 0 origin: [0 3 0] scalefactor: 0.9996 trimlat: [-80 84] trimlon: [-180 180] frame: 'off' ffill: 100 fedgecolor: [0 0 0] ffacecolor: 'none' flatlimit: [0 8] flinewidth: 2 flonlimit: [-3 3] ...```

Note that the default `zone` is `31N`. This is selected because the map `origin` defaults to [0 3 0], which is on the equator and at a longitude of 3º E. This is the center longitude of zone `31N`, which has a latitude limit of [0 8], and a longitude limit of [0 6].

3. Move the `zone` one to the east, and inspect the other parameters again:

```setm(gca,'zone','32n') h = getm(gca) mapprojection: 'utm' zone: '32N' angleunits: 'degrees' aspect: 'normal' falsenorthing: 0 falseeasting: 500000 fixedorient: [] geoid: [6.3782e+006 0.082483] maplatlimit: [0 8] maplonlimit: [6 12] mapparallels: [] nparallels: 0 origin: [0 9 0] scalefactor: 0.9996 trimlat: [-80 84] trimlon: [-180 180] frame: 'off' ffill: 100 fedgecolor: [0 0 0] ffacecolor: 'none' flatlimit: [0 8] flinewidth: 2 flonlimit: [-3 3] ...```

Note that the map origin and limits are adjusted for zone `32N`.

4. Draw the map grid and label it:

`setm(gca,'grid','on','meridianlabel','on','parallellabel','on')`
5. Load and plot the `coast` data set to see a close-up of the Gulf of Guinea and Bioko Island in UTM:

```load coast plotm(lat,long)```

### Setting UTM Parameters with a GUI

The easiest way to use the UTM projection is through a graphical user interface. You can create or modify a UTM area of interest with the `axesmui` projection control panel, and get further assistance form the `utmzoneui` control panel.

1. You can Shift+click in a map axes window, or type `axesmui` to display the projection control panel. Here you start from scratch:

```figure; axesm utm axesmui```

The Map Projection field is set to `cyln: Universal Transverse Mercator (UTM)`.

 Note   For UTM and UPS maps, the Aspect field is set to `normal` and cannot be changed. If you attempt to specify `transverse`, an error results.
2. Click the Zone button to open the `utmzoneui` panel. Click the map near your area of interest to pick the zone:

Note that while you can open the `utmzoneui` control panel from the command line, you then have to manually update the figure with the zone name it returns with a `setm` command:

`setm(gca,'zone',ans)`
3. Click the Accept button.

The `utmzoneui` panel closes, and the `zone` field is set to the one you picked. The map limits are updated accordingly, and the geoid parameters are automatically set to an appropriate ellipsoid definition for that zone. You can override the default choice by selecting another ellipsoid from the list or by typing the parameters in the Geoid field.

4. Click Apply to close the projection control panel.

The projection is then ready for projection calculations or map display commands.

5. Now view a choropleth base map from the `usstatehi` shapefile for the area within the zone that you just selected:

```states = shaperead('usastatehi', 'UseGeoCoords', true); framem faceColors = makesymbolspec('Polygon',... {'INDEX', [1 numel(states)],... 'FaceColor', polcmap(numel(states))}); geoshow(states,'DisplayType', 'polygon',... 'SymbolSpec', faceColors)```

What you see depends on the zone you selected. The preceding display is for zone 18T, which contains portions of New England and the Middle Atlantic states.

You can also calculate projected UTM grid coordinates from latitudes and longitudes:

```[latlim, lonlim] = utmzone('15S') latlim = 32 40 lonlim = -96 -90 [x,y] = mfwdtran(latlim, lonlim) x = -1.5029e+006 -7.8288e+005 y = 3.7403e+006 4.5369e+006```

### Working in UTM Without a Map Axes

You can set up UTM to calculate coordinates without generating a map display, using the `defaultm` function. The `utmzone` and `utmgeoid` functions help you select a zone and an appropriate ellipsoid. In the following exercise, you generate UTM coordinate data for a location in New York City, using that point to define the projection itself.

1. Define a location in New York City:

`p1 = [40.7, -74.0];`
2. Obtain the UTM zone for this point:

```z1 = utmzone(p1) z1 = 18T```
3. Obtain the suggested ellipsoid vector and name for this zone:

```[ellipsoid,estr] = utmgeoid(z1) ellipsoid = 6.3782e+006 0.082272 estr = clarke66```
4. Set up the UTM coordinate system based on this information:

```utmstruct = defaultm('utm'); utmstruct.zone = '18T'; utmstruct.geoid = ellipsoid; utmstruct = defaultm(utmstruct) ```

The empty latitude limits will be set properly by `defaultm`.

5. Now you can calculate the grid coordinates, without a map display:

```[x,y] = mfwdtran(utmstruct,p1(1),p1(2)) x = 5.8448e+005 y = 4.5057e+006```

#### More on utmzone

You can also use the `utmzone` function to compute the zone limits for a given zone name. For example, using the preceding data, the latitude and longitude limits for zone 18T are

```utmzone('18T') ans = 40 48 -78 -72```

Therefore, you can call `utmzone` recursively to obtain the limits of the UTM zone within which a point location falls:

```[zonelats zonelons] = utmzone(utmzone(40.7, -74.0)) zonelats = 40 48 zonelons = -78 -72```

For further information, see the reference pages for `utmzone`, `utmgeoid`, and `defaultm`.

### Mapping Across UTM Zones

Because UTM is a zone-based coordinate system, it is designed to be used like a map series, selecting from the appropriate sheet. While it is possible to extend one zone's coordinates into a neighboring zone's territory, this is not normally done.

To display areas that extend across more than one UTM zone, it might be appropriate to use the Mercator projection in a transverse aspect. Of course, you do not obtain coordinates in meters that would match those of a UTM projection, but the results will be nearly as accurate. Here is an example of a transverse Mercator projection appropriate to Chile. Note how the projection's line of zero distortion is aligned with the predominantly north-south axis of the country. The zero distortion line could be put exactly on the midline of the country by a better choice of the orientation vector's central meridian and orientation angle.

```figure; latlim = [-60 -15];centralMeridian = -70; width = 20; axesm('mercator',... 'Origin',[0 centralMeridian -90],... 'Flatlimit',[-width/2 width/2],... 'Flonlimit',sort(-latlim),... 'Aspect','transverse') land = shaperead('landareas.shp', 'UseGeoCoords', true); geoshow([land.Lat], [land.Lon]); framem gridm; setm(gca,'plinefill',1000) tightmap mdistort scale```
 Note   You might receive warnings about points from `landareas.shp` falling outside the valid projection region. You can ignore such warnings.