Home > mapstuff > demo_map.m

demo_map

PURPOSE ^

DEMO_MAP Demonstrates map stuff: JOIN_CST, FILLSEG and MAPAX.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 DEMO_MAP  Demonstrates map stuff: JOIN_CST, FILLSEG and MAPAX.

    Usage:  demo_map

 Rich Signell (rsignell@usgs.gov)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % DEMO_MAP  Demonstrates map stuff: JOIN_CST, FILLSEG and MAPAX.
0002 %
0003 %    Usage:  demo_map
0004 %
0005 % Rich Signell (rsignell@usgs.gov)
0006 
0007 
0008 %load Nantucket lon,lat coastline data extracted from World Vector Shoreline
0009 load map.dat
0010 
0011 %
0012 % form continuous coastline using JOIN_CST, and joining segments closer
0013 % than 0.0001 degrees.
0014 
0015 new=join_cst(map,.0001);
0016 
0017 % draw original coast without nans
0018 ind=find(~isnan(map(:,1)));
0019 subplot(211);
0020 plot(map(ind,1),map(ind,2));
0021 
0022 % crude map projection: set aspect ratio to cos(lat_middle) ~ 0.74
0023 %
0024 set(gca,'asp',[nan .74]);
0025 title('Turn this disjointed coastline with lousy labels....');
0026 
0027 % fill in land using FILLSEG.  Draw cyan land with nearly black coast.
0028 
0029 subplot(212);
0030 fillseg(new,[0 1 1],[0 0 .1]);
0031 
0032 set(gca,'asp',[nan .74]);
0033 
0034 % nice lon labels every 5 minutes and lat every 3 minutes with no decimal places
0035 % for minutes
0036 
0037 mapax(5,0,3,0);
0038 
0039 title('...into this filled coastline with nice lat/lon labels');

Generated on Wed 30-Nov-2005 15:38:18 by m2html © 2003