使两个横司与GDAL保持一致

发布于 2025-02-13 10:28:02 字数 827 浏览 0 评论 0原文

我正在尝试使用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:

enter image description here

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.
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文