当前位置: 首页>>代码示例>>Java>>正文


Java RasterLayerInfo类代码示例

本文整理汇总了Java中org.geomajas.configuration.RasterLayerInfo的典型用法代码示例。如果您正苦于以下问题:Java RasterLayerInfo类的具体用法?Java RasterLayerInfo怎么用?Java RasterLayerInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RasterLayerInfo类属于org.geomajas.configuration包,在下文中一共展示了RasterLayerInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTileConfiguration

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
/**
 * Create the tile configuration
 */
private static TileConfiguration createTileConfiguration(ClientRasterLayerInfo layerInfo) {
	RasterLayerInfo serverLayerInfo = (RasterLayerInfo) layerInfo.getLayerInfo();
	TileConfiguration tileConfig = new TileConfiguration();
	tileConfig.setTileWidth(serverLayerInfo.getTileWidth());
	tileConfig.setTileHeight(serverLayerInfo.getTileHeight());
	if (serverLayerInfo.getResolutions().size() > 0) {
		// use resolutions of server for raster layer (as yet not reprojectable)
		tileConfig.setResolutions(serverLayerInfo.getResolutions());
	} else {
		// if no resolutions, fall back to quad tree numbers
		ArrayList<Double> resolutions = new ArrayList<Double>();
		for (int i = 0; i < 50; i++) {
			resolutions
					.add(layerInfo.getMaxExtent().getWidth() / (serverLayerInfo.getTileWidth() * Math.pow(2, i)));
			tileConfig.setResolutions(resolutions);
		}
	}
	tileConfig.setTileOrigin(BboxService.getOrigin(layerInfo.getMaxExtent()));
	return tileConfig;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:24,代码来源:RasterServerLayerImpl.java

示例2: initialize

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
@Before
public void initialize() {
	// Initialize main components:
	eventBus = new MapEventBusImpl(this, GeomajasImpl.getInstance().getEventBus());
	viewPortMock = Mockito.mock(ViewPort.class);
	layerInfo = new ClientRasterLayerInfo();

	RasterLayerInfo rasterLayerInfo = new RasterLayerInfo();
	rasterLayerInfo.setTileHeight(256);
	rasterLayerInfo.setTileWidth(256);
	rasterLayerInfo.setResolutions(Arrays.asList(resolutions));
	layerInfo.setLayerInfo(rasterLayerInfo);
	layerInfo.setMaxExtent(rasterLayerInfo.getMaxExtent());
	layerInfo.setMinimumScale(new ScaleInfo(1 / resolutionMax));
	layerInfo.setMaximumScale(new ScaleInfo(1 / resolutionMin));

	mapConfig = new MapConfigurationImpl();
	mapConfig.setHintValue(GeomajasServerExtension.MAPINFO, mapInfo);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:20,代码来源:RasterServerLayerIsShowingTest.java

示例3: TileServiceState

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
public TileServiceState(GeoService geoService, RasterLayerInfo layerInfo) {
	try {
		crs = geoService.getCrs2(layerInfo.getCrs());
	} catch (LayerException e) {
		throw new IllegalStateException(e);
	}
	maxBounds = new Envelope(layerInfo.getMaxExtent().getX(), layerInfo.getMaxExtent().getMaxX(), layerInfo
			.getMaxExtent().getY(), layerInfo.getMaxExtent().getMaxY());

	resolutions = new ArrayList<Double>();
	if (layerInfo.getZoomLevels() != null) {
		for (ScaleInfo scale : layerInfo.getZoomLevels()) {
			resolutions.add(1. / scale.getPixelPerUnit());
		}

		// Sort in decreasing order !!!
		Collections.sort(resolutions);
		Collections.reverse(resolutions);
	}
	tileWidth = layerInfo.getTileWidth();
	tileHeight = layerInfo.getTileHeight();
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:23,代码来源:TileServiceState.java

示例4: asLayerInfo

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
/**
 * Transform a TMS layer description object into a raster layer info object.
 * 
 * @param tileMap
 *            The TMS layer description object.
 * @return The raster layer info object as used by Geomajas.
 */
public RasterLayerInfo asLayerInfo(TileMap tileMap) {
	RasterLayerInfo layerInfo = new RasterLayerInfo();

	layerInfo.setCrs(tileMap.getSrs());
	layerInfo.setDataSourceName(tileMap.getTitle());
	layerInfo.setLayerType(LayerType.RASTER);
	layerInfo.setMaxExtent(asBbox(tileMap.getBoundingBox()));
	layerInfo.setTileHeight(tileMap.getTileFormat().getHeight());
	layerInfo.setTileWidth(tileMap.getTileFormat().getWidth());

	List<ScaleInfo> zoomLevels = new ArrayList<ScaleInfo>(tileMap.getTileSets().getTileSets().size());
	for (TileSet tileSet : tileMap.getTileSets().getTileSets()) {
		zoomLevels.add(asScaleInfo(tileSet));
	}
	layerInfo.setZoomLevels(zoomLevels);

	return layerInfo;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:26,代码来源:TmsConfigurationService.java

示例5: postProcess

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
private void postProcess(RasterLayer layer) throws LayerException {
	RasterLayerInfo info = layer.getLayerInfo();
	for (ScaleInfo scale : info.getZoomLevels()) {
		// for raster layers we don't accept x:y notation !
		if (scale.isPixelPerUnitBased()) {
			throw new LayerException(ExceptionCode.CONVERSION_PROBLEM, "Raster layer " + layer.getId()
					+ " has zoom level " + scale.getNumerator() + ":" + scale.getDenominator()
					+ " in disallowed x:y notation");
		}
		// add the resolution for deprecated api support
		info.getResolutions().add(1. / scale.getPixelPerUnit());
	}
	if (0 == info.getTileWidth()) {
		throw new LayerException(ExceptionCode.LAYER_CONFIGURATION_PROBLEM, layer.getId(),
				"tileWidth should not be zero.");
	}
	if (0 == info.getTileHeight()) {
		throw new LayerException(ExceptionCode.LAYER_CONFIGURATION_PROBLEM, layer.getId(),
				"tileHeight should not be zero.");
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:22,代码来源:ConfigurationDtoPostProcessor.java

示例6: testAsLayerInfo

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
@Test
public void testAsLayerInfo() throws TmsLayerException {
	TmsLayer tmsLayer = new TmsLayer();
	tmsLayer.setBaseTmsUrl("classpath:/org/geomajas/layer/tms/tileMapCapa1.xml");
	TileMap tileMap = configurationService
			.getCapabilities(tmsLayer);
	RasterLayerInfo layerInfo = configurationService.asLayerInfo(tileMap);

	// Check general parameters:
	Assert.assertEquals(LayerType.RASTER, layerInfo.getLayerType());
	Assert.assertEquals(tileMap.getTitle(), layerInfo.getDataSourceName());
	Assert.assertEquals(tileMap.getSrs(), layerInfo.getCrs());
	Assert.assertEquals(tileMap.getTileFormat().getWidth(), layerInfo.getTileWidth());
	Assert.assertEquals(tileMap.getTileFormat().getHeight(), layerInfo.getTileHeight());

	// Check maximum extent:
	Bbox maxExtent = layerInfo.getMaxExtent();
	Assert.assertEquals(tileMap.getBoundingBox().getMinX(), maxExtent.getX(), DELTA);
	Assert.assertEquals(tileMap.getBoundingBox().getMinY(), maxExtent.getY(), DELTA);
	Assert.assertEquals(tileMap.getBoundingBox().getMaxX(), maxExtent.getMaxX(), DELTA);
	Assert.assertEquals(tileMap.getBoundingBox().getMaxY(), maxExtent.getMaxY(), DELTA);

	// Check the zoom levels:
	Assert.assertEquals(tileMap.getTileSets().getTileSets().size(), layerInfo.getZoomLevels().size());
	for (int i = 0; i < layerInfo.getZoomLevels().size(); i++) {
		Assert.assertEquals(tileMap.getTileSets().getTileSets().get(i).getUnitsPerPixel(), 1 / layerInfo
				.getZoomLevels().get(i).getPixelPerUnit(), DELTA);
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:30,代码来源:TmsConfigurationTest.java

示例7: MockProxyLayer

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
public MockProxyLayer(String id) {
	this.id = id;
	authentication = new LayerAuthentication();
	authentication.setUser("user-" + id);
	authentication.setPassword("password-" + id);
	authentication.setRealm("realm-" + id);
	info = new RasterLayerInfo();
	info.setMaxExtent(new Bbox(0, 0, 100, 100));
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:10,代码来源:MockProxyLayer.java

示例8: getLayerInfo

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
public RasterLayerInfo getLayerInfo() {
	return tileServiceState.getLayerInfo();
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:4,代码来源:OsmLayer.java

示例9: getPriority

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
@Override
public Priority getPriority(Map<String, Object> parameters) {
	Priority priority = super.getPriority(parameters);
	priority = priority.and(checkClass(LAYER_INFO, RasterLayerInfo.class, parameters));
	return priority;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:7,代码来源:BaseRasterLayerBeanFactory.java

示例10: getRasterLayerInfo

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
public RasterLayerInfo getRasterLayerInfo(String layerId) {
	return layerId == null ? null : configurationService.getRasterLayer(layerId).getLayerInfo();
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:4,代码来源:PrintConfigurationServiceImpl.java

示例11: getLayerInfo

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
@Override
public RasterLayerInfo getLayerInfo() {
	return layerInfo;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:5,代码来源:TmsLayer.java

示例12: getLayerInfo

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
@Override
public RasterLayerInfo getLayerInfo() {
	return info;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:5,代码来源:MockProxyLayer.java

示例13: getLayerInfo

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
public RasterLayerInfo getLayerInfo() {
	return layerInfo;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:4,代码来源:TestRasterLayer.java

示例14: setLayerInfo

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
public void setLayerInfo(RasterLayerInfo layerInfo) {
	this.layerInfo = layerInfo;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:4,代码来源:TestRasterLayer.java

示例15: getLayerInfo

import org.geomajas.configuration.RasterLayerInfo; //导入依赖的package包/类
/**
 * Get layer configuration.
 *
 * @return layer configuration
 */
public RasterLayerInfo getLayerInfo() {
	return layerInfo;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:9,代码来源:TiledRasterLayerServiceState.java


注:本文中的org.geomajas.configuration.RasterLayerInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。