geoshow
Display map latitude and longitude data
Syntax
Description
geoshow(
projects and displays the latitude and longitude vectors lat
,lon
)lat
and lon
using the projection stored in the current
axesm
-based map (previously referred to as map axes).
If there is no current axesm
-based map, then
lat
and lon
are projected using a
default Plate Carrée projection on a set of regular axes.
Note
To display data on an axesm
-based map, create a
map using the axesm
, worldmap
, or usamap
function 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, multilines, polygons, or multipolygons according to the geometry of
S
.
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
argumentsAny 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(___)
Examples
Input Arguments
Output Arguments
Tips
When calling
shaperead
to read files that contain coordinates in latitude and longitude, be sure to specify theshaperead
argument pair'UseGeoCoords',true
. If you do not include this argument,shaperead
will create a mapstruct, with coordinate fields labelledX
andY
instead ofLon
andLat
. In such cases,geoshow
assumes that the geostruct is in fact a mapstruct containing projected coordinates, warns, and callsmapshow
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 an
axesm
-based map usinggeoshow
, you should not subsequently change the map projection usingsetm
. You can, however, change the projection withsetm
for raster data. For more information, see Change Map Projections When 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 an
axesm
-based map,geoshow
uses the projection stored within theaxesm
-based map. When displaying on a regular axes, it constructs a default Plate Carrée projection with a scale factor of180/pi
, enabling direct readout of coordinates in degrees.When you pass two points to the
geoshow
function, the function projects the locations of each point on the map and displays a straight line that connects them, regardless of the map projection or the distance between the points. To display a projected geodesic or rhumbline curve between two points, first insert intermediate points using thetrack2
function.geoshow
can generally be substituted fordisplaym
. However, there are limitations where display of specific objects is concerned. See the remarks underupdategeostruct
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.