0% found this document useful (0 votes)
440 views

MATLAB Mapping Toolbox User s Guide The Mathworks All Chapters Instant Download

User

Uploaded by

kozakbriar18
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
440 views

MATLAB Mapping Toolbox User s Guide The Mathworks All Chapters Instant Download

User

Uploaded by

kozakbriar18
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

MATLAB Mapping Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-mapping-toolbox-
user-s-guide-the-mathworks/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

MATLAB Econometrics Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-econometrics-toolbox-user-s-
guide-the-mathworks/

textboxfull.com

MATLAB Bioinformatics Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-bioinformatics-toolbox-user-s-
guide-the-mathworks/

textboxfull.com

MATLAB Optimization Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-optimization-toolbox-user-s-
guide-the-mathworks/

textboxfull.com

MATLAB Trading Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-trading-toolbox-user-s-guide-
the-mathworks/

textboxfull.com
MATLAB Computer Vision Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-computer-vision-toolbox-user-
s-guide-the-mathworks/

textboxfull.com

MATLAB Curve Fitting Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-curve-fitting-toolbox-user-s-
guide-the-mathworks/

textboxfull.com

MATLAB Fuzzy Logic Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-fuzzy-logic-toolbox-user-s-
guide-the-mathworks/

textboxfull.com

MATLAB Global Optimization Toolbox User s Guide The


Mathworks

https://textbookfull.com/product/matlab-global-optimization-toolbox-
user-s-guide-the-mathworks/

textboxfull.com

MATLAB Image Processing Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-image-processing-toolbox-user-
s-guide-the-mathworks/

textboxfull.com
Mapping Toolbox™
User's Guide

R2020a
How to Contact MathWorks

Latest news: www.mathworks.com

Sales and services: www.mathworks.com/sales_and_services

User community: www.mathworks.com/matlabcentral

Technical support: www.mathworks.com/support/contact_us

Phone: 508-647-7000

The MathWorks, Inc.


1 Apple Hill Drive
Natick, MA 01760-2098
Mapping Toolbox™ User's Guide
© COPYRIGHT 1997–2020 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied
only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form
without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through
the federal government of the United States. By accepting delivery of the Program or Documentation, the government
hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer
software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014.
Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain
to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and
Documentation by the federal government (or other entity acquiring for or through the federal government) and shall
supersede any conflicting contractual terms or conditions. If this License fails to meet the government's needs or is
inconsistent in any respect with federal procurement law, the government agrees to return the Program and
Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be
trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for
more information.
Revision History
May 1997 First printing New for Version 1.0
October 1998 Second printing Version 1.1
November 2000 Third printing Version 1.2 (Release 12)
July 2002 Online only Revised for Version 1.3 (Release 13)
September 2003 Online only Revised for Version 1.3.1 (Release 13SP1)
January 2004 Online only Revised for Version 2.0 (Release 13SP1+)
April 2004 Online only Revised for Version 2.0.1 (Release 13SP1+)
June 2004 Fourth printing Revised for Version 2.0.2 (Release 14)
October 2004 Online only Revised for Version 2.0.3 (Release 14SP1)
March 2005 Fifth printing Revised for Version 2.1 (Release 14SP2)
August 2005 Sixth printing Minor revision for Version 2.1
September 2005 Online only Revised for Version 2.2 (Release 14SP3)
March 2006 Online only Revised for Version 2.3 (Release 2006a)
September 2006 Seventh printing Revised for Version 2.4 (Release 2006b)
March 2007 Online only Revised for Version 2.5 (Release 2007a)
September 2007 Eighth printing Revised for Version 2.6 (Release 2007b)
March 2008 Online only Revised for Version 2.7 (Release 2008a)
October 2008 Online only Revised for Version 2.7.1 (Release 2008b)
March 2009 Online only Revised for Version 2.7.2 (Release 2009a)
September 2009 Online only Revised for Version 3.0 (Release 2009b)
March 2010 Online only Revised for Version 3.1 (Release 2010a)
September 2010 Online only Revised for Version 3.2 (Release 2010b)
April 2011 Online only Revised for Version 3.3 (Release 2011a)
September 2011 Online only Revised for Version 3.4 (Release 2011b)
March 2012 Online only Revised for Version 3.5 (Release 2012a)
September 2012 Online only Revised for Version 3.6 (Release 2012b)
March 2013 Online only Revised for Version 3.7 (Release 2013a)
September 2013 Online only Revised for Version 4.0 (Release 2013b)
March 2014 Online only Revised for Version 4.0.1 (Release 2014a)
October 2014 Online only Revised for Version 4.0.2 (Release 2014b)
March 2015 Online only Revised for Version 4.1 (Release 2015a)
September 2015 Online only Revised for Version 4.2 (Release 2015b)
March 2016 Online only Revised for Version 4.3 (Release 2016a)
September 2016 Online only Revised for Version 4.4 (Release 2016b)
March 2017 Online only Revised for Version 4.5 (Release 2017a)
September 2017 Online only Revised for Version 4.5.1 (Release 2017b)
March 2018 Online only Revised for Version 4.6 (Release 2018a)
September 2018 Online only Revised for Version 4.7 (Release 2018b)
March 2019 Online only Revised for Version 4.8 (Release 2019a)
September 2019 Online only Revised for Version 4.9 (Release 2019b)
March 2020 Online only Revised for Version 4.10 (Release 2020a)
Contents

Getting Started
1
Mapping Toolbox Product Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3

Create Your First World Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4

Tour Boston with the Map Viewer App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9


Open the Map Viewer App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9

Getting More Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-24


Ways to Get Mapping Toolbox Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-24

Understanding Map Data


2
What Is a Map? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

What Is Geospatial Data? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3

Vector Geodata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4

Inspect and Display Vector Map Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5

Raster Geodata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7


Digital Elevation Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Remotely Sensed Image Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7

Generate Shaded Relief Map using Raster Data . . . . . . . . . . . . . . . . . . . . . 2-8

Combine Vector and Raster Geodata on the Same Map . . . . . . . . . . . . . . 2-11


Combining Raster Data and Vector Data on the Same Map . . . . . . . . . . . 2-11

Create and Display Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14


Simple Polygon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Polygons with Holes or Multiple Regions . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Polygons Using Geographic Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Filled Region of Polygons Using Geographic Coordinates . . . . . . . . . . . . 2-19

Segments Versus Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22

v
Geographic Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
Shapefiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
The Contents of Geographic Data Structures . . . . . . . . . . . . . . . . . . . . . 2-24
Examining a Geographic Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . 2-26
How to Construct Geographic Data Structures . . . . . . . . . . . . . . . . . . . . 2-27
Mapping Toolbox Version 1 Display Structures . . . . . . . . . . . . . . . . . . . . 2-31

Georeferenced Raster Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32


Referencing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
Referencing Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
Referencing Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32

Construct a Global Data Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-34

Convert Between Geographic and Intrinsic Coordinates . . . . . . . . . . . . . 2-36

Precompute the Size of a Data Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38

Geolocated Data Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-39


Define Geolocated Data Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-39

Geographic Interpretations of Geolocated Grids . . . . . . . . . . . . . . . . . . . 2-43


Type 1: Values Associated with the Upper Left Grid Coordinate . . . . . . . 2-43
Type 2: Values Centered Within Four Adjacent Coordinates . . . . . . . . . . 2-44
Ordering of Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-45
Transform Regular to Geolocated Grids . . . . . . . . . . . . . . . . . . . . . . . . . 2-45
Transforming Geolocated to Regular Grids . . . . . . . . . . . . . . . . . . . . . . . 2-45

Unprojecting a Digital Elevation Model (DEM) . . . . . . . . . . . . . . . . . . . . 2-46

Creating a Half-Resolution Georeferenced Image . . . . . . . . . . . . . . . . . . 2-60

Georeferencing an Image to an Orthotile Base Layer . . . . . . . . . . . . . . . 2-65

Find Geospatial Data Online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-77

Find Vector Geodata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-78

Find Geospatial Raster Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-80


Download Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-80
Use Web Map Service Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-81

Functions that Read and Write Geospatial Data . . . . . . . . . . . . . . . . . . . . 2-82

Export Vector Geodata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-85

Exporting Vector Data to KML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-86

Export KML Files for Viewing in Earth Browsers . . . . . . . . . . . . . . . . . . . 2-97


Generate a Single Placemark Using kmlwritepoint . . . . . . . . . . . . . . . . . 2-97
Generate Placemarks from Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-98
Export Point Geostructs to Placemarks . . . . . . . . . . . . . . . . . . . . . . . . . . 2-98

vi Contents
Select Shapefile Data to Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-101
Example 1: Predicate Function in Separate File . . . . . . . . . . . . . . . . . . 2-101
Example 2: Predicate as Function Handle . . . . . . . . . . . . . . . . . . . . . . . 2-102
Example 3: Predicate as Anonymous Function . . . . . . . . . . . . . . . . . . . 2-102
Example 4: Predicate (Anonymous Function) Defined Within Cell Array 2-103
Example 5: Parametrizing the Selector; Predicate as Nested Function . 2-103

Functions That Read and Write Files in Compressed Formats . . . . . . . 2-105

Exporting Images and Raster Grids to GeoTIFF . . . . . . . . . . . . . . . . . . . 2-106

Converting Coastline Data (GSHHG) to Shapefile Format . . . . . . . . . . . 2-122

Understanding Geospatial Geometry


3
The Shape of the Earth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Ellipsoid Shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Geoid Shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2

Reference Spheroids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4


referenceSphere Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
referenceEllipsoid Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
World Geodetic System 1984 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Ellipsoid Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
oblateSpheroid Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10

Work with Reference Spheroids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11


Map Projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
Curves and Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
3-D Coordinate Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12

Latitude and Longitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13


Plot Latitude and Longitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13

Relationship Between Points on Sphere . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15

Length and Distance Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16


Choosing Units of Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
Converting Units of Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16

Compute Conversion Ratio Between Units of Length . . . . . . . . . . . . . . . 3-17

Angle Representations and Angular Units . . . . . . . . . . . . . . . . . . . . . . . . 3-18


Radians and Degrees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18
Default and Variable Angle Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
Degrees, Minutes, and Seconds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
Converting Angle Units that Vary at Run Time . . . . . . . . . . . . . . . . . . . . 3-20

Angles as Binary and Formatted Numbers . . . . . . . . . . . . . . . . . . . . . . . . 3-22


Formatting Latitudes and Longitudes . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22

vii
Convert from Linear Measurements to Spherical Measurements . . . . . . 3-23

Distances on the Sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24


Arc Length as an Angle in the distance and reckon Functions . . . . . . . . . 3-25
Summary: Available Distance and Angle Conversion Functions . . . . . . . . 3-25

Great Circles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27

Rhumb Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28

Azimuth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29
Calculate Azimuth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29

Elevation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-31

Generate Vector Data for Points Along Great Circle or Rhumb Line Tracks
......................................................... 3-32

Reckoning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-34

Calculate Distance Between Two Points in Geographic Space . . . . . . . . 3-35

Small Circles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-36

Calculate Vector Data for Points Along a Small Circle . . . . . . . . . . . . . . . 3-37

Generate Small Circles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38

Measure Area of Spherical Quadrangles . . . . . . . . . . . . . . . . . . . . . . . . . . 3-40

Plotting a 3-D Dome as a Mesh Over a Globe . . . . . . . . . . . . . . . . . . . . . . 3-41

Choose a 3-D Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-47


Earth-Centered Earth-Fixed Coordinates . . . . . . . . . . . . . . . . . . . . . . . . 3-47
Geodetic Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-48
East-North-Up Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-49
North-East-Down Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-49
Azimuth-Elevation-Range Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . 3-50
Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-51

Vectors in 3-D Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52


Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-53

Find Ellipsoidal Height from Orthometric Height . . . . . . . . . . . . . . . . . . 3-55


Find Ellipsoidal Height from Orthometric and Geoid Height . . . . . . . . . . 3-57

Creating and Viewing Maps


4
Introduction to Mapping Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2

viii Contents
Continent, Country, Region, and State Maps Made Easy . . . . . . . . . . . . . . 4-3

Set Background Colors for Map Displays . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4

Create Simple Maps Using worldmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5

Create Simple Maps Using usamap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7

The Map Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11


Tips to Working with Map Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11

Access and Change Map Axes Properties . . . . . . . . . . . . . . . . . . . . . . . . . 4-13

Map Limit Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19


Specify Map Projection Origin and Frame Limits Automatically . . . . . . . 4-20
Create Cylindrical Projection Using Map Limit Properties . . . . . . . . . . . . 4-23
Create Conic Projection Using Map Limit Properties . . . . . . . . . . . . . . . . 4-25
Create Southern Hemisphere Conic Projection . . . . . . . . . . . . . . . . . . . . 4-26
Create North-Polar Azimuthal Projection . . . . . . . . . . . . . . . . . . . . . . . . 4-27
Create South-Polar Azimuthal Projection . . . . . . . . . . . . . . . . . . . . . . . . 4-29
Create Equatorial Azimuthal Projection . . . . . . . . . . . . . . . . . . . . . . . . . 4-30
Create General Azimuthal Projection . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31
Create Long Narrow Oblique Mercator Projection . . . . . . . . . . . . . . . . . 4-32

Switch Between Projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34


Change Projection Updating Meridian and Parallel Labels . . . . . . . . . . . 4-34
Change Projection Resetting Frame Limits . . . . . . . . . . . . . . . . . . . . . . . 4-36

Reprojection of Graphics Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40


Auto-Reprojection of Mapped Objects and Its Limitations . . . . . . . . . . . . 4-40
Reprojectability of Maps Generated Using geoshow . . . . . . . . . . . . . . . . 4-41

Create Maps Using geoshow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-43

Creating Maps Using MAPSHOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-50

Change Map Projections Using geoshow . . . . . . . . . . . . . . . . . . . . . . . . . . 4-68


Change Map Projection with Vector Data Using geoshow . . . . . . . . . . . . 4-68
Change Map Projection with Raster Data Using geoshow . . . . . . . . . . . . 4-69

Use Geographic and Nongeographic Objects in Map Axes . . . . . . . . . . . 4-72

The Map Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-75

Plot Regions of Robinson Frame and Grid Using Map Limits . . . . . . . . . 4-77

Map and Frame Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-82

The Map Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-83


Control Grid Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-83
Layer Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-83
Limit Grid Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-83
Label Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-84

ix
Summary of Polygon Display Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-86

Display Vector Data as Points and Lines . . . . . . . . . . . . . . . . . . . . . . . . . . 4-87

Display Vector Maps as Lines or Patches . . . . . . . . . . . . . . . . . . . . . . . . . . 4-91

Types of Data Grids and Raster Display Functions . . . . . . . . . . . . . . . . . . 4-98

Fit Gridded Data to the Graticule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-99


Fit Gridded Data to Fine and Coarse Graticules . . . . . . . . . . . . . . . . . . . 4-99

Create 3-D Displays with Raster Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-103

Creating Map Displays with Latitude and Longitude Data . . . . . . . . . . 4-106

Creating Map Displays with Data in Projected Coordinate Reference


System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-116

Pick Locations Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-124

Creating an Interactive Map for Selecting Point Features . . . . . . . . . . 4-126

Create Small Circle and Track Annotations on Maps Interactively . . . . 4-133

Interactively Display Text Annotations on a Map . . . . . . . . . . . . . . . . . . 4-135

Work with Objects by Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-136


Manipulate Displayed Map Objects By Name . . . . . . . . . . . . . . . . . . . . 4-136

Making Three-Dimensional Maps


5
Sources of Terrain Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Digital Terrain Elevation Data from NGA . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Digital Elevation Model Files from USGS . . . . . . . . . . . . . . . . . . . . . . . . . 5-2

Determine and Visualize Visibility Across Terrain . . . . . . . . . . . . . . . . . . . 5-3


Compute Line of Sight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3

Light a Terrain Map of a Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5

Light a Global Terrain Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8

Surface Relief Shading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12


Create Monochrome Shaded Relief Map . . . . . . . . . . . . . . . . . . . . . . . . . 5-12

Colored Surface Shaded Relief . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-17


Create Colored Shaded Relief Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-17

Relief Mapping with Light Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21


Illuminate Color 3-D Relief Maps with Light Objects . . . . . . . . . . . . . . . . 5-21

x Contents
Drape Data on Elevation Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-29
Combine Elevation Maps with Other Kinds of Data . . . . . . . . . . . . . . . . . 5-29
Drape Data over Terrain with Different Gridding . . . . . . . . . . . . . . . . . . . 5-29

Drape Geoid Heights Over Topography . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30

Combine Dissimilar Grids by Converting Regular Grid to Geolocated Data


Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35

Drape Geolocated Grid on Regular Data Grid via Texture Mapping . . . . 5-41

The Globe Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-44

The Globe Display Compared with the Orthographic Projection . . . . . . . 5-45

Use Opacity and Transparency in Globe Displays . . . . . . . . . . . . . . . . . . . 5-51

Over-the-Horizon 3-D Views Using Camera Positioning Functions . . . . . 5-54

Display a Rotating Globe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-62

Access Basemaps and Terrain for Geographic Globe . . . . . . . . . . . . . . . . 5-67


Use Installed Basemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-67
Download Basemaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-67
Add Custom Basemaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-67
Access Terrain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-67
Specify Basemaps and Terrain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-68

Create Interactive Basemap Picker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-69

Customizing and Printing Maps


6
Inset Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2

Graphic Scales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9

North Arrows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15

Thematic Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18


Choropleth Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18
Stem Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19
Contour Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19
Scatter Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20

Create Choropleth Map of Population Density . . . . . . . . . . . . . . . . . . . . . 6-21

Colormaps for Terrain Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-24


Explore Colormaps for Terrain Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-24

Contour Colormaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27

xi
Colormaps for Political Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
Explore Colormaps for Political Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
Labeling Colorbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
Editing Colorbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33

Scale Maps for Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34

Manipulating Geospatial Data


7
Extract and Join Polygons or Line Segments . . . . . . . . . . . . . . . . . . . . . . . 7-2

Link Line Segments with Common Endpoints into Polygons . . . . . . . . . . . 7-4

Geographic Interpolation of Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5

Interpolate Vertices Between Known Data Points . . . . . . . . . . . . . . . . . . . 7-7

Interpolate Coordinates at Specific Locations . . . . . . . . . . . . . . . . . . . . . . 7-8

Vector Intersections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9

Calculate Intersections of Small Circles . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11

Calculate Intersection of Rhumb Line Tracks . . . . . . . . . . . . . . . . . . . . . . 7-12

Calculate Intersections of Vector Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13

Calculate Area of Geographic Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15

Polygon Set Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16

Overlay Polygons Using Set Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17

Remove Longitude Coordinate Discontinuities at Date Line Crossings


......................................................... 7-22

Polygon Buffer Zones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26


Generate Buffer Internal to Polygon . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26

Trim Vectors to Preserve Polygonal Patches . . . . . . . . . . . . . . . . . . . . . . . 7-28

Filter Vector Data to Remove Unwanted Points . . . . . . . . . . . . . . . . . . . . 7-31

Simplify Vector Coordinate Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32

Simplify Polygon and Line Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-33

Convert Vector Data to Raster Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-38


Creating Data Grids from Vector Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-38

xii Contents
Rasterize Polygons Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-43

Data Grids as Logical Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-45

Determine Area Occupied by Logical Grid Variable . . . . . . . . . . . . . . . . . 7-46

Compute Elevation Profile Along Straight Line . . . . . . . . . . . . . . . . . . . . 7-48

Compute Gradient, Slope, and Aspect from Regular Data Grid . . . . . . . . 7-51

Using Map Projections and Coordinate Systems


8
Map Projections and Distortions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Use Inverse Projection to Recover Geographic Coordinates . . . . . . . . . . . 8-2
Projection Distortions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2

Quantitative Properties of Map Projections . . . . . . . . . . . . . . . . . . . . . . . . 8-4

The Three Main Families of Map Projections . . . . . . . . . . . . . . . . . . . . . . . 8-5


Unwrapping the Sphere to a Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Cylindrical Projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Conic Projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
Azimuthal Projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7

Projection Aspect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9


The Orientation Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
Control the Map Projection Aspect with an Orientation Vector . . . . . . . . 8-11

Projection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-16


Projection Characteristics Maps Can Have . . . . . . . . . . . . . . . . . . . . . . . 8-16

Visualize Spatial Error Using Tissot Indicatrices . . . . . . . . . . . . . . . . . . . 8-22


Visualize Projection Distortions using Tissot Indicatrices . . . . . . . . . . . . 8-22

Visualize Projection Distortions Using Isolines . . . . . . . . . . . . . . . . . . . . 8-26

Quantify Map Distortions at Point Locations . . . . . . . . . . . . . . . . . . . . . . 8-30


Use distortcalc to Determine Map Projection Geometric Distortions . . . . 8-30

Project Coordinates Without Map Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-34

Rotational Transformations on the Globe . . . . . . . . . . . . . . . . . . . . . . . . . 8-36


Reorient Vector Data with rotatem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-36
Reorient Gridded Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-38

The Universal Transverse Mercator System . . . . . . . . . . . . . . . . . . . . . . . 8-40

Create a UTM Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-41

Set UTM Parameters Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-45

xiii
Work in UTM Without a Displayed Map . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-48

Use the Transverse Aspect to Map Across UTM Zones . . . . . . . . . . . . . . . 8-51

Summary and Guide to Projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-53

Creating Web Map Service Maps


9
Basic WMS Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2

Basic Workflow for Creating WMS Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3


Workflow Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
Create a Map of Elevation in Europe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3

Search the WMS Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5


Introduction to the WMS Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
Find Temperature Data in the WMS Database . . . . . . . . . . . . . . . . . . . . . . 9-5

Refine Your Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7


Refine Search by Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7
Refine Search by Geographic Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7

Update Your Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8

Retrieve Your Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10


Map Retrieval Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10
Understand Coordinate Reference System Codes . . . . . . . . . . . . . . . . . . 9-10
Retrieve Your Map with wmsread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11
Use wmsread with Optional Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
Add a Legend to Your Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
Retrieve Your Map with WebMapServer.getMap . . . . . . . . . . . . . . . . . . . 9-19

Modify Your Map Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24


Set Map Request Geographic Limits and Time . . . . . . . . . . . . . . . . . . . . 9-24
Edit Web Map Request URL Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25

Overlay Multiple Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-27


Create Composite Map of Multiple Layers from One Server . . . . . . . . . . 9-27
Combine Layers from One Server with Data from Other Sources . . . . . . 9-28
Drape Orthoimagery Over DEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-29

Animate Data Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-33


Create Movie of Terra/MODIS Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-33
Create Animated GIF File of WMS Maps . . . . . . . . . . . . . . . . . . . . . . . . . 9-34
Animate Time-Lapse Radar Observations . . . . . . . . . . . . . . . . . . . . . . . . 9-36

Display Animation of Radar Images over GOES Backdrop . . . . . . . . . . . 9-39

Retrieve Data from Web Map Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-41


Merge Elevation Data with Rasterized Vector Data . . . . . . . . . . . . . . . . . 9-42
Display Merged Elevation and Bathymetry Layer (SRTM30 Plus) . . . . . . 9-44

xiv Contents
Drape WMS Imagery onto Elevation Data . . . . . . . . . . . . . . . . . . . . . . . . 9-46

Save Your Favorite Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-49

Explore Other Layers using a Capabilities Document . . . . . . . . . . . . . . . 9-50

Write WMS Images to a KML File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-53

Search for Layers Outside the Database . . . . . . . . . . . . . . . . . . . . . . . . . . 9-55

Troubleshoot WMS Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-56


Connection Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-56
Wrong Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-57
Problems with Geographic Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-58
Problems with Server Changing LayerName . . . . . . . . . . . . . . . . . . . . . . 9-58
Non-EPSG:4326 Coordinate Reference Systems . . . . . . . . . . . . . . . . . . . 9-58
Map Not Returned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-59
Unsupported WMS Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-60
Other Unrecoverable Server Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-60

Troubleshoot Access to the Hosted WMS Database . . . . . . . . . . . . . . . . . 9-61

Introduction to Web Map Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-62


Web Map Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-64

Basic Workflow for Displaying Web Maps . . . . . . . . . . . . . . . . . . . . . . . . . 9-66


Workflow Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-66

Display a Web Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-67

Select a Base Layer Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-68

Specify a Custom Base Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-70

Specify a WMS Layer as a Base Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-72

Add an Overlay Layer to the Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-74

Add Line, Polygon, and Marker Overlay Layers to Web Maps . . . . . . . . . 9-76

Remove Overlay Layers on a Web Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-82

View Multiple Web Maps in a Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-86

Navigate a Web Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-89

Close a Web Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-92

Annotate a Web Map with Measurement Information . . . . . . . . . . . . . . . 9-93

Compositing and Animating Web Map Service (WMS) Meteorological


Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-97

xv
Troubleshoot Common Problems with Web Maps . . . . . . . . . . . . . . . . . . 9-112
Why Does My Web Map Contain Empty Tiles? . . . . . . . . . . . . . . . . . . . . 9-112
Why Does My Web Map Lose Detail When I Zoom In? . . . . . . . . . . . . . . 9-112

Mapping Applications
10
Geographic Statistics for Point Locations on a Sphere . . . . . . . . . . . . . . 10-2
Geographic Means . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Geographic Standard Deviation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3

Equal-Areas in Geographic Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6


Geographic Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
Converting to an Equal-Area Coordinate System . . . . . . . . . . . . . . . . . . . 10-7

Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
What Is Navigation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
Conventions for Navigational Functions . . . . . . . . . . . . . . . . . . . . . . . . . 10-9

Fix Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11


Some Possible Situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11
Using navfix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14
A Numerical Example of Using navfix . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16

Plan the Shortest Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-20

Display Navigational Tracks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-23

Dead Reckoning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-26

Drift Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-30

Time Zones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-32

Map Projections — Alphabetical List


11

xvi Contents
1

Getting Started

This chapter provides step-by-step examples of basic Mapping Toolbox capabilities and guides you
toward examples and documentation that can help answer your questions. For an alphabetical list of
functions click on MATLAB Functions link at bottom of mainMapping Toolbox page.

• “Mapping Toolbox Product Description” on page 1-2


• “Acknowledgments” on page 1-3
• “Create Your First World Map” on page 1-4
• “Tour Boston with the Map Viewer App” on page 1-9
• “Getting More Help” on page 1-24
1 Getting Started

Mapping Toolbox Product Description


Analyze and visualize geographic information

Mapping Toolbox provides algorithms, functions, and an app for analyzing geographic data and
creating map displays in MATLAB®. You can import vector and raster data from a wide range of file
formats and web map servers. The toolbox lets you subset and customize data using trimming,
interpolation, resampling, coordinate transformations, and other techniques. Geospatial data can be
combined with base map layers from multiple sources in a single map display. You can export data in
file formats such as shapefile, GeoTIFF, and KML. By incorporating mapping functions into MATLAB
programs, you can automate frequent tasks in your geospatial workflow.

Key Features
• Vector and raster data import and export
• Custom raster map retrieval from Web Map Services (WMS) servers
• Web map display with dynamic base maps from OpenStreetMap and other sources
• 2D and 3D map display, customization, and interaction
• Digital terrain and elevation model analysis functions
• Geometric geodesy functions, including 2D and 3D coordinate transformations and more than 65
map projections

1-2
Acknowledgments

Acknowledgments
This software was originally developed and maintained through Version 1.3 by Systems Planning and
Analysis, Inc. (SPA), of Alexandria, Virginia.

Except where noted, the information contained in example and sample data files (found in
toolbox/map/mapdata) is derived from publicly available digital data sets. These data files are
provided as a convenience to Mapping Toolbox users. MathWorks makes no claims that any of this
data is free of defects or errors, or that the representations of geographic features or names are up to
date or authoritative.

1-3
1 Getting Started

Create Your First World Map


This example shows how to use the Mapping Toolbox to create a world map. Geospatial data can be
voluminous, complex, and difficult to process. Mapping Toolbox functions handle many of the details
of loading and displaying geospatial data, and use built-in data structures that facilitate data storage.
Spatial data refers to data describing location, shape, and spatial relationships. Geospatial data is
spatial data that is in some way georeferenced, or tied to specific locations on, under, or above the
surface of a planet.

Create an empty map axes, ready to hold the data of your choice. The function worldmap
automatically selects a reasonable choice for your map projection and coordinate limits. To display a
world map, the function chose a Robinson projection centered on the prime meridian and the equator
(0° latitude, 0° longitude).

worldmap world

Import low-resolution world coastline data. The coastline data is a set of discrete vertices that, when
connected in the order given, approximate the coastlines of continents, major islands, and inland
seas. The vertex latitudes and longitudes are stored as vectors in a MAT-file. Load the MAT-file and
view the variables in the workspace.

load coastlines
whos

Name Size Bytes Class Attributes

1-4
Create Your First World Map

coastlat 9865x1 78920 double


coastlon 9865x1 78920 double

Determine how many separate elements are in the coastline data vectors. Even though there is only
one vector of latitudes, coastlat, and one vector of longitudes, coastlon, each of these vectors
contain many distinct polygons, forming the worlds coastlines. These vectors use NaN separators and
NaN terminators to divide each vector into multiple parts.

[latcells, loncells] = polysplit(coastlat, coastlon);


numel(latcells)

ans = 241

Plot the coastline data on the map axes using the plotm function. plotm is the geographic equivalent
of the MATLAB plot function. It accepts coordinates in latitude and longitude, transforms them to x
and y via a specified map projection, and displays them in a figure axes. In this example, worldmap
uses the Robinson projection.

plotm(coastlat, coastlon)

Create a new map axes for plotting data over Europe. This time, specify a return argument for the
worldmap function to get a handle to the figure's axes. The axes object on which map data is
displayed is called a map axes. In addition to the graphics properties common to any MATLAB axes
object, a map axes object contains additional properties covering map projection type, projection
parameters, map limits, etc. The getm and setm functions and others allow you to access and modify
these properties.

1-5
1 Getting Started

h = worldmap('Europe');

Determine which map projection worldmap is using.

getm(h,'MapProjection')

ans =
'eqdconic'

Add data to the map of Europe by using the geoshow function to import and display several
shapefiles in the toolbox/map/mapdata folder. Note how the geoshow function can plot data
directly from files onto a map axes without first importing it into the workspace. To change the color
of the marker, use the MarkerEdgeColor property and, for some markers, the MarkerFaceColor
property.

geoshow('landareas.shp', 'FaceColor', [0.15 0.5 0.15])


geoshow('worldlakes.shp', 'FaceColor', 'cyan')
geoshow('worldrivers.shp', 'Color', 'blue')
geoshow('worldcities.shp', 'Marker', '.',...
'MarkerEdgeColor', 'magenta')

1-6
Create Your First World Map

Place a label on the map to identify the Mediterranean Sea.

labelLat = 35;
labelLon = 14;
textm(labelLat, labelLon, 'Mediterranean Sea')

1-7
1 Getting Started

1-8
Tour Boston with the Map Viewer App

Tour Boston with the Map Viewer App


The Map Viewer app is an interactive tool for browsing map data. With it you can:

• Assemble layers of vector and raster geodata and render them in 2-D
• Import, reorder, symbolize, hide, and delete data layers
• Identify coordinate locations
• List data attributes
• Display selected data attributes as data tips (signposts that identify attribute values, such as place
names or route numbers)

The following example illustrates these capabilities.

Open the Map Viewer App


1 Open the Map Viewer app. On the Apps tab, in the Image Processing and Computer Vision

section, click Map Viewer . You can also start the Map Viewer using the mapview
command. The Map Viewer opens with a blank canvas. (No data is present.)

Note that The Map Viewer is designed primarily for working with data sets that refer to a
projected map coordinate system (as opposed to a geographic, latitude-longitude system), so the
coordinate axes are named X and Y.
2 Import map data. In the Map Viewer, select the File menu and then choose Import From File.
Navigate to the matlabroot\toolbox\map\mapdata folder, where matlabroot represents
your MATLAB installation folder, and open the GeoTIFF file boston.tif.

1-9
1 Getting Started

The file opens in the Map Viewer. The image is a visible red, green, and blue composite from a
georeferenced IKONOS-2 panchromatic/multispectral product created by GeoEye. Copyright ©
GeoEye, all rights reserved. For further information about the image, refer to the text files
boston.txt and boston_metadata.txt. To open boston.txt, type the following at the
command line:

open 'boston.txt'
3 Set the map scale in the Map Viewer. To do this, you must first set the map distance units. Click
the Map units menu at the bottom center and select US Survey Feet.

4 Set the map scale. Type 1:25000 in the Scale box, which is above the Map units menu, and
press Enter. The Map Viewer now looks like this.

1-10
Tour Boston with the Map Viewer App

5 Get the map coordinates for a location on the map, interactively. Place the cursor over a location
on the map. The example puts the cursor over the bridge that goes over the pond in Boston
Garden. The map coordinates for this location are shown at the lower left as 772,423.18 feet
easting (X), 2,954,372.40 feet northing (Y), in Massachusetts State Plane coordinates.
6 Import a vector data layer. For this example, import a line shapefile that contains data about the
streets and highways in the central Boston area.

boston_roads = shaperead('boston_roads.shp');

The shaperead function returns the data as a geographic data structure.


7 Convert the X and Y coordinate fields of boston_roads.shp from meters to U.S. survey feet. As
is frequently the case when overlaying geodata, the coordinate system used by
boston_roads.shp (in units of meters) does not completely agree with the one for the satellite
image, boston.tif (in units of feet). If you were to ignore this, the two data sets would be out
of registration by a large distance.

1-11
1 Getting Started

surveyFeetPerMeter = unitsratio('survey feet','meter');


for k = 1:numel(boston_roads)
boston_roads(k).X = surveyFeetPerMeter * boston_roads(k).X;
boston_roads(k).Y = surveyFeetPerMeter * boston_roads(k).Y;
end

The unitsratio function computes conversion factors between a variety of units of length.
8 In the Map Viewer File menu, select Import From Workspace > Vector Data > Geographic
Data Structure.

In the Import Vector Data dialog box, select the variable boston_roads as the data to import
from the workspace, and click OK.

1-12
Tour Boston with the Map Viewer App

You could clear the workspace now if you wanted, because all the data that the Map Viewer
needs is now loaded into it.
9 After the Map Viewer finishes importing the roads layer, it selects a random color and renders all
the shapes with that color as solid lines. The view looks like this.

Being random, the color you see for the road layer may differ.
10 Explore the attributes of the vector layer. First, make the vector layer the active layer using the
Active layer menu at the bottom right. Select boston_roads. You can designate any layer to be
the active layer; it does not need to be the topmost layer. By default, the first layer imported is
active. Changing the active layer has no visual effect on the map. Doing so allows you to query
attributes of the layer you select. For example, once you make the vector layer the active layer,

1-13
Another Random Scribd Document
with Unrelated Content
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like