本文整理汇总了Java中de.fhpotsdam.unfolding.geo.Location类的典型用法代码示例。如果您正苦于以下问题:Java Location类的具体用法?Java Location怎么用?Java Location使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Location类属于de.fhpotsdam.unfolding.geo包,在下文中一共展示了Location类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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!");
}
}
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
}
示例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();
}
示例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;
}
}
示例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;
}
示例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);
}