Display map latitude and longitude data
geoshow(
projects and displays the latitude and longitude vectors lat
,lon
)lat
and lon
using the projection stored in the current set of map
axes. If there are no current map axes, then lat
and
lon
are projected using a default Plate Carrée
projection on a set of regular axes.
Note
To display data on a set of map axes, create a map using the axesm
, worldmap
, or usamap
functions before
calling geoshow
.
By default, geoshow
displays lat
and
lon
as lines. You can optionally display the vector data
as points, multipoints, or polygons by using the
DisplayType
name-value pair argument.
geoshow(
displays the vector
geographic features stored in S
)S
as points, multipoints,
lines, or polygons according to the 'Geometry'
field of
S
.
If S
is a geopoint
vector, a geoshape
vector, or
a geostruct (with 'Lat'
and
'Lon'
coordinate fields), then
geoshow
projects vertices to map
coordinates.
If S
is a mappoint
vector, a
mapshape
vector, or
a mapstruct (with 'X'
and 'Y'
fields), then geoshow
plots vertices as
(pre-projected) map coordinates and issues a warning.
You can optionally specify symbolization rules using the
SymbolSpec
name-value pair argument.
geoshow(
projects and displays the geolocated data grid, lat
,lon
,Z
)Z
. In this
syntax, lat
and lon
are M-by-N
latitude-longitude arrays. Z
is an M-by-N array of class
double
. You can optionally display the data as a surface,
mesh, texture map, or contour by using the DisplayType
name-value pair argument.
geoshow(
projects and displays a regular data grid, Z
,R
)Z
, with
referencing object R
. You can optionally display the data
as a surface, mesh, texture map, or contour by using the
DisplayType
name-value pair argument. If
DisplayType
is 'texturemap'
, then
geoshow
constructs a surface with
ZData
values set to 0.
geoshow(
projects and displays a geolocated image as a texture map on a zero-elevation
surface. The geolocated image lat
,lon
,X
,cmap
)I
can be a truecolor,
grayscale, or binary image. X
is an indexed image with
colormap cmap
. Examples of geolocated images include a
color composite from a satellite swath or an image originally referenced to a
different coordinate system.
geoshow(___,
specifies parameters and corresponding values that modify the type of display or
set MATLAB® graphics properties. You can use name,value pairs to set:Name,Value
)
Name,Value
arguments
Any MATLAB Graphics line, patch, and surface properties
Any Mapping Toolbox™ contour properties
Parameter names can be abbreviated, and case does not matter.
geoshow(
sets the
parent axes to ax
,___)ax
.
returns
a handle to a MATLAB graphics object.h
= geoshow(___)
When calling shaperead
to read files that contain
coordinates in latitude and longitude, be sure to specify the
shaperead
argument pair
'UseGeoCoords',true
. If you do not include this argument,
shaperead
will create a mapstruct, with coordinate
fields labelled X
and Y
instead of
Lon
and Lat
. In such cases,
geoshow
assumes that the geostruct is in fact a
mapstruct containing projected coordinates, warns, and calls
mapshow
to display the geostruct data without
projecting it.
If you do not want geoshow
to draw on top of an existing
map, create a new figure or subplot before calling it.
When you display vector data in a map axes using geoshow
,
you should not subsequently change the map projection using
setm
. You can, however, change the projection with
setm
for raster data. For more information, see Change Map Projections Using geoshow.
If you display a polygon, do not set 'EdgeColor'
to either
'flat'
or 'interp'
. This combination
may result in a warning.
When projecting data onto a map axes, geoshow
uses the
projection stored with the map axes. When displaying on a regular axes, it
constructs a default Plate Carrée projection with a scale factor of
180/pi
, enabling direct readout of coordinates in
degrees.
geoshow
can generally be substituted for
displaym
. However, there are limitations where display
of specific objects is concerned. See the remarks under updategeostruct
for further
information.
When you display raster data in a map using geoshow
,
columns near the eastern or western edge may fail to display. This is seldom
noticeable, except when the raster is very coarse relative to the displayed
area. To include additional columns in the display, it might help to:
Resize the grid to a finer mesh.
Make sure the cell boundaries and map limits align.
Expand the map limits.