org.geotools.ysld.parse.ZoomContext.getScaleDenominator()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中org.geotools.ysld.parse.ZoomContext.getScaleDenominator()方法的一些代码示例,展示了ZoomContext.getScaleDenominator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoomContext.getScaleDenominator()方法的具体详情如下:
包路径:org.geotools.ysld.parse.ZoomContext
类名称:ZoomContext
方法名:getScaleDenominator

ZoomContext.getScaleDenominator介绍

[英]Find the reciprocal of the scale at a specified zoom level in this context.
[中]在此上下文中,在指定的缩放级别上查找比例的倒数。

代码示例

代码示例来源:origin: geotools/geotools

@Test
public void testWGS84Scales() throws Exception {
  ZoomContext context = WellKnownZoomContextFinder.getInstance().get("DEFAULT");
  for (int i = 0; i < WGS84_SCALE_DENOMS.length; i++) {
    assertThat(
        context.getScaleDenominator(i), mCloseTo(WGS84_SCALE_DENOMS[i], 0.00000001d));
  }
}

代码示例来源:origin: org.geoserver.community/gs-ysld

@Test
public void testScaleNegativeLevel() throws Exception {
  GridSetBroker broker = createMock(GridSetBroker.class);
  GridSet set = createMock(GridSet.class);
  
  expect(broker.get("test")).andStubReturn(set);
  expect(set.getNumLevels()).andStubReturn(5);
  
  replay(broker, set);
  
  ZoomContextFinder finder = new GWCZoomContextFinder(broker);
  
  ZoomContext zContext = finder.get("test");
  
  double denom = zContext.getScaleDenominator(-1);
  
  assertThat(denom, is(Double.POSITIVE_INFINITY));
    verify(broker, set);
}

代码示例来源:origin: org.geoserver.community/gs-ysld

@Test
public void testScalePastEnd() throws Exception {
  GridSetBroker broker = createMock(GridSetBroker.class);
  GridSet set = createMock(GridSet.class);
  
  expect(broker.get("test")).andStubReturn(set);
  expect(set.getNumLevels()).andStubReturn(5);
  
  replay(broker, set);
  
  ZoomContextFinder finder = new GWCZoomContextFinder(broker);
  
  ZoomContext zContext = finder.get("test");
  
  double denom = zContext.getScaleDenominator(5);
  
  assertThat(denom, is(0d));
    verify(broker, set);
}

相关文章