Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

projfwd

Forward map projection using PROJ.4 map projection library

Syntax

[x,y] = projfwd(proj,lat,lon)

Description

example

[x,y] = projfwd(proj,lat,lon) returns the x and y map coordinates from the forward projection transformation. proj is a structure defining the map projection. proj can be an mstruct or a GeoTIFF info structure. lat and lon are arrays of the latitude and longitude coordinates.

For a complete list of GeoTIFF info and map projection structures that you can use with projinv, see the reference page for projlist.

Examples

collapse all

Read vector data for state boundary of Massachusetts (in latitude and longitude).

S = shaperead('usastatehi', 'UseGeoCoords', true, ...
    'Selector',{@(name) strcmpi(name,'Massachusetts'), 'Name'});

Obtain the projection structure for the orthophoto and project the state boundary vectors to it (Massachusetts State Plane coordinate system, U.S. Survey Feet).

proj = geotiffinfo('boston.tif');
lat = [S.Lat];
lon = [S.Lon];
[x, y] = projfwd(proj, lat, lon);

Read and display the 'boston.tif' orthophoto image.

[RGB, R, bbox] = geotiffread('boston.tif');
figure
mapshow(RGB, R)
xlabel('MA Mainland State Plane easting, survey feet')
ylabel('MA Mainland State Plane northing, survey feet')

Overlay the state boundary and set map limits to show a little more detail.

hold on
mapshow(gca, x, y,'Color','black','LineWidth',2.0)
set(gca,'XLim', [ 645000,  895000], ...
        'YLIm', [2865000, 3040000]);

boston.tif image copyright © GeoEye™, all rights reserved.

Input Arguments

collapse all

Map projection, specified as a scalar map projection structure (mstruct) or GeoTIFF info structure.

Data Types: struct

Geodetic latitudes of one or more points, specified as a scalar value, vector, matrix, or N-D array, in units of degrees. Size must match the size of the lon input.

Data Types: single | double

Longitudes of one or more points, specified as a scalar value, vector, matrix, or N-D array, in units of degrees. Size must match the size of the lat input.

Data Types: single | double

Output Arguments

collapse all

x-coordinates of one or more points in the projected coordinate system, returned as a scalar value, vector, matrix, or N-D array.

y-coordinates of one or more points in the projected coordinate system, returned as a scalar value, vector, matrix, or N-D array.

Introduced before R2006a

Was this topic helpful?