跳至主要内容

用百度地图api快速实现经纬度地理位置可视化

原文地址是用百度地图api快速实现经纬度地理位置可视化,对作者表示感谢

在数学建模中,常常会有一些地理位置数据。为了快速地展现其位置分布,可以用百度地图api快速实现地理位置可视化。
api001
 



0.概述

在会遇到一些与地理位置相关的建模问题时,难免会遇到需要可视化展示地理位置信息的需求。
可能许多人的第一反应是:
WTF我没做过前端,也不会js,这个东西怎么办
事实上,队伍内展示,或者只是作为团队内构建道路信息的工具,就可以用在线地图api实现可视化。(开发产品当然另当别论)
本篇学习笔记以百度地图api为例。只要稍微上过大学课程的c++之类的,看得懂一点点代码,就可以按照百度地图api手册给出的demo加以发挥。


1.开发者账户相关


用百度id注册百度地图开放平台,验证手机号和邮箱地址,会获得免费的配额。新建应用,获得秘钥。
包含以下内容及相应配额(懒..直接粘贴的表格)
服务名称配额消费配额上限操作
云存储API(存储)
存储空间:
0%
总存储空间: 10240MB
查看文档 数据管理 配额申请
云存储API
请求数:
0%
总请求数: 10万次/天
查看文档 数据管理 流量图 配额申请
云检索API
请求数:
0%
总请求数: 10万次/天
查看文档 流量图 配额申请
Javascript API
无请求数限制
查看文档
Place API v2
请求数:
0%
总请求数: 0.2万次/天
查看文档 流量图 配额申请
Geocoding API v2
请求数:
0%
总请求数: 0.6万次/天
查看文档 流量图 配额申请
IP定位API
请求数:
0%
总请求数: 100万次/天
查看文档 流量图 配额申请
路线交通API
请求数:
0%
总请求数: 0.2万次/天
查看文档 流量图 配额申请
Android导航离线SDK
无请求数限制
IOS导航离线SDK
无请求数限制
Android导航SDK
无请求数限制
查看文档
IOS导航SDK
无请求数限制
静态图API
请求数:
0%
总请求数: 100万次/天
查看文档 流量图 配额申请
全景静态图API
请求数:
0%
总请求数: 10万次/天
查看文档
坐标转换API
请求数:
0%
总请求数: 10万次/天
查看文档 流量图 配额申请
鹰眼API
请求数:
0%
总请求数: 10万次/天
查看文档 流量图 配额申请
到达圈
请求数:
0%
总请求数: 0.01万次/天
Android导航 HUD SDK
无请求数限制
IOS导航 HUD SDK
无请求数限制
云逆地理编码API
请求数:
0%
总请求数: 0.2万次/天
流量图 配额申请
Routematrix API
请求数:
0%
总请求数: 0.2万次/天
流量图 配额申请
云地理编码API
请求数:
0%
总请求数: 0.2万次/天
高精度IP定位
请求数:
0%
总请求数: 0.1万次/天
流量图 配额申请
时区服务 API
请求数:
0%
总请求数: 0.2万次/天



2.开发手册、demo

百度地图开放平台js开发demo

对于一种想要展示一系列展示固定点的需求,可以使用“麻点图层”的方法
api003
demo调试界面

3.坐标信息管理

注意到 “geotableId”:

麻点图层的原理,是使用百度云存储api(LBS云),送入自己点坐标信息的数据。再通过调用CutsomLayer在地图表层绘制麻点。
在百度云存储api的数据管理页面,可以通过可视化锚点,或者上传规范格式的csv快速添加数据(当然也可以通过get put直接上传,如果没有需求,当然可以只通过上传csv添加数据)
api005
数据管理可视化界面
新建一个数据表,括号内即为geotableId。
csv可以直接下载示例,然后用excel可视化编辑。注意文档中给出的表值定义,不要填错
http://lbsyun.baidu.com/index.php?title=lbscloud/api/geodata
上传后可导入位置信息

4.api使用


官方给出的示例如下
需要修改:
最后将代保存成html文件,本地打开或者上传到网页空间,能获得自己创建的麻点图,实现快速静态位置信息可视化。

api001

5.后记

还是那句,在一些队伍内展示的场合,或者只是团队内构建道路信息的工具,就可以用在线地图api实现可视化。开发产品当然另当别论,需要深入研究前端,实现交互、实时更新等等。

Popular posts from 产品随想的博客

产品随想 | 陪读《乔布斯传》:1-17章

乔布斯经典照片集 坐在麗莎電腦旁。他說:「毕加索曾說:「好的藝術家懂得模仿,佛大的藝術家善於偷取。」因此,窃取偉大的點子沒有什麼好羞耻的。 與蓋茲在電話中達成協議:「比爾,謝謝你支持蘋果。因為你的支持,世界將變得更美好。」 1997年蘋果在波士頓舉行的麥金塔世界大會,蓋茲透過衛星連線在巨大的螢幕上出現。質伯斯說:「我真是笨死了,竟然讓蓋兹以這種方式現身。他讓我看起來好沙小。」 ──时刻自省 前言 The people who are crazy enough to think they can change the world are the ones who do. 只有那些瘋狂到以為自己可以改變世界的人, 才能改變這個世界。 這麼些年來,賈伯斯說起話來的認真與專注態度,著實打動不少人。我們一直保持連絡,即使在他被逐出蘋果之後,我們還有來往。每次他有新產品要推出時,像 NeXT 電腦或皮克斯 (Pixar)的電影,他就會來找我。他常帶我去曼哈頓下城一家壽司店用餐,講起他的產品,渾身散發出光和熱,眉飛色舞的說這是他登峰造極之作。我喜歡這個人。 ──对自己产品深深的爱 他的堅持教我疑惑。人人都知道賈伯斯不道餘力捍衛隱私, 而且我不知道他是否看過我寫的任何一本傳記。我還是不敢立刻答應,只說或許再等等。然而到了 2009年,我接到他太太蘿琳. 鮑威爾打來的電話。她直截了當說:「如果你還想為史帝夫寫傳,最好趕快動筆。」這是他第二次因病向公司請長假。我坦言他早在2004 年得知自己罹患胰臟癌的時候就曾主動邀我寫傳,但我當時對他罹癌的事一無所知。蘿琳解釋說,他們盡量保密,因此當時根本沒幾個人知道。他是在動手術的前夕打電話給我的。 ──和Make Something Wonderful对照起来看 他還說,自從他回到蘋果重新掌權,這十二年來是他創造新產品的高峰期,但他還有更重要的目標,也就是效法惠普的惠立和普克(David Packard),締造一家創新動力無限的公司,進而超越惠普。 ──苹果公司才是乔布斯最得意的产品 他說:「我一直認為,自己是個偏向人文的孩子,但我也喜歡電子的東西。後來,我讀到寶麗來(Polaroid)創辦人蘭德 (Edwin Land)曾說過,一個人能站在人文和科學的交會口,兼容贯通,才是真正的人才。在那當下,我决定要當這樣的人。」他似乎在暗示我,這可以做為傳...

Steve Jobs at 44, By Michael Krantz, 1999

Differences and Similarities Between Apple and Pixar Apple turns out many products--a dozen a year; if you count all the minor ones, probably a hundred. Pixar is striving to turn out one a year. But the converse of that is that Pixar's products will still be used fifty years from now, whereas I don't think you'll be using any product Apple brings to market this year fifty years from now. Pixar is making art for the ages. Kids will be watching Toy Story in the future. And Apple is much more of a constant race to continually improve things and stay ahead of the competition.  His Role At Pixar At Pixar my job is to help build the studio and recruit people and help create a situation where they can do the best work of their lives. And to some degree it's the same at Apple. But at Pixar, I don't direct the movies, whereas at Apple probably, if I had to pick a role out of a film production, I'd be the director. So it...

Interview with Steve Jobs, WGBH, 1990

Interviewer: what is it about this machine? Why is this machine so interesting? Why has it been so influential? Jobs: Ah ahm, I'll give you my point of view on it. I remember reading a magazine article a long time ago ah when I was ah twelve years ago maybe, in I think it was Scientific American . I'm not sure. And the article ahm proposed to measure the efficiency of locomotion for ah lots of species on planet earth to see which species was the most efficient at getting from point A to point B. Ah and they measured the kilocalories that each one expended. So ah they ranked them all and I remember that ahm...ah the Condor, Condor was the most efficient at [CLEARS THROAT] getting from point A to point B. And humankind, the crown of creation came in with a rather unimpressive showing about a third of the way down...

产品随想 | 周刊 第85期:e-Residency与数字游民

  David Shambaugh   https://www.google.com/search?q=David+Shambaugh 中国问题研究专家,著作极多 郭玉闪   https://zh.wikipedia.org/wiki/郭玉闪?useskin=vector 中国公共知识分子 我只想好好观影   github.com/BetterWorld-Liuser/autoMovies 刘煜辉:中国资本市场灵魂出窍 最有活力的公司几乎不在A股   https://finance.sina.com.cn/stock/marketresearch/2017-06-23/doc-ifyhmtek7705574.shtml 回看17年的专家讲话,还是挺有水平的,挺多都认可 纽约文化沙龙   https://www.youtube.com/@user-cu2hl5tf6y/videos 视频质量出奇的高,推荐 透视中国政治by吴国光、程晓农 备忘下,貌似评价挺好的一本书 CAPI China Chair Wu Guoguang (吴国光 / 吳國光)   https://www.youtube.com/playlist?list=PLIt1szHhnm_Hso3jGUbfGpnEAbsPOuEVV 因为热爱中国,我们越要看懂中国 AI Canon   https://a16z.com/2023/05/25/ai-canon/ in this post, we’re sharing a curated list of resources we’ve relied on to get smarter about modern AI. We call it the “AI Canon” because these papers, blog posts, courses, and guides have had an outsized impact on the field over the past several years. 希望中国的投資機構,也能有更多的分享與輸出,提升整個社會的認知 Cantonese Font 粵語字體   https://visual-fonts.com/zh/...

巴菲特致股东信-1975年

 笔记: 华盛顿邮报已成为伯克希尔第一重仓股 翻译: 雪球:https://xueqiu.com/6217262310/131409324 备份:https://archive.ph/4hgK3 原文: To the Stockholders of Berkshire Hathaway Inc.: Last year, when discussing the prospects for 1975, we stated “the outlook for 1975 is not encouraging.” This forecast proved to be distressingly accurate. Our operating earnings for 1975 were $6,713,592, or $6.85 per share, producing a return on beginning shareholders ’ equity of 7.6%. This is the lowest return on equity experienced since 1967. Furthermore, as explained later in this letter, a large segment of these earnings resulted from Federal income tax refunds which will not be available to assist performance in 1976. On balance, however, current trends indicate a somewhat brighter 1976. Operations and prospects will be discussed in greater detail below, under specific industry titles. Our expectation is that significantly better results in textiles, earnings added from recent acquisitio...

Linux私房菜-14章 Linux帐号管理

1.认识三个文件夹 '/etc/passwd' '/etc/shadow' '/etc/group' 2.Mac更改Terminal shell: chsh -s /bin/bash 3.权限更改的一种姿势: chmod u+x file    user group others 4.一般帐号密码忘记:root身份passwd即可    root帐号密码忘记:重启进入用户维护模式再以 passwd命令更改密码,或Live CD开机挂载根目录再修改/etc/shadow,将root密码字段清空,重启后root将不再需要密码 5.有效用户组与初始用户组认识  groups命令查看当前登录用户支持的用户组

产品随想 | 周刊 第128期:将时间转化为知识和体验

自行车棚效应:我们为什么在小事上纠结,却对大事视而不见?   https://limboy.me/posts/bike-shedding Benz-Patent   https://www.mercedes-benz.com/en/innovation/milestones/benz-patent-motor-car/ 豐田博物館   https://toyota-automobile-museum.jp/tw/ 值得一去的汽车博物馆 一人公司   https://github.com/cyfyifanchen/one-person-company one-person-company, 一人公司 AI 工具系列 wujiaxian   https://wujiaxian.com/ 可能吧创始人的个人Blog,介绍自己的方式,很值得学习 日本京都10大設計熱點!「建築大師貝聿銘操刀美術館,皆川明設計旅館、選物店,還有全球最美的藍瓶咖啡店舖!」   https://www.elle.com/tw/life/style/g33846398/2020-kyoto-10-hotspots/ 京都真是非常美 Henry L. Stimson   https://en.wikipedia.org/wiki/Henry_L._Stimson?useskin=vector While Kyoto may have satisfied the military criteria for a useful target, Stimson objected, declaring in a meeting if the Interim Committee on June 1, 1945, "...there was one city that they must not bomb without my permission and that was Kyoto." 人性的努力保护了京都 Brooke Astor, 105, Aristocrat of the People, Dies   https://www.nytimes.com/2007/08/14/obituaries/14astor.html 值得尊敬...

产品随想 | 周刊 第63期:中国城市化的历史思考

Products 李志 · BB   https://github.com/turkyden/lizhi-app 开箱即用,一个珍藏了李志音乐作品集的在线播放器 作者的描述很有意思:我们不能失去信仰~ Watt Toolkit 🧰 (原名 Steam++)   https://github.com/BeyondDimension/SteamTools 「Watt Toolkit」是一个开源跨平台的多功能游戏工具箱,此工具的大部分功能都是需要您下载安装 Steam 才能使用。 语雀为什么没被钉钉吃掉,跟支付宝又是什么关系?   https://www.xiaoyuzhoufm.com/episode/62ed2b1d226f5c1fa0d58357 乱翻书播客推荐 Behind the Curtain   https://www.quiverquant.com/sources/behind-the-curtain/ 我们正在结合我们一直在收集的关于公司游说、国会股票交易和拟议立法的数据,以便让您跟踪华盛顿特区幕后发生的事情您可以使用此工具查看哪些法案正在被国会审议了哪些上市公司正在就这些法案进行游说,以及哪些国会议员交易了这些公司的股票。 民主非常需要这样的信息透明 脑洞大开,给自行车装上倒车雷达和行车记录仪   https://sspai.com/post/73521 佳明-骑行雷达尾灯 Varia RCT 715,非常喜欢,但真的好贵.....3K+ RMB Health 体检报告出现高尿酸,你该如何在饮食方面控制风险?   https://sspai.com/post/73031 Citizenship Consciousness & Privacy 张鸣:中国城市化的历史思考 2019 09 04   https://www.youtube.com/watch?v=rRcPssCkXeI 内核论点是:城市化最重要的有私有产权的商人 这个创作者也值得关注 Run 日本移居指南   https://guoyu.mirror.xyz/bPaDKAcrhJGUbaXu9BWDcdD-F46gBFATTvf_qwZ9Bso 添加加Run模块,润 A Programmer's Guid...

Steve Jobs: `There's Sanity Returning', 1998

Nobody can doubt the charisma of Steven P. Jobs. The interim CEO of Apple Computer Inc., who returned to the company last July after his ignominious 1985 ouster, has brought back his legendary vision, impatience, and infectious passion for the Macintosh. Jobs spoke to Business Week Correspondent Andy Reinhardt in Apple's stark, fourth-floor boardroom, just after the company rolled out its new software strategy on May 11. Note: This is an extended, online-only version of the Q&A that appears in the May 25, 1998, issue of Business Week. Q: Now that you've introduced the new, bold-looking iMac, are you going to do some radically different products? A: There's a lot of talk about such things -- about handhelds, set-top boxes. A lot of computer companies have been searching for a consumer product. My view is that the personal computer has been the most successful consumer product of the last 10 years. What we have to do, what the industry stopp...