geotif 添加坐标_从tiff和4个角落的经纬度创建geotiff

本文介绍了如何使用gdal_translate工具将非地理信息的TIFF图像转换为GeoTIFF,并通过设置地面控制点(gcps)进行地理配准。详细解释了命令行参数的使用,包括指定坐标系统(EPSG:4326)、设置gcps以及使用gdalwarp进行投影转换,确保图像与WGS84坐标系对齐。
摘要由CSDN通过智能技术生成

I have an image (map) without geo data in TIFF format.

I need to get GeoTIFF file from my image. I have latitude and longitude for each corner of my map. How can I add my geo data to my image in Google spatial refence to get geotiff? I need a tool that can do this.

解决方案

You have the right idea in your answer but allow me to expand. You are correct, you'll need to use the gdal_translate tool to set ground control points (gcps) to georeference the image. But the command line argument should go like so:

gdal_translate -of GTiff -a_srs EPSG:4326 -gcp [pixel line easting northing] -gcp [pixel line easting northing] -gcp [pixel line easting northing] sourcefile outpulfile

You don't necessarily have to output to a VRT, VRT's are useful if you want to perform other algorithms to your file, add more datasets to it, eventually output it as a KML - amongst others which you can read up on here ( http://www.gdal.org/gdal_vrttut.html ). But for this purpose setting -of to GTiff is ideal.

-a_srs EPSG:4326

Next, in the spatial reference you are correct it should be referenced to WGS84 the coordinate system used by google earth, however we specify it using EPSG:4326 - this is just the coding scheme the Geomatics Committee has agreed on to identify coordinate systems worldwide ( http://www.epsg.org/ ).

-gcp [pixel line easting northing]

The ground control points, are probably the most trickiest part of the command line argument. The first 2 numbers represent the pixel and line coordinate of your actual image, for instance (0,0) for the top left most corner of your image. The second set of numbers that should follow is the corresponding lat/long coordinates that your image should be referenced to. Now, you'll only need 3 of these -gcps because the 4th one will be determined if your image is a square/rectangle.

sourcefile outpulfile

This part should be self-explanatory, just remember they are both *.tif files.

Now, there if one last thing you will need to do to complete your task. You will have to actually project the image to the coordinate system for it to be aligned. This is down using the gdalwarp command ( http://www.gdal.org/gdalwarp.html ).

gdalwarp -t_srs EPSG:4326 sourcefile outputfile

You'll have to specify an -of (output fileformat) if it was supposed to something other than a GeoTiff - but the default format is GTiff so you don't need to specify it.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值