使两个横司与GDAL保持一致
我正在尝试使用QGIS中的GDAL Warp将一个栅格与另一个光栅对齐。完善此过程后,我将在脚本中使用Python GDAL包装器。我已经看到了有关对齐问题的其他线程,该线程的重要性使用参考图像的范围坐标,单元格分辨率和-TAP
参数迫使第二张图像对齐。我运行了这个:
gdalwarp -s_srs EPSG:32630 -t_srs EPSG:32630 -tr 0.25 0.25 -r near -te 511711.9928
6328998.9708 514192.6233 6331359.4866 -of GTiff -tap <path-input> <path-output>
但是输出仍然有些关闭:
9442和输出图像的尺寸为9924 x 9443。我希望它们是相同的,并具有相同的单元格分辨率。他们必须完美重叠以使其稍后转换为Numpy阵列。
显然有问题吗?我知道QGIS中的Align栅格工具,但是我希望在GDAL中完成此操作,以便我可以适应Python脚本。谢谢。
I'm trying to align one raster to another using GDAL Warp in QGIS. Once I have this perfected, I will use the Python GDAL wrapper in a script. I've seen other threads about alignment issue which stateit's important use the reference image's extent coords, cell resolution and the -tap
argument to force the second image to align. I ran this:
gdalwarp -s_srs EPSG:32630 -t_srs EPSG:32630 -tr 0.25 0.25 -r near -te 511711.9928
6328998.9708 514192.6233 6331359.4866 -of GTiff -tap <path-input> <path-output>
But the output is still slightly off:
The dimensions of the reference image are 9923 x 9442 and the dimensions of the output image are 9924 x 9443. I want these to be the same, with the same cell resolution. They must overlap perfectly for conversion to numpy arrays later.
Is something obviously wrong? I'm aware of the Align Raster tool in QGIS, but I want this done in GDAL so I can adapt to a Python script. Thanks.
These are the data from the original rasters. I'm trying to match the one with the lower resolution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论