UTM坐标的遥感图,Python终于把它扶正啦(手动狗头)
时间:2022-07-25
本文章向大家介绍UTM坐标的遥感图,Python终于把它扶正啦(手动狗头),主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
之前发布了两个大图,一个矢量不对位(这是个明显错误),看红圈圈里的地方,很明显让我国的国土面积少了一大片(别问我遥感底图是啥,我不会告诉你的,毕竟成果还没公开)。
后来修正过,虽然没什么大问题,但总觉得怪怪的,emmmmmmmmm,错的地方都对上了,但整个图歪了!!!强迫症的我怎么能忍。
让我们来详细分析一下问题,原po的途径是利用basemap来画图,basemap的map函数中有许多参数,其中对图像影响较大的应该是投影的选择,它的默认投影选择项较少:
Value Description
cea Cylindrical Equal Area
mbtfpq McBryde-Thomas Flat-Polar Quartic
aeqd Azimuthal Equidistant
sinu Sinusoidal
poly Polyconic
omerc Oblique Mercator
gnom Gnomonic
moll Mollweide
lcc Lambert Conformal
tmerc Transverse Mercator
nplaea North-Polar Lambert Azimuthal
gall Gall Stereographic Cylindrical
npaeqd North-Polar Azimuthal Equidistant
mill Miller Cylindrical
merc Mercator
stere Stereographic
eqdc Equidistant Conic
rotpole Rotated Pole
cyl Cylindrical Equidistant
npstere North-Polar Stereographic
spstere South-Polar Stereographic
hammer Hammer
geos Geostationary
nsper Near-Sided Perspective
eck4 Eckert IV
aea Albers Equal Area
kav7 Kavrayskiy VII
spaeqd South-Polar Azimuthal Equidistant
ortho Orthographic
cass Cassini-Soldner
vandg van der Grinten
laea Lambert Azimuthal Equal Area
splaea South-Polar Lambert Azimuthal
robin Robinson
其实正常情况下也够用,但我这样的确实是奇葩,属于不够用的类型。。。后来我发现其中有个参数:
rsphere radius of the sphere used to define map projection (default6370997 meters, close to the arithmetic mean radius of the earth). If given as a sequence, the first two elements are interpreted as the radii of the major and minor axes of an ellipsoid. Note: sometimes an ellipsoid is specified by the major axis and an inverse flattening parameter (if). The minor axis (b) can be computed from the major axis (a) and the inverse flattening parameter using the formula if = a/(a-b).
no_rot only used by oblique mercator. If settoTrue, the map projection coordinates will not be rotated totrue North. DefaultisFalse (projection coordinates are automatically rotated).
几经调整,还是无果。所以只能另辟蹊径。
需要说明的是,我不想再用basemap,所以我需要准备一个自用的矢量文件,用以替代basemap的底图矢量。先把结果输出吧:
聪明的你应该立刻就能发现不同了吧,这个图的显示方式是彻底利用UTM投影,包括范围的单位都改用米制。而且关键的是,终于不歪脖子了。
思路就是把遥感图转为二维数组,同时计算每个数组的位置坐标,并且叠加上矢量就好了。
我觉得关键是叠加矢量:
patches = [PolygonPatch(feature, edgecolor="red", facecolor="none", linewidth=2) for feature in features]
ax.add_collection(mpl.collections.PatchCollection(patches, match_original=True))
另一部分是计算坐标:
p1 = pyproj.Proj(init='epsg:32650')
for i in range(len(projlatlon)):
coor[i,0],coor[i,1]= p1(projlatlon[i,0],projlatlon[i,1],inverse=True)
完整代码关注公众号,发送关键词 ‘UTM’
您受累。。。‘UTM’一定是大写字母
数据暂时不能分享,有类似问题的同学们可以参照着修改~
转发关注本公众号,会得到up主精神支持+1~ (搞笑)
微信号:一个有趣的灵魂
关注我们,了解更多
- 画廊视图Gallery
- WebForms使用System.Web.Routing
- 学Java到底好不好,已学未学将要学,大家都快看过来
- 理解SynchronizationContext
- WPF 的Main方法
- WiX制作安装包--系统必备
- 选项卡TabHost
- FPGA入门
- .NET 4 System.Threading.Barrier 类
- 终被捕!5名罗马尼亚黑客因入侵华盛顿政府摄像头被捕
- VUE 入门基础(9)
- 国家级人工智能产业基地落户松江,发布上海首款国产人工智能芯片
- C# 4.0 Optional Parameters 和Named Parameters
- 开源Web服务器GoAhead远程代码执行漏洞 影响数十万物联网设备
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- 【STM32F429开发板用户手册】第23章 STM32F429的USART串口基础知识和HAL库API
- 【STM32F407开发板用户手册】第23章 STM32F407的USART串口基础知识和HAL库API
- 小姐姐提灯给你讲讲动态规划(万字长文)
- 解决fedora启动时显示cannot open font file true的办法 By HKL,
- 盘点 6 个被淘汰的 Java 技术,它们都曾经风光过!
- Unlock a VBA password protected Excel file By HKL,
- kde安装gtk主题(kde-gtk-theme)KDE4下gtk程序美化 By HKL,
- Monkey's Audio vs. WavPack vs. FLAC By HKL,
- 彻底屏蔽优酷广告 By HKL, Monday 12 Au
- C# 如何给Winform的button等控件添加快捷键 By HKL,
- kmskeys10 By HKL, Saturday 7
- C# Random 生成不重复随机数 By HKL, We
- Resin4配置 By HKL, Thursday 11
- 从源码编译N(ginx)+M(ySQL)+P(HP)并安装WordPress By HKL,
- MPEG4视频中,I帧、p帧、B帧的判定(转载) By HKL,