找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 323|回复: 1

[每日一码] 地理信息TIF文件转出TFW

[复制链接]

已领礼包: 145个

财富等级: 日进斗金

发表于 2025-2-6 18:47:50 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×

If you only have GEOTIFF and lost the TFW file, you can get it through the XDRX API function xdrx-geotiff->worldfile

Usage:
  1. Command: (xdrx-geotiff->worldfile "D:\\Rectangle_#8.tif")
  2. "D:\\Rectangle_#8.tfw"



Open D:\\Rectangle_#8.tfw:

0.5971642835
0.0000000000
0.0000000000
-0.5971642835
13783278.1130216978
5143915.5115256160

The following function can determine whether an image file supports geographic information

  1. Command: (xdrx-geotiff-isa "D:\\Rectangle_#8.tif")

  2. (1.37833e+07 5.14392e+06 0.597164 -0.597164 0.0 0.0)


Return:
1. X coordinate of the upper left corner of the image (geographic coordinates)
2. Y coordinate of the upper left corner of the image (geographic coordinates)
3. Actual geographic unit length of each pixel in the X direction
4. Actual geographic unit length of each pixel in the Y direction
5. X direction rotation angle
6. Y direction rotation angle

Get the maximum X and Y pixel coordinates of a geospatial image file

  1. Command: (xdrx-tiff-rastersize "D:\\Rectangle_#8.tif")
  2. (30928 28017)


return:
1.X pixel
2.Y pixel

Get the number of bands in an image dataset

  1. Command: (xdrx-geotiff-bandcount "D:\\Rectangle_#8.tif")
  2. 3

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 363个

财富等级: 日进斗金

发表于 2025-3-11 21:05:03 | 显示全部楼层
本帖最后由 zhong2013 于 2025-3-11 21:07 编辑

给楼主提个建议,从照片文件中提取位置信息,现在手机的照片都有位置信息,在属性中是EXIF格式的经纬度,vlisp想直接提取到这个位置数据好像有点麻烦。API中可以增加这个功能么,有了经纬度就可以把照片插入到图上了。
GPS.png
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-4-22 13:14 , Processed in 0.301032 second(s), 35 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表