“粉红色瓷砖”使用 GeoWebCache 时

发布于 2024-10-06 11:59:59 字数 1245 浏览 4 评论 0 原文

我正在尝试在 Windows Server 2008 上测试基于 PostGIS/Geoserver/OpenLayers 堆栈的简单 web 地图。我一直在使用这个 教程和geoserver 文档

当我尝试使用 GeoWebCache 将 WMS 图层添加到我的地图时:

    var index1d = new OpenLayers.Layer.WMS(
        "Index1",
        "http://localhost:1979/geoserver/gwc/service/wms",
        {'layers': "Index2000:index1d",
         'format': "image/png",
         'transparent': true
        },
        {'opacity': 1.0, 'isBaseLayer': true}

    );
    map.addLayer(index1d);

我得到了臭名昭著的“粉红色瓷砖”。 Geoserver 中的错误说:

ERROR [geowebcache.GeoWebCacheDispatcher] - Requested horizontal resolution:
750.0000000000005 , best match: 632.4668417968734 exceeds 10% threshold. 
Perhaps the client is configured  with an incorrect set of scales (resolutions),  
or the DPI setting is off compared to the one in GWC ? http://localhost:
1979/geoserver/gwc/service/wms

我的图层似乎配置正确,当我在没有 GeoWebCache 的情况下提供它时,简单地说:

"http://localhost:1979/geoserver/wms"

一切正常。

有人能指出我哪里出错了吗?

I'm trying to test simple web map based on PostGIS/Geoserver/OpenLayers stack on Windows Server 2008. I've been using this tutorial and geoserver docs.

When I try to add WMS layer to my map using GeoWebCache:

    var index1d = new OpenLayers.Layer.WMS(
        "Index1",
        "http://localhost:1979/geoserver/gwc/service/wms",
        {'layers': "Index2000:index1d",
         'format': "image/png",
         'transparent': true
        },
        {'opacity': 1.0, 'isBaseLayer': true}

    );
    map.addLayer(index1d);

I get infamous 'pink tiles'. Error in Geoserver says:

ERROR [geowebcache.GeoWebCacheDispatcher] - Requested horizontal resolution:
750.0000000000005 , best match: 632.4668417968734 exceeds 10% threshold. 
Perhaps the client is configured  with an incorrect set of scales (resolutions),  
or the DPI setting is off compared to the one in GWC ? http://localhost:
1979/geoserver/gwc/service/wms

My layer seems to be configured correctly and when I serve it without GeoWebCache with simply:

"http://localhost:1979/geoserver/wms"

everything works fine.

Could anyone point where I'm making mistake?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青芜 2024-10-13 11:59:59

我没用过GWC,但我猜你自己设置了缓存?如果是这样,我想您必须设置 GWC 创建图块的比例。基于这些假设,我想说您在访问图块时必须使用相同的比例级别。检查您的 GWC 设置,也许可以重新创建缓存。

(使用 WMS 会起作用,因为默认情况下地图数据是动态渲染的,采用您提供的任何参数并从中渲染。)

I haven't used GWC, but I guess you have set up the cache yourself? If so, I suppose you had to set the scales where GWC would create it's tiles. Building on these assumptions, I would say that you then must use the same scale levels when accessing the tiles. Look over your GWC settings and maybe recreate the cache.

(Using WMS will work because the map data by default is rendered on the fly, taking whatever parameters you supply it with and rendering from that.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文