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


Java EPSG3857类代码示例

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


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

示例1: addRasterMap

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public int addRasterMap(String layerName, String file) throws Exception {
	if (!new File(file).exists()) {
		throw new MapException("File " + file + " does not exist.");
	}
	
	raiseInvalidLayerName(layerName);

	CustomGdalMapLayer gdalLayer = new CustomGdalMapLayer(nextLayerId(),
			layerName, new EPSG3857(), 0, 18, CustomMapView.nextId(), file,
			this, true);
	
	// check if valid raster layer
	gdalLayer.raiseInvalidLayer();
	
	//gdalLayer.setShowAlways(true);
	this.getLayers().addLayer(gdalLayer);
	
	orderLayers();
	
	return addLayer(gdalLayer);
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:22,代码来源:CustomMapView.java

示例2: addShapeLayer

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public int addShapeLayer(String layerName, String file,
		StyleSet<PointStyle> pointStyleSet,
		StyleSet<LineStyle> lineStyleSet,
		StyleSet<PolygonStyle> polygonStyleSet) throws Exception {

	if (!new File(file).exists()) {
		throw new MapException("File " + file + " does not exist.");
	}

	raiseInvalidLayerName(layerName);

	CustomOgrLayer ogrLayer = new CustomOgrLayer(nextLayerId(), layerName,
			new EPSG3857(), file, null, FaimsSettings.DEFAULT_VECTOR_OBJECTS,
			pointStyleSet, lineStyleSet, polygonStyleSet);
	// ogrLayer.printSupportedDrivers();
	// ogrLayer.printLayerDetails(table);
	this.getLayers().addLayer(ogrLayer);
	orderLayers();
	return addLayer(ogrLayer);
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:21,代码来源:CustomMapView.java

示例3: addDatabaseLayer

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public int addDatabaseLayer(String layerName, boolean isEntity, String queryName, String querySql, 
		GeometryStyle pointStyle,
		GeometryStyle lineStyle,
		GeometryStyle polygonStyle,
		GeometryTextStyle textStyle) throws Exception {
	raiseInvalidLayerName(layerName);
	
	DatabaseLayer layer = new DatabaseLayer(nextLayerId(), layerName, new EPSG3857(), this,
			isEntity ? DatabaseLayer.Type.ENTITY : DatabaseLayer.Type.RELATIONSHIP, queryName, querySql,
			FaimsSettings.DEFAULT_VECTOR_OBJECTS, pointStyle, lineStyle, polygonStyle);
	this.getLayers().addLayer(layer);
	
	if (textStyle != null) {
		// add text layer
		DatabaseTextLayer textLayer = new DatabaseTextLayer(new EPSG3857(), layer, textStyle);
		layer.setTextLayer(textLayer);
		this.getLayers().addLayer(textLayer);
	}
	layer.renderOnce();
	
	orderLayers();
	
	return addLayer(layer);
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:25,代码来源:CustomMapView.java

示例4: addDataBaseLayerForTrackLog

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public int addDataBaseLayerForTrackLog(String layerName, Map<User, Boolean> users,
		String queryName, String querySql,
		GeometryStyle pointStyle,
		GeometryStyle lineStyle,
		GeometryStyle polygonStyle,
		GeometryTextStyle textStyle) throws Exception {
	raiseInvalidLayerName(layerName);
	TrackLogDatabaseLayer layer = new TrackLogDatabaseLayer(nextLayerId(), layerName, new EPSG3857(), this,
			DatabaseLayer.Type.GPS_TRACK, queryName, querySql,
			FaimsSettings.DEFAULT_VECTOR_OBJECTS, users, pointStyle, lineStyle, polygonStyle);
	this.getLayers().addLayer(layer);
	
	if (textStyle.toStyleSet() != null) {
		// add text layer
		DatabaseTextLayer textLayer = new DatabaseTextLayer(new EPSG3857(), layer, textStyle);
		layer.setTextLayer(textLayer);
		this.getLayers().addLayer(textLayer);
	}
	layer.renderOnce();
	
	orderLayers();
	
	return addLayer(layer);
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:25,代码来源:CustomMapView.java

示例5: drawLine

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
private void drawLine() {
	if(!(mapView.getSelectedLayer() instanceof CanvasLayer)) {
		showNotCanvasLayerError();
		return;
	}
	
	if (pointsList.size() < 2) {
		showError("Line requires at least 2 points");
		return;
	}
	
	// convert points to map positions
	ArrayList<MapPos> positions = new ArrayList<MapPos>();
	for (Point p : pointsList) {
		positions.add((new EPSG3857().toWgs84(p.getMapPos().x, p.getMapPos().y)));
	}
	
	try {
		mapView.notifyGeometryCreated(mapView.drawLine(mapView.getSelectedLayer(), positions, createLineStyle()));
	} catch (Exception e) {
		FLog.e("error drawing line", e);
		showError(e.getMessage());
	}
	
	clearPoints();
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:27,代码来源:CreateLineTool.java

示例6: drawPolygon

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
private void drawPolygon() {
	if(!(mapView.getSelectedLayer() instanceof CanvasLayer)) {
		showNotCanvasLayerError();
		return;
	}
	
	// convert points to map positions
	ArrayList<MapPos> positions = new ArrayList<MapPos>();
	for (Point p : pointsList) {
		positions.add((new EPSG3857().toWgs84(p.getMapPos().x, p.getMapPos().y)));
	}
	
	try {
		mapView.notifyGeometryCreated(mapView.drawPolygon(mapView.getSelectedLayer(), positions, createPolygonStyle()));
	} catch (Exception e) {
		FLog.e("error drawing polygon", e);
		showError(e.getMessage());
	}
	
	clearPoints();
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:22,代码来源:CreatePolygonTool.java

示例7: addBaseMap

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public int addBaseMap(String layerName, String file) throws Exception {
	if (!new File(file).exists()) {
		throw new MapException("File " + file + " does not exist.");
	}
	
	if (this.getLayers().getBaseLayer() != null) {
		Layer layer = this.getLayers().getBaseLayer();
		removeLayer(layer);
	}

	raiseInvalidLayerName(layerName);

	CustomGdalMapLayer gdalLayer = new CustomGdalMapLayer(nextLayerId(),
			layerName, new EPSG3857(), 0, 18, CustomMapView.nextId(), file,
			this, true);
	
	// check if valid raster layer
	gdalLayer.raiseInvalidLayer();
	
	// center map 
	double[][] boundaries = gdalLayer.getBoundary();
	setMapFocusPoint(((float)boundaries[0][0]+(float)boundaries[3][0])/2, ((float)boundaries[0][1]+(float)boundaries[3][1])/2);		
	
	//gdalLayer.setShowAlways(true);
	this.getLayers().setBaseLayer(gdalLayer);
	
	orderLayers();
	
	return addLayer(gdalLayer);
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:31,代码来源:CustomMapView.java

示例8: setMapFocusPoint

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public void setMapFocusPoint(float longitude, float latitude)
		throws Exception {
	if (latitude < -90.0f || latitude > 90.0f) {
		throw new MapException("Latitude out of range "
				+ latitude);
	}
	this.setFocusPoint(new EPSG3857().fromWgs84(longitude, latitude));
	refreshMap();
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:10,代码来源:CustomMapView.java

示例9: addCanvasLayer

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public int addCanvasLayer(String layerName) throws Exception {
	raiseInvalidLayerName(layerName);

	CanvasLayer layer = new CanvasLayer(nextLayerId(), layerName,
			new EPSG3857());
	this.getLayers().addLayer(layer);
	orderLayers();
	return addLayer(layer);
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:10,代码来源:CustomMapView.java

示例10: onMapClicked

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
@Override
public void onMapClicked(double x, double y, boolean z) {
	if(!(mapView.getSelectedLayer() instanceof CanvasLayer)) {
		showNotCanvasLayerError();
		return;
	}
	
	// make point color solid
	try {
		pointsList.add(mapView.drawPoint(mapView.getVertexLayerId(), (new EPSG3857()).toWgs84(x, y), createGuidePointStyle()));
	} catch (Exception e) {
		FLog.e("error drawing point", e);
		showError(e.getMessage());
	}
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:16,代码来源:CreateLineTool.java

示例11: onMapClicked

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
@Override
public void onMapClicked(double x, double y, boolean z) {
	if(!(mapView.getSelectedLayer() instanceof CanvasLayer)) {
		showNotCanvasLayerError();
		return;
	}
	
	try {
		mapView.notifyGeometryCreated(mapView.drawPoint(mapView.getSelectedLayer(), (new EPSG3857()).toWgs84(x, y), createPointStyle()));
	} catch (Exception e) {
		FLog.e("error drawing point", e);
		showError(e.getMessage());
	}
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:15,代码来源:CreatePointTool.java

示例12: onMapClicked

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
@Override
public void onMapClicked(double x, double y, boolean z) {
	if(!(mapView.getSelectedLayer() instanceof CanvasLayer)) {
		showNotCanvasLayerError();
		return;
	}
	
	try {
		pointsList.add(mapView.drawPoint(mapView.getVertexLayerId(), (new EPSG3857()).toWgs84(x, y), createGuidePointStyle()));
	} catch (Exception e) {
		FLog.e("error drawing point", e);
	}
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:14,代码来源:CreatePolygonTool.java

示例13: addSpatialLayer

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public int addSpatialLayer(String layerName, String file, String tablename,
		String idColumn, String labelColumn, GeometryStyle pointStyle,
		GeometryStyle lineStyle,
		GeometryStyle polygonStyle,
		GeometryTextStyle textStyle) throws Exception {
	if (!new File(file).exists()) {
		throw new MapException("File " + file + " does not exist.");
	}

	raiseInvalidLayerName(layerName);
	
	if (idColumn == null || "".equals(idColumn)) {
		throw new MapException("Invalid id column");
	}
	
	if (labelColumn == null || "".equals(labelColumn)) {
		throw new MapException("Invalid label column");
	}
	
	String[] labelColumns = new String[] { idColumn, labelColumn };
	
	CustomSpatialiteLayer spatialLayer = new CustomSpatialiteLayer(
			nextLayerId(), layerName, new EPSG3857(), this, file, tablename,
			"Geometry", labelColumns,
			FaimsSettings.DEFAULT_VECTOR_OBJECTS, pointStyle, lineStyle,
			polygonStyle);
	
	// throws exception if not valid
	spatialLayer.raiseInvalidLayer();
	
	this.getLayers().addLayer(spatialLayer);
	
	if (textStyle != null) {
		// add text layer
		SpatialiteTextLayer textLayer = new SpatialiteTextLayer(new EPSG3857(), spatialLayer, labelColumns, textStyle);
		spatialLayer.setTextLayer(textLayer);
		this.getLayers().addLayer(textLayer);
	}
	spatialLayer.renderOnce();
	
	orderLayers();
	
	return addLayer(spatialLayer);
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:45,代码来源:CustomMapView.java

示例14: convertFromWgs84

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public static MapPos convertFromWgs84(MapPos p) {
	return (new EPSG3857()).fromWgs84(p.x, p.y);
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:4,代码来源:GeometryUtil.java

示例15: convertToWgs84

import com.nutiteq.projections.EPSG3857; //导入依赖的package包/类
public static MapPos convertToWgs84(MapPos p) {
	return (new EPSG3857()).toWgs84(p.x, p.y);
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:4,代码来源:GeometryUtil.java


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