我正在尝试访问由 https://www.eumetsat.int/ 生成的云覆盖栅格。然后我使用 raster2pgsql 转换 grib2 文件并将其加载到 postgres 中。即使它抛出 4 条关于超出投影域的错误消息,这似乎也有效。我发现一个文档说它使用了 SRID WGS84 并且下面有 SRID 定义。
现在一切都已加载,我可以使用下面的查询访问 grib 数据。问题是我无法弄清楚如何使用纬度和经度来访问数据。我可以使用偏离中心的米,但这不是很有用。
有什么想法吗?
/usr/bin/raster2pgsql -s 981 -f rast -F -I -b 1 "$grbFileName" "$TABLENAME" >$SQLFILE
INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 981, 'sr-org', 81, '+proj=geos +lon_0=0 +h=-0 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs ', 'PROJCS["unnamed",GEOGCS["unnamed ellipse",DATUM["unknown",SPHEROID["unnamed",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Geostationary_Satellite"],PARAMETER["central_meridian",0],PARAMETER["satellite_height",-0],PARAMETER["false_easting",0],PARAMETER["false_northing",0]]');
工作查询:
select filename, st_value(rast, 3712-cast(rt as integer), 3712-cast(ct as integer), true) as val from grib where filename like fn;
root@0729de7efd61:/python# gdalinfo -json MSG4-SEVI-MSGCLMK-0100-0100-20210524000000.000000000Z-NA.grb
ERROR 1: Point outside of projection domain
ERROR 1: Point outside of projection domain
ERROR 1: Point outside of projection domain
ERROR 1: Point outside of projection domain
ERROR 1: Point outside of projection domain
{
"description":"MSG4-SEVI-MSGCLMK-0100-0100-20210524000000.000000000Z-NA.grb",
"driverShortName":"GRIB",
"driverLongName":"GRIdded Binary (.grb, .grb2)",
"files":[
"MSG4-SEVI-MSGCLMK-0100-0100-20210524000000.000000000Z-NA.grb"
],
"size":[
3712,
3712
],
"coordinateSystem":{
"wkt":"PROJCRS[\"unnamed\",\n
BASEGEOGCRS[\"Coordinate System imported from GRIB file\",\n
DATUM[\"unnamed\",\n
ELLIPSOID[\"Spheroid imported from GRIB file\",6378140,298.252981061492,\n
LENGTHUNIT[\"metre\",1,\n
ID[\"EPSG\",9001]]]],\n
PRIMEM[\"Greenwich\",0,\n
ANGLEUNIT[\"degree\",0.0174532925199433,\n
ID[\"EPSG\",9122]]]],\n
CONVERSION[\"Geostationary Satellite (Sweep Y)\",\n
METHOD[\"Geostationary Satellite (Sweep Y)\"],\n
PARAMETER[\"Longitude of natural origin\",0,\n
ANGLEUNIT[\"degree\",0.0174532925199433],\n
ID[\"EPSG\",8802]],\n
PARAMETER[\"Satellite Height\",35785831,\n
LENGTHUNIT[\"metre\",1,\n
ID[\"EPSG\",9001]]],\n
PARAMETER[\"False easting\",0,\n
LENGTHUNIT[\"metre\",1],\n
ID[\"EPSG\",8806]],\n
PARAMETER[\"False northing\",0,\n
LENGTHUNIT[\"metre\",1],\n
ID[\"EPSG\",8807]]],\n
CS[Cartesian,2],\n
AXIS[\"(E)\",east,\n
ORDER[1],\n
LENGTHUNIT[\"Metre\",1]],\n
AXIS[\"(N)\",north,\n
ORDER[2],\n
LENGTHUNIT[\"Metre\",1]]]",
"dataAxisToSRSAxisMapping":[
1,
2
]
},
"geoTransform":[
-5570248.4775829734280705,
3000.4031659482757277,
0.0,
5570248.4775829734280705,
0.0,
-3000.4031659482757277
],
"metadata":{
},
"cornerCoordinates":{
"upperLeft":[
-5570248.478,
5570248.478
],
"lowerLeft":[
-5570248.478,
-5567248.074
],
"lowerRight":[
5567248.074,
-5567248.074
],
"upperRight":[
5567248.074,
5570248.478
],
"center":[
-1500.202,
1500.202
]
},
"wgs84Extent":{
"type":"Polygon",
"coordinates":[
[
]
]
},
"bands":[
{
"band":1,
"block":[
3712,
1
],
"type":"Float64",
"colorInterpretation":"Undefined",
"description":"0.000[-] undefined ()",
"metadata":{
"":{
"GRIB_COMMENT":"Cloud mask [0=clear over water; 1=clear over land; 2=cloud]",
"GRIB_DISCIPLINE":"3(Space_products)",
"GRIB_ELEMENT":"CLOUDM",
"GRIB_FORECAST_SECONDS":"0 sec",
"GRIB_IDS":"CENTER=254(EUMETSAT Operation Centre) SUBCENTER=0 MASTER_TABLE=3 LOCAL_TABLE=0 SIGNF_REF_TIME=3(Observation_time) REF_TIME=2021-05-24T00:00:00Z PROD_STATUS=1(Operational_test) TYPE=6(Processed_satellite_observations)",
"GRIB_PDS_PDTN":"30",
"GRIB_PDS_TEMPLATE_ASSEMBLED_VALUES":"0 7 8 1 1 333 58 207 255 4294967295",
"GRIB_PDS_TEMPLATE_NUMBERS":"0 7 8 1 1 1 77 0 58 207 255 255 255 255 255",
"GRIB_REF_TIME":"1621814400 sec UTC",
"GRIB_SHORT_NAME":"0 undefined",
"GRIB_UNIT":"[0=clear over water; 1=clear over land; 2=cloud]",
"GRIB_VALID_TIME":"1621814400 sec UTC"
}
}
}
]
}