• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Location类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: markBehaviorStartEnd

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
private void markBehaviorStartEnd() {
	toolTipMarkers = new ArrayList<ToolTipMarker>();
	for (int i = 0; i < driverBehaviorDetails.size(); i++) {
		DriverBehaviorDetail behavior = driverBehaviorDetails.get(i);
		
		List<ContextFeature> contextFeatures = behavior.contextFeatures;
		String contextFeaturesString = "";
		for (int j = 0; j < contextFeatures.size(); j++) {
			contextFeaturesString += contextFeatures.get(j) + "\n";
		}
		
		Location startLocation = new Location(behavior.startLatitude, behavior.startLongitude);
		ToolTipMarker startToolTipMarker = new ToolTipMarker(
				startLocation,
				contextFeaturesString + behavior.behaviorName + " start: " + friendly(behavior.startTime));		
		map.addMarker(startToolTipMarker);
		toolTipMarkers.add(startToolTipMarker);
		
		Location endLocation = new Location(behavior.endLatitude, behavior.endLongitude);
		ToolTipMarker endToolTipMarker = new ToolTipMarker(
				endLocation,
				contextFeaturesString + behavior.behaviorName + " end: " + friendly(behavior.endTime));		
		toolTipMarkers.add(endToolTipMarker);
		map.addMarker(endToolTipMarker);
	}		
}
 
开发者ID:IBM-Cloud,项目名称:map-driver-insights,代码行数:27,代码来源:MapView.java


示例2: draw

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public void draw() {
	background(0);
	this.frame.setTitle("Wuxi GSM");
	this.frame.setIconImage(icon);
	map.draw();
	
	if (loadCnt > 0) {
		fill(255);
		rect(0, 0, width, height);
		shape(phoneLogo, width / 2 - 0.559f * height / 8f, height / 2 - height
				/ 8f, 0.559f * height / 4f, height / 4f);
		loadCnt--;
	} else {
		if (locList != null) {
			System.out.println(locList.size());
			for (Location loc : locList) {
				randomDraw(loc);
			}
		} else {
			System.out.println("Location List is null!");
		}
	}
}
 
开发者ID:Pangm,项目名称:WuxiGsm,代码行数:24,代码来源:WuxiGsm.java


示例3: loadData

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
private void loadData(List<Location> list, String filename) {
	BufferedReader reader = createReader(filename);

	for (int i = 0; i < 1600; i += 5) {
		String line;
		try {
			line = reader.readLine();
			while (line != null) {
				String[] pieces = split(line, ',');
				float x = Float.parseFloat(pieces[0]);
				float y = Float.parseFloat(pieces[1]);
				Location loc = new Location(y, x);
				list.add(loc);
				// System.out.println("Location " + x + ", " + y);
				line = reader.readLine();
			}
			// System.out.println(line);
		} catch (IOException e) {
			e.printStackTrace();
			line = null;
		}
	}
}
 
开发者ID:Pangm,项目名称:BeijingBus,代码行数:24,代码来源:BeijingBus.java


示例4: isInCountry

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
private boolean isInCountry(PointFeature earthquake, Marker country) {
	// 获取地点
	Location checkLoc = earthquake.getLocation();

	// some countries represented it as MultiMarker
	// looping over SimplePolygonMarkers which make them up to use isInsideByLoc
	if (country.getClass() == MultiMarker.class) {

		// looping over markers making up MultiMarker
		for (Marker marker : ((MultiMarker) country).getMarkers()) {

			// checking if inside
			if (((AbstractShapeMarker) marker).isInsideByLocation(checkLoc)) {
				earthquake.addProperty("country", country.getProperty("name"));

				// return if is inside one
				return true;
			}
		}
	}

	// check if inside country represented by SimplePolygonMarker
	else if (((AbstractShapeMarker) country).isInsideByLocation(checkLoc)) {
		earthquake.addProperty("country", country.getProperty("name"));

		return true;
	}
	return false;
}
 
开发者ID:simontangbit,项目名称:CourseCode,代码行数:30,代码来源:EarthquakeCityMap.java


示例5: isInCountry

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean isInCountry(PointFeature earthquake, Marker country) {
	// 获取地点
	Location checkLoc = earthquake.getLocation();

	// some countries represented it as MultiMarker
	// looping over SimplePolygonMarkers which make them up to use isInsideByLoc
	if(country.getClass() == MultiMarker.class) {
			
		// looping over markers making up MultiMarker
		for(Marker marker : ((MultiMarker)country).getMarkers()) {
				
			// checking if inside
			if(((AbstractShapeMarker)marker).isInsideByLocation(checkLoc)) {
				earthquake.addProperty("country", country.getProperty("name"));
					
				// return if is inside one
				return true;
			}
		}
	}
		
	// check if inside country represented by SimplePolygonMarker
	else if(((AbstractShapeMarker)country).isInsideByLocation(checkLoc)) {
		earthquake.addProperty("country", country.getProperty("name"));
		
		return true;
	}
	return false;
}
 
开发者ID:simontangbit,项目名称:CourseCode,代码行数:31,代码来源:EarthquakeCityMap.java


示例6: isInCountry

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
private boolean isInCountry(PointFeature earthquake, Marker country) {
	// getting location of feature
	Location checkLoc = earthquake.getLocation();

	// some countries represented it as MultiMarker
	// looping over SimplePolygonMarkers which make them up to use
	// isInsideByLoc
	if (country.getClass() == MultiMarker.class) {

		// looping over markers making up MultiMarker
		for (Marker marker : ((MultiMarker) country).getMarkers()) {

			// checking if inside
			if (((AbstractShapeMarker) marker).isInsideByLocation(checkLoc)) {
				earthquake.addProperty("country",
						country.getProperty("name"));

				// return if is inside one
				return true;
			}
		}
	}

	// check if inside country represented by SimplePolygonMarker
	else if (((AbstractShapeMarker) country).isInsideByLocation(checkLoc)) {
		earthquake.addProperty("country", country.getProperty("name"));

		return true;
	}
	return false;
}
 
开发者ID:snavjivan,项目名称:Earthquake-Tracker,代码行数:32,代码来源:EarthquakeCityMap.java


示例7: setup

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public void setup() {
	size(800, 600, OPENGL);

	map = new UnfoldingMap(this, new Google.GoogleTerrainProvider());
	map.zoomAndPanTo(14, new Location(32.881, -117.238)); // UCSD

	MapUtils.createDefaultEventDispatcher(this, map);
}
 
开发者ID:snavjivan,项目名称:Earthquake-Tracker,代码行数:9,代码来源:HelloUCSDWorld.java


示例8: isInCountry

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
private boolean isInCountry(PointFeature earthquake, Marker country) {
	// getting location of feature
	Location checkLoc = earthquake.getLocation();

	// some countries represented it as MultiMarker
	// looping over SimplePolygonMarkers which make them up to use isInsideByLoc
	if(country.getClass() == MultiMarker.class) {
			
		// looping over markers making up MultiMarker
		for(Marker marker : ((MultiMarker)country).getMarkers()) {
				
			// checking if inside
			if(((AbstractShapeMarker)marker).isInsideByLocation(checkLoc)) {
				earthquake.addProperty("country", country.getProperty("name"));
					
				// return if is inside one
				return true;
			}
		}
	}
		
	// check if inside country represented by SimplePolygonMarker
	else if(((AbstractShapeMarker)country).isInsideByLocation(checkLoc)) {
		earthquake.addProperty("country", country.getProperty("name"));
		
		return true;
	}
	return false;
}
 
开发者ID:imranalidigi,项目名称:UCSDUnfoldingMapsMaven,代码行数:30,代码来源:EarthquakeCityMap.java


示例9: setup

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public void setup() {
	size(WIDTH, HEIGHT, P3D);
	map = new UnfoldingMap(this, new OpenStreetMapProvider());		
	DriverBehaviorDetail first = driverBehaviorDetails.get(0);		
	map.zoomAndPanTo(14, new Location(first.startLatitude, first.startLongitude));	
	MapUtils.createDefaultEventDispatcher(this, map);
	
	traceTrip();
	traceBehavior();
	markBehaviorStartEnd();
}
 
开发者ID:IBM-Cloud,项目名称:map-driver-insights,代码行数:12,代码来源:MapView.java


示例10: traceTrip

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
private void traceTrip() {
    ShapeFeature tripFeature = new ShapeFeature(FeatureType.LINES);
	for (CarProbe carProbe: carProbes) {
		Location location = new Location(carProbe.latitude, carProbe.longitude);
		tripFeature.addLocation(location);
	}
	SimpleLinesMarker tripMarker = new SimpleLinesMarker(tripFeature.getLocations());
    tripMarker.setColor(color(255, 64, 64, 200));
    tripMarker.setStrokeWeight(5);
    map.addMarker(tripMarker);		
}
 
开发者ID:IBM-Cloud,项目名称:map-driver-insights,代码行数:12,代码来源:MapView.java


示例11: traceBehavior

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
private void traceBehavior() {
	for (int i = 0; i < driverBehaviorDetails.size(); i++) {
		ShapeFeature behaviorFeature = new ShapeFeature(FeatureType.LINES);
		DriverBehaviorDetail behavior = driverBehaviorDetails.get(i);
		Location startLocation = new Location(behavior.startLatitude, behavior.startLongitude);
		behaviorFeature.addLocation(startLocation);
		Location endLocation = new Location(behavior.endLatitude, behavior.endLongitude);
		behaviorFeature.addLocation(endLocation);
		SimpleLinesMarker behaviorMarker = new SimpleLinesMarker(behaviorFeature.getLocations());
	    behaviorMarker.setColor(color(128, 255, 128, 200));
	    behaviorMarker.setStrokeWeight(5);
	    map.addMarker(behaviorMarker);
	}		
}
 
开发者ID:IBM-Cloud,项目名称:map-driver-insights,代码行数:15,代码来源:MapView.java


示例12: Device

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public Device(PApplet context, UnfoldingMap map, int initZoomLevel, String id, List<Location> pathLocs, List<Device> devices) {
	this.context = context;
	this.map = map;
	this.initZoomLevel = initZoomLevel;
	this.id = id;
	this.pathLocs = pathLocs;
	this.devices = devices;
	if (!pathLocs.isEmpty()) {
		index = 0;
	}
	previousPoss = new ArrayList<ScreenPosition>();
	update();
	update();
}
 
开发者ID:Pangm,项目名称:WuxiGsm,代码行数:15,代码来源:Device.java


示例13: getCurrentLoc

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public Location getCurrentLoc() {
	if (index >= 0 && index <= pathLocs.size()) {
		return pathLocs.get(index);
	} else {
		return null;
	}
}
 
开发者ID:Pangm,项目名称:WuxiGsm,代码行数:8,代码来源:Device.java


示例14: getLocations

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public ArrayList<Location> getLocations(GsmResponse r) {
	ArrayList<Location> list = new ArrayList<Location>();
	
	for(PhoneRecordDAO dao : r.getList()) {
		System.out.println(dao.getTime());
		Location loc = map.get(dao.getAreaID() + dao.getCellID());
		if (loc != null) {
			list.add(loc);
		}
	}
	
	return list;
}
 
开发者ID:Pangm,项目名称:WuxiGsm,代码行数:14,代码来源:BaseStationTransform.java


示例15: randomDraw

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
private void randomDraw(Location loc) {
	ScreenPosition pos = map.getScreenPosition(loc);
	noStroke();
	fill(255, 255, 0, 20);
	ellipse(pos.x+ random(0, 5), pos.y + random(0, 5), 2, 2);
	System.out.println(loc.x + ", " + loc.y);
}
 
开发者ID:Pangm,项目名称:WuxiGsm,代码行数:8,代码来源:WuxiGsm.java


示例16: Bus

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public Bus(PApplet context, UnfoldingMap map, int initZoomLevel, String name, List<Location> pathLocs, List<Bus> buses) {
	this.context = context;
	this.map = map;
	this.initZoomLevel = initZoomLevel;
	this.name = name;
	this.pathLocs = pathLocs;
	this.buses = buses;
	if (!pathLocs.isEmpty()) {
		index = 0;
	}
	previousPoss = new ArrayList<ScreenPosition>();
	update();
	update();
}
 
开发者ID:Pangm,项目名称:BeijingBus,代码行数:15,代码来源:Bus.java


示例17: initBuses

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
private void initBuses(List<Bus> buses, String filePath) {
	try {
		File file = new File(filePath);
		if (file.isDirectory()) {
			System.out.println(file.getAbsolutePath());
			String[] filelist = file.list();
			for (int i = 0; i < filelist.length; i++) {
				File readfile = new File(filePath + "/" + filelist[i]);
				if (!readfile.isDirectory()) {
					String name = readfile.getName();
					System.out.println("path=" + readfile.getPath());
					System.out.println("absolutepath="
							+ readfile.getAbsolutePath());
					System.out.println("name=" + name);

					pathLocs = new ArrayList<Location>();
					loadData(pathLocs, readfile.getPath());
					buses.add(new Bus(this, map, initZoomLevel, name
							.substring(0, name.indexOf('.')), pathLocs,
							buses));
					String lineNum = name.substring(name.indexOf('-'),
							name.indexOf('.'));
					if (!lineNums.contains(lineNum)) {
						lineNums.add(lineNum);
					}
				} else {
					// readfile(filePath + "/" + filelist[i]);
				}
			}
		}
	} catch (Exception e) {
		System.out.println("readfile()   Exception:" + e.getMessage());
	}
}
 
开发者ID:Pangm,项目名称:BeijingBus,代码行数:35,代码来源:BeijingBus.java


示例18: CommonMarker

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public CommonMarker(Location location) {
	super(location);
}
 
开发者ID:simontangbit,项目名称:CourseCode,代码行数:4,代码来源:CommonMarker.java


示例19: CityMarker

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public CityMarker(Location location) {
	super(location);
}
 
开发者ID:simontangbit,项目名称:CourseCode,代码行数:4,代码来源:CityMarker.java


示例20: parseAirports

import de.fhpotsdam.unfolding.geo.Location; //导入依赖的package包/类
public static List<PointFeature> parseAirports(PApplet p, String fileName) {
	List<PointFeature> features = new ArrayList<PointFeature>();

	String[] rows = p.loadStrings(fileName);
	for (String row : rows) {
		
		// hot-fix for altitude when lat lon out of place
		int i = 0;
		
		// split row by commas not in quotations
		String[] columns = row.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
		
		// get location and create feature
		//System.out.println(columns[6]);
		float lat = Float.parseFloat(columns[6]);
		float lon = Float.parseFloat(columns[7]);
		
		Location loc = new Location(lat, lon);
		PointFeature point = new PointFeature(loc);
		
		// set ID to OpenFlights unique identifier
		point.setId(columns[0]);
		
		// get other fields from csv
		point.addProperty("name", columns[1]);
		point.putProperty("city", columns[2]);
		point.putProperty("country", columns[3]);
		
		// pretty sure IATA/FAA is used in routes.dat
		// get airport IATA/FAA code
		if(!columns[4].equals("")) {
			point.putProperty("code", columns[4]);
		}
		// get airport ICAO code if no IATA
		else if(!columns[5].equals("")) {
			point.putProperty("code", columns[5]);
		}
		
		point.putProperty("altitude", columns[8 + i]);
		
		features.add(point);
	}

	return features;
	
}
 
开发者ID:simontangbit,项目名称:CourseCode,代码行数:47,代码来源:ParseFeed.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NotNullProducer类代码示例发布时间:2022-05-22
下一篇:
Java XMLOutputFactory2类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap