Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Orthographic Projection of Small Region

Subject: Orthographic Projection of Small Region

From: Aaron

Date: 10 Sep, 2009 15:47:20

Message: 1 of 4

I'm trying to display an orthographic projection of regions of the world smaller than an entire hemisphere. For example, only display europe from latlim = [30 75]; lonlim = [-25 45];
(I understand that there will be more longitudes displayed at the top of the map)
I can get to the map that I want by using different zoom factors...but think there should be a way to "zoom" to these coordinate limits automatically if I choose to create a map of a different region.

Subject: Orthographic Projection of Small Region

From: Rob Comer

Date: 14 Sep, 2009 01:16:03

Message: 2 of 4

Does the following example help?

% Quadrangle of interest
latlim = [30 75];
lonlim = [-25 45];

% Origin and radius for orthographic (azimuthal) projection
origin = [50 10];
radius = 35;

% Orthographic map axes
figure('Color','white')
ax = axesm('ortho','Origin',origin','FLatLimit',[-Inf 35], ...
    'frame','on','grid','on');
axis off
setm(ax,'MeridianLabel','on','MLabelParallel',45)
setm(ax,'ParallelLabel','on','PLabelMeridian',10)

% Display quadrangle as filled polygon
[latquad, lonquad] = interpm(latlim([1 2 2 1 1]), lonlim([1 1 2 2 1]), 1);
geoshow(latquad,lonquad,'DisplayType','polygon')

% Overlay coastlines
coast = load('coast.mat');
geoshow(coast.lat, coast.long)

Subject: Orthographic Projection of Small Region

From: Aaron

Date: 14 Sep, 2009 21:00:19

Message: 3 of 4

"Rob Comer" <rob.comer.nospam@mathworks.com> wrote in message <h8k5gj$eco$1@fred.mathworks.com>...
> Does the following example help?
>
> % Quadrangle of interest
> latlim = [30 75];
> lonlim = [-25 45];
>
> % Origin and radius for orthographic (azimuthal) projection
> origin = [50 10];
> radius = 35;
>
> % Orthographic map axes
> figure('Color','white')
> ax = axesm('ortho','Origin',origin','FLatLimit',[-Inf 35], ...
> 'frame','on','grid','on');
> axis off
> setm(ax,'MeridianLabel','on','MLabelParallel',45)
> setm(ax,'ParallelLabel','on','PLabelMeridian',10)
>
> % Display quadrangle as filled polygon
> [latquad, lonquad] = interpm(latlim([1 2 2 1 1]), lonlim([1 1 2 2 1]), 1);
> geoshow(latquad,lonquad,'DisplayType','polygon')
>
> % Overlay coastlines
> coast = load('coast.mat');
> geoshow(coast.lat, coast.long)

Thank you so much! This is actually a huge step in the right direction. I was getting hung up on the Warning Message disregarding my 'FLatLimit' input that wasn't in [-Inf #] format.
Is there any way to have this in a square frame, rather than the round?
If not, is there a way using the 'globe' projection?
Thanks again!
-Aaron

Subject: Orthographic Projection of Small Region

From: Rob Comer

Date: 14 Sep, 2009 21:42:02

Message: 4 of 4

"Aaron " <removethis.aaron.m.krites@saic.com> wrote in message <h8mat3$ivq$1@fred.mathworks.com>...

> Is there any way to have this in a square frame, rather than the round?
> If not, is there a way using the 'globe' projection?

At the moment all the azimuthal projections in Mapping Toolbox are hard-wired to have round frames. But adding a square-frame alternative does seem like a reasonable enhancement. Meanwhile, the best you can do would be to zoom in a little after creating the map. You're correct that globe would produce a similar geometry on the screen, but I don't think it would make things any easier.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us