【问题标题】:How to convert x y z tile to a geotools bbox or ReferenceEnvelope如何将 x y z tile 转换为 geotools bbox 或 ReferenceEnvelope
【发布时间】:2020-12-25 14:11:05
【问题描述】:

我正在使用带有 xyz 系统的 lefleat 切片图层来查询 postgis 图层列表,我使用 geotools jdbc 数据存储从数据库中获取图层,但我必须使用 bbox 或 geotools 参考信封,我如何转换xyz 坐标到 bbox 或参考信封,因此我可以稍后将其传递给我的数据存储特征源,以便我可以在给定的 bbox 中找到几何或元素,我的坐标系是 EPSG:4326。

【问题讨论】:

    标签: postgis datastore geotools


    【解决方案1】:

    您可以使用gt-tile-client 中的代码来使用 XYZ 服务。

    我认为以下内容应该适合您。

    String ref = "7/61/53";
    
    String[] parts = ref.split("/");
    int z = Integer.valueOf(parts[0]);
    int x = Integer.valueOf(parts[1]);
    int y = Integer.valueOf(parts[2]);
    
    OSMTile tile = new OSMTile(x, y, new WebMercatorZoomLevel(z), new OSMService("name", "url"));
    System.out.println(tile.getExtent());
    

    给了

    ReferencedEnvelope[-8.4375 : -5.625, 27.05912578437406 : 29.535229562948455]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-12
      • 1970-01-01
      • 1970-01-01
      • 2020-05-03
      • 1970-01-01
      • 2015-10-30
      • 2015-07-28
      • 1970-01-01
      相关资源
      最近更新 更多