Coordinate Extractor

版本 1.0.0.0 (2.6 KB) 作者: Sebastian Hölz
Extract geographic coordinate(s) out of string(s).
233.0 次下载
更新时间 2011/5/12

查看许可证

Use this function to extract one geographical coordinate out of an input string. The function is extremely flexible, thus the coordinate may be located anywhere in the string and may have one of many formats.

Examples:
txt2coord(' 100° 7'' 30" W')
txt2coord(' 100° 7´ 30´´ W')
txt2coord('-100° 7` 30"')
txt2coord('100° 7.5'' W')
txt2coord('100.125° west ')
txt2coord('bla 100°, 7min;30´´ S bla')
txt2coord({'100.125° W' '-100.125°'})

All specified examples yield the correct result (-100.125).

I have successfully tested this with various inputs. Yet, regular expressions, which are extensively used in this file, ... well ... they sometimes have a funny way of showing you that you havn't quite figured them out yet. Therefore, I would strongly advice you to performe some sanity-check on this function before using it and would be greatful, if you report any bugs to me.

Cheers

Sebastian

引用格式

Sebastian Hölz (2024). Coordinate Extractor (https://www.mathworks.com/matlabcentral/fileexchange/31428-coordinate-extractor), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010b
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0