本文整理了Java中org.geotools.ysld.parse.ZoomContext.getScaleDenominator()
方法的一些代码示例,展示了ZoomContext.getScaleDenominator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoomContext.getScaleDenominator()
方法的具体详情如下:
包路径:org.geotools.ysld.parse.ZoomContext
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!