Version 2.6 (R2007b) Mapping Toolbox Software(matlab 角度转换函数)
This table summarizes what's new in Version 2.6 (R2007b):
New Features and Changes | Version Compatibility Considerations | Fixed Bugs and Known Problems | Related Documentation at Web Site |
Yes | Yes — Details labeled as Compatibility Considerations in descriptions of new features and changes, below. See also Summary. | Bug reports at Web site | No |
- Exporting Vector Geodata to Earth Browsers
- Improved Conversion Between Angle Units
- Improvements in Handling Length Units
- New Angle Wrapping Functions
- New Function to Unwrap Sequences of Angles
- Improvements to Data Trimming in patchm and patchesm
- Higher Quality boston.tif GeoTIFF Satellite Image
- Map Axes Now Display Transparent Objects More Easily
- The arcgridread Function Now Imports Noninteger Data Grids
- Change to avhrrlambert Function Behavior When No Data Is Available
- Enhancements to Mapping Toolbox User's Guide
- Functions deg2rad and rad2deg No Longer Convert Complex to Real
- Degrees-Minutes-Seconds Conversion Functions Are Obsolete and Error if Used
- Time Conversion Functions Are Obsolete and Error if Used
- cmapui GUI is now Obsolete
- Functions tigermif and tigerp Are Obsolete and Error if Used
Exporting Vector Geodata to Earth Browsers
kmlwrite is a new function for exporting vector point data to a file in KML format. KML stands for Keyhole Markup Language; it is an XML dialect used to structure geographic data for display in an Earth browser, such as Google™ Earth, Google Maps, and Maps for Google Mobile. KML has a hierarchical structure of nested elements and attributes. kmlwrite has a simple API that lets Mapping Toolbox users write vector data to a KML file in order to subsequently display the data onto an Earth browser.
When used with Google Earth, files output from kmlwrite can be seen immediately in Google Earth, if that application is available to the user. If the files are uploaded to a publicly accessible Web server, they can be viewed by anyone on the Internet via Google Maps or other Web sites and browser utilities that can read and display KML files. Google Maps and Google Maps for mobile do not support the range of KML markup that Google Earth supports (for example, placemark locations must be specified to them as coordinates, not as addresses). See the Google KML documentation at http://code.google.com/apis/kml/documentation/mapsSupport.html for more information.
kmlwrite accepts latitude and longitude point vectors, passed either in geostructs or as column arrays. It also accepts addresses, which can be as general as a country's name or as specific as a street address. When geostructs are the input, the attribute data in the geostruct can be formatted as HTML tables and included in the KML output. When latitude-longitude arrays are input, you can pass attributes to kmlwrite with strings. When addresses are the input, geostructs are not used.
To customize placemarks, you can control formatting of geostruct attributes in the KML file with an attribute specification, a struct used to format them (for example, to add units to length attributes or to control the number of decimal places for numeric values). A new support function, makeattribspec lets you change the names used as labels in placemarks (geostruct field names are used by default), omit fields from placemarks, and add HTML markup to the attributes displayed in placemark tables.
See Exporting Vector Geodata in the Mapping Toolbox User's Guide and the mapexkmlexport demo, "Exporting Vector Point Data to KML" for more information.
Improved Conversion Between Angle Units
The angledim function has been replaced by four, more specific, functions: fromRadians, fromDegrees, toRadians, and toDegrees (described below in Four New Angle-Unit Conversion Functions). However, angledim has been retained in Version 2.6 for backward compatibility. The functions degtorad, radtodeg, and unitsratio provide additional alternatives.
Because it must resolve both the input and output units, angledim is excessive for most applications. It works only for class double and it quietly discards the imaginary part of any complex input. You can use any of several more efficient alternatives:
If you are working from the command line, you can often replace angledim with degtorad or radtodeg. If you are converting angle units within a script or function and you know both the from and to unit names at the time of coding, then you can also replace angledim with degtorad or radtodeg. If you know either from or to at the time of coding, then you can use fromRadians, fromDegrees, toRadians, or toDegrees. Apply one of the following transformations to your code:
- angledim(angleIn,'radians',to) ⇒ fromRadians(to,angleIin)
- angledim(angleIn,'degrees',to) ⇒ fromDegrees(to,angleIin)
- angledim(angleIn,from,'radians') ⇒ toRadians(from,angleIn)
- angledim(angleIn,from,'degrees') ⇒ toDegrees(from,angleIn)
Also note that the functions in the fromRadians family can convert multiple variables in a single function call. For example, you can replace this code
angle1 = angledim(angle1InRadians,'radians',to);
angle2 = angledim(angle2InRadians,'radians',to);
with
[angle1,angle2] = fromRadians(to,angle1InRadians,angle2InRadians);
If you do not know either from or to at the time of coding, then you can call unitsratio to obtain the correct conversion factor, then multiply the values of one or more variables. For example, you can replace:
angle1Out = angledim(angle1In, from, to);
angle2Out = angledim(angle2In, from, to);
with
r = unitsratio(to, from);
angle1Out = r * angle1In;
angle2Out = r * angle2In;
Four New Angle-Unit Conversion Functions
- toDegrees — Convert angles to degrees
- toRadians — Convert angles to radians
- fromDegrees — Convert angles from degrees
- fromRadians — Convert angles from radians
If the output units match the inputs units, as in toDegrees(units, angle1, angle2,...), where units turns out to equal 'degrees', then the input angles are simply copied to the output angles.
Use these functions in place of angledim. The new functions are more efficient, especially when the value of either the from or to argument of angledim is known in advance and the value of the other angle-unit argument is not.
Improvements in Handling Length Units
Alternatives to the distdim Function
There are now more efficient ways to convert length and distance units than the distdim function. In place of distdim, you can use unitsratio to compute multiplicative factors to apply when converting between different units of distances and angles, which you can use in subsequent calculations. For other alternatives, see Replacing distdim in the distdim reference page for details.
The unitstr function Is Obsolete
The unitstr function, which validates names and abbreviations for units of distance, angle, and time, is obsolete and will be removed in a future release. The syntax str = unitstr(str,'times') has already been removed. Instead, see the documentation for unitsratio for a list of valid unit strings.
Compatibility Considerations. There is no replacement for unitstr, but unitsratio recognizes all the unit strings known to the toolbox.
Interpretation of "Miles" Units has Changed
Compatibility Considerations. This will not materially affect the accuracy of results in most cases; the lengths of the two types of miles only differ by about two parts per million (three millimeters). The distdim function's interpretation of miles has not changed. However, there are better alternatives to it; see the release note Alternatives to the distdim Function.
- wrapTo180 — Wrap angle in degrees to [-180 180]
- wrapTo360 — Wrap angle in degrees to [0 360]
- wrapToPi — Wrap angle in radians to [-pi pi]
- wrapTo2Pi — Wrap angle in radians to [0 2*pi]
The first two functions work in degrees, the next two in radians. None of them perform argument checking.
You can use the new wrapping and functions in place of npi2pi and zero22pi for greater efficiency. The older functions will eventually be removed from the toolbox.
New Function to Unwrap Sequences of Angles
The new unwrapMultipart function unwraps vectors of angles similarly to the MATLAB function unwrap, except that it handles vectors that include NaN separators, unwrapping each section separately. Use it to remove discontinuities from vectors of longitudes, azimuths, or phase angles that contain NaN-delimited sequences and as a replacement for the obsolete function smoothlong.
Improvements to Data Trimming in patchm and patchesm
The patchm and patchesm functions now completely trim away polygons and parts of polygons that fall outside your current map limits. This improvement also affects fillm, which calls patchm. Previously the patch functions simply shifted coordinates inward so that vertices collected at the edge of the limits, where they would appear as lines along map borders, unless obscured by the map frame. This change allows OpenGL to better render the patch objects constructed by patchm and patchesm, making them more compatible with the use of AlphaData to achieve transparency. See the release note Map Axes Now Display Transparent Objects More Easily for more details.
Other potential compatibility issues:
- patchm and patchesm exhibit greater sensitivity to incomplete or incorrect polygon topology.
- You might need to manually set the renderer for proper display of some patch data
See the release note Map Axes Now Display Transparent Objects More Easily for information about rendering and the Mapping Toolbox demo mapexgshhs for an example of a situation where polygon topology necessitates manual setting of the renderer.
Higher Quality boston.tif GeoTIFF Satellite Image
Map Axes Now Display Transparent Objects More Easily
after you construct your map axes. If you are calling contourm or contour3m, issue the command
set(gcf,'Renderer','painters')
after you call the contouring function.
The arcgridread Function Now Imports Noninteger Data Grids
Change to avhrrlambert Function Behavior When No Data Is Available
In previous releases of the toolbox, avhrrlambert would error if the quadrangle defined by latlim and lonlim (when projected to form a polygon in the appropriate Lambert Equal Area Azimuthal projection) failed to intersect the bounding box of the data in the projected coordinates. In this release, avhrrlambert does not error when this occurs but returns empty matrices.
Enhancements to Mapping Toolbox User's Guide
Several sections of the chapter Understanding Geospatial Geometry have been rewritten and new material has been added to better explain critical topics such as ellipsoid models, units of and notations for angles and length, and the conversions that are possible between various units. There is also a new section, Exporting Vector Geodata, explaining and illustrating how to use the new kmlwrite and makeattribspec functions.
Functions deg2rad and rad2deg No Longer Convert Complex to Real
Warning: Imaginary parts of complex ANGLE argument ignored
Going forward from this release, the result is
Degrees-Minutes-Seconds Conversion Functions Are Obsolete and Error if Used
In every case, an alternative that does not use the old degrees-minutes-seconds scalar encoding exists. See the following section on compatibility for replacements and New Functions for Degrees-Minutes-Seconds Conversions in the V2.5 Release Notes for descriptions of replacement functions, and the compatibility considerations below for descriptions of alternative syntaxes and expressions you can use for degrees-minutes-seconds conversions.
- deg2dm — Instead use degrees2dm to convert degrees to degrees-minutes vector.
- deg2dms — Instead use degrees2dms to convert degrees to degrees-minutes-seconds vector.
- dms2deg — Instead use dms2degrees to convert degrees-minutes-seconds vector to degrees.
- dms2dm — Instead combine dms2degrees and degrees2dm, as in degrees2dm(dms2degrees([-29 42 18.7])) to remove the seconds component from a degree-minutes-second vector.
- dms2mat — Instead use degrees2dms to convert degrees to degrees-minutes-seconds vector.
- dms2rad — Instead use dms2degrees to convert degrees-minutes-seconds vector to degrees and call degtorad or multiply by pi/180.
- mat2dms — Instead use dms2degrees to convert degrees-minutes-seconds vector to degrees.
- rad2dm — Instead, call radtodeg or multiply input arguments by 180/pi, and then call degrees2dm.
- rad2dms — Instead, call radtodeg or multiply input arguments by 180/pi, and then call degrees2dms.
In addition, the axesm and setm functions no longer accept the strings 'dms' and 'dm' for setting either the AngleUnits or LabelUnits properties of a map axes.
Many other Mapping Toolbox functions optionally accept angle strings for their units parameter; the following 57 functions now only accept 'degrees' and 'radians', whereas in prior versions they would also accept 'dm' and 'dms' as values for units:
| ||||
| ||||
|
These functions now error when provided 'dm' or 'dms' for their units argument.
Time Conversion Functions Are Obsolete and Error if Used
The cmapui GUI now errors if you attempt to use it. It will be completely removed from the next Mapping Toolbox version. Use the MATLAB colormapeditor GUI instead, which provides better functionality. You can also use the Colormap drop-down menu in the Property Editor (part of the MATLAB plotting tools and available via the propedit command) to select a built-in colormap; the custom option on that drop-down menu opens colormapeditor. To set up a colormap for terrain displays, you can use the demcmap function. To generate an appropriate (but random) colormap for political maps, use the polcmap function.
Functions tigermif and tigerp Are Obsolete and Error if Used
The following functions error and issue an error message when you attempt to use them:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2010-12-05 森林经营决策支持地理信息系统