使用GDAL将立体投影转换为epsg 28992

如何解决使用GDAL将立体投影转换为epsg 28992

我正在尝试使用gdalwarp将极地立体图像投影到墨卡托投影epsg 28992(用于传单)

gdalinfo "HDF5:\"RAD_NL25_PCP_NA_202010271205.h5\"://image1/image_data"

Driver: HDF5Image/HDF5 Dataset
Files: RAD_NL25_PCP_NA_202010271205.h5
Size is 700,765
Metadata:
  geographic_geo_column_offset=0
  geographic_geo_dim_pixel=KM,KM
  geographic_geo_number_columns=700
  geographic_geo_number_rows=765
  geographic_geo_par_pixel=X,Y
  geographic_geo_pixel_def=LU
  geographic_geo_pixel_size_x=1.0000035
  geographic_geo_pixel_size_y=-1.0000048
  geographic_geo_product_corners=0 49.362064 0 55.973602 10.856453 55.388973 9.0093002 48.895302
  geographic_geo_row_offset=3649.9819
  geographic_map_projection_projection_indication=Y
  geographic_map_projection_projection_name=STEREOGRAPHIC
  geographic_map_projection_projection_proj4_params=+proj=stere +lat_0=90 +lon_0=0 +lat_ts=60 +a=6378.14 +b=6356.75 +x_0=0 y_0=0
  image1_calibration_calibration_flag=Y
  image1_calibration_calibration_formulas=GEO = 0.500000 * PV + -32.000000
  image1_calibration_calibration_missing_data=0
  image1_calibration_calibration_out_of_image=255
  image1_image_bytes_per_pixel=1
  image1_image_geo_parameter=REFLECTIVITY_[DBZ]
  image1_image_product_name=RAD_NL25_PCP_H1.5_NA
  image1_image_size=535500
  image1_statistics_stat_max_value=44.5
  image1_statistics_stat_min_value=-31.5
  overview_hdftag_version_number=3.6
  overview_number_image_groups=1
  overview_number_radar_groups=3
  overview_number_satellite_groups=0
  overview_number_station_groups=0
  overview_products_missing=NA
  overview_product_datetime_end=27-OCT-2020;12:05:00.000
  overview_product_datetime_start=27-OCT-2020;12:05:00.000
  overview_product_group_name=RAD_NL25_PCP_NA
  radar1_radar_location=5.17834 52.101681
  radar1_radar_name=DeBilt
  radar1_radar_operational=0
  radar2_radar_location=4.7999701 52.953339
  radar2_radar_name=DenHelder
  radar2_radar_operational=1
  radar3_radar_location=5.1381001 51.836899
  radar3_radar_name=Herwijnen
  radar3_radar_operational=1
Corner Coordinates:
Upper Left  (    0.0,0.0)
Lower Left  (    0.0,765.0)
Upper Right (  700.0,0.0)
Lower Right (  700.0,765.0)
Center      (  350.0,382.5)
Band 1 Block=700x765 Type=Byte,ColorInterp=Undefined
  Metadata:
    image1_image_data_CLASS=IMAGE
    image1_image_data_PALETTE=
    image1_image_data_VERSION=1.2
gdalwarp -s_srs "+proj=stere +lat_0=90 +lon_0=0 +lat_ts=60 +a=6378.14 +b=6356.75 +x_0=0 y_0=0" -t_srs "epsg:28992" "HDF5:\"RAD_NL25_PCP_NA_202010271205.h5\"://image1/image_data" output.tif

这将导致此错误消息:

Processing HDF5:"RAD_NL25_PCP_NA_202010271205.h5"://image1/image_data [1/1] : 0ERROR 1: The transformation is already "north up" or a transformation between pixel/line and georeferenced coordinates cannot be computed for HDF5:"RAD_NL25_PCP_NA_202010271205.h5"://image1/image_data. There is no affine transformation and no GCPs. Specify transformation option SRC_METHOD=NO_GEOTRANSFORM to bypass this check.

我想念什么?如果我设置标志SRC_METHOD = NO_GEOTRANSFORM我没有得到预期的结果

解决方法

对GDAL中的HDF5数据的地理参考支持非常有限(https://gdal.org/drivers/raster/hdf5.html)。因此,GDAL无法将您的HDF5文件识别为地理参考数据。

我的解决方案是将您的命令分为两个步骤:

  1. 使用gdal_translate对地理投影进行地理参照
  2. 使用gdalwarp转换为epsg:28992

首先,SRS的定义是地球的大小,应在m中表示如下。

+proj=stere +lat_0=90 +lon_0=0 +lat_ts=60 +a=6378140 +b=6356750 +x_0=0 +y_0=0

接下来,假设元数据geographic_geo_product_corners代表图像四个角的纬度和经度,我们找到了图像角的投影坐标。

LL (0,-4415002.84084825)
UL (0,-3649999.11191775)
UR (700002.437056242,-3649999.05174429)
LR (700002.440031711,-4415003.15918867)

我用gdaltransform找到了。

gdaltransform -s_srs "+proj=latlong" -t_srs "+proj=stere +lat_0=90 +lon_0=0 +lat_ts=60 +a=6378140 +b=6356750 +x_0=0 y_0=0"

因此,您的问题中的转换可以通过以下命令完成

gdal_translate -of VRT -a_srs "+proj=stere +lat_0=90 +lon_0=0 +lat_ts=60 +a=6378140 +b=6356750 +x_0=0 +y_0=0" -a_ullr 0 -3649999.05174429 700002.440031711 -4415003.15918867 "HDF5:\"RAD_NL25_PCP_NA_202010271205.h5\"://image1/image_data" /vsistdout/ | gdalwarp -of GTiff -t_srs epsg:28992 /vsistdin/ output.tif

有关如何将两个gdal命令与管道结合使用的信息,请参见How to convert projection of png tile from epsg:4326 to epsg:3857 by one command using gdal中的答案。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-