Products & Services Solutions Academia Support User Community Company

Learn more about Mapping Toolbox   

boundImageSize - Class: WMSMapRequest

Bound size of raster map

Syntax

mapRequest = boundImageSize(mapRequest, imageLength)

Description

mapRequest = boundImageSize(mapRequest, imageLength) bounds the size of the raster map based on the scalar imageLength. The scalar mapRequest is a WMSMapRequest object. The double imageLength indicates the length in pixels for the row (ImageHeight) or column (ImageWidth) dimension. The row or column dimension length is calculated using the aspect ratio of the Latlim and Lonlim properties or the aspect ratio of the XLim and YLim properties, if they are set.

Image dimensions are measured in geographic or map coordinates. The longest image dimension is set to imageLength, and the shortest is set to the nearest integer value that preserves the aspect ratio, without changing the coordinate limits. The maximum value of imageLength is the maximum value of the MaximumHeight and MaximumWidth properties.

Example

Read and display a composite of multiple layers representing the EGM96 geopotential model of the Earth, coastlines, and national boundaries from the NASA Globe Visualization server. The rendered map has a spatial resolution of 0.5 degrees.

vizglobe = wmsfind('viz.globe', 'SearchField', 'serverurl');
coastlines = vizglobe.refine('coastline');
national_boundaries = vizglobe.refine('national*bound');
base_layer = vizglobe.refine('egm96');
layers = [base_layer;coastlines;national_boundaries];
request = WMSMapRequest(layers);
request.Transparent = true;
request = request.boundImageSize(720);
overlayImage = request.Server.getMap(request.RequestURL);
 
figure
worldmap('world')
geoshow(overlayImage, request.RasterRef);
title(base_layer.LayerTitle)

Compare the map with the contoured data from 'geoid.mat'.

geoid = load('geoid');
coast = load('coast');
figure
worldmap('world')
contourfm(geoid.geoid, geoid.geoidrefvec, 15)
geoshow(coast.lat, coast.long)
title({'EGM96 Contoured Data', '(geoid.mat)'})

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS