当使用REST API更新资源时,显示GeoServer的图层时出现问题
当使用GeoServer API更新覆盖范围存储层的NETCDF资源时,我遇到了一个奇怪的问题。资源是一个包含一个3D(LON,LAT,TIME)变量的NetCDF。但是,时间维度仅为长度= 1。我的代码在docker容器中运行,并在.sh文件中使用curl来运行API命令。
我必须强调,问题只会偶尔发生,也许有10%的时间,也许更少。
当问题发生时,商店的更新似乎存在问题,并且该图层无法显示。当查看GET功能时,奇怪的是,时间维度不是正确的日期,而是等于1970-01-01t00:00:00.000Z,这是NetCDF中使用的参考日期方面。同样,日志中未检测到任何问题。
我确实知道问题不在文件上,也可能不是文件的上传。确实,当问题发生时,我可以成功地创建一个商店和一个具有相同资源的商店和图层,并且与不起作用的图层相同的参数。 我已经通过API尝试了多件事来解决此问题:
- 重置资源缓存。它有时有效,但并非总是
- 删除图层,每次我需要更新资源
- 删除资源,层和存储并在资源更新时重新创建所有内容时,并重新创建它们。
似乎没有任何东西可以永久摆脱问题。有没有人经历过相同的行为?这不是我第一次在数据收集器中使用GeoServer的API,而是我第一次遇到这个问题!
编辑
我还试图通过删除时间维度使NetCDF文件尽可能简单。 因此,现在,NetCDF文件只有4个变量:LON,LAT,网格变量,以及一个称为CRS的变量,该变量为尺寸为0,因此是空的(我现在将其留在那里,因为它来自外部源文件)。 但是话又说回来,同样的问题发生了,偶尔只有一次。但是,当发生这种情况时,Geoserver的日志中似乎遇到了一些错误:
2022-06-08 16:01:28,267警告[aperative.provoction] - 可能使用“流行可视化伪MERCATOR”的投影之外的投影区域。 经度2147483287°00.0'W超出范围(±180°)。
,但是如果发生这种情况,我通常可以清除资源缓存,并且该图层将再次看到。
所以我仍然不知道发生了什么。可能是空的CRS变量有时会造成问题吗? 非常感谢您的帮助!
I am having a weird issue when using geoserver api to update a netcdf resource of a coverage store layer. The resource is a netcdf containing one 3D (lon, ,lat, time) variable. However, the time dimension is only of length = 1. My code runs within a docker container and uses curl in a .sh file to run the api commands.
I must stress that the problem occurs only once in a while, maybe 10% of the time, maybe less.
When th problem occurs, the update of the store seems to have a problem and the layer cannot be displayed. When looking in the get Capabilities, one of the weird thing is that the time dimension is not right date, but is rather equal to 1970-01-01T00:00:00.000Z, which is the reference date used in the netcdf for the time dimension. Also, no problems are detected in the logs.
I do know that the problem is not with the file, and probably not with the upload of the file. Indeed, when the problem occurs, I can successfully create a store and a layer with the same resource and the same parameters as the layer that is not working.
I have tried multiple things via the API to solve this issue:
- Reset the resource cache. It sometimes works, but not always
- Delete layer and store and recreating them every time I need to update the resource
- Delete resource, layer and store and recreating everything when resource update.
Nothing seems to get rid of the problem permanently. Has anyone experienced the same kind of behavior? It is not the first time I use geoserver’s api in a data harvester, but it is the first time I have this problem!
EDIT
I also tried to make the make the netcdf file as simple as I could, by removing the time dimension.
So now, the netcdf file only has 4 variables: lon, lat, the gridded variable, and a variable called crs that is of dimension 0, so is empty (I left it there for now since it comes from the outside source file).
But then again, the same kind of issue occurs, and again only once in a while. However, when it occurs, there seems to be something wrong caught in geoserver's log:
2022-06-08 16:01:28,267 WARN [operation.projection] - Possible use of "Popular Visualisation Pseudo Mercator" projection outside its valid area.
Longitude 2147483287°00.0'W is out of range (±180°).
But again, if when this happens, I can usually clear the resource cache and the layer will become visible again.
So I still dont know what is happening. Could it be the empty crs variable that sometimes creates problems?
Thanks a lot for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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