本文整理汇总了Java中de.fhpotsdam.unfolding.data.PointFeature.getLocation方法的典型用法代码示例。如果您正苦于以下问题:Java PointFeature.getLocation方法的具体用法?Java PointFeature.getLocation怎么用?Java PointFeature.getLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.fhpotsdam.unfolding.data.PointFeature
的用法示例。
在下文中一共展示了PointFeature.getLocation方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
// 如果需要打印PointFeature中的所有内容,将下一行代码去掉注释
//System.out.println(feature.getProperties());
// 根据给定的PointFeature中的location来创建SimplePointMarker
SimplePointMarker marker = new SimplePointMarker(feature.getLocation());
Object magObj = feature.getProperty("magnitude");
float mag = Float.parseFloat(magObj.toString());
// 下面的示例是使用Procession的color方法来生成代表黄色的整数值
int yellow = color(255, 255, 0);
// TODO : 添加代码,根据地震级别来设计标记的大小和颜色
// 注意在上面定义的2个常量:THRESHOLD_MODERATE和 THRESHOLD_LIGHT
// 可以与这2个值进行比较来确定地震的级别
// 返回marker
return marker;
}
示例2: isInCountry
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的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;
}
示例3: EarthquakeMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的package包/类
public EarthquakeMarker (PointFeature feature)
{
super(feature.getLocation());
// Add a radius property and then set the properties
java.util.HashMap<String, Object> properties = feature.getProperties();
float magnitude = Float.parseFloat(properties.get("magnitude").toString());
properties.put("radius", 2*magnitude );
setProperties(properties);
this.radius = 1.75f*getMagnitude();
}
示例4: isInCountry
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的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;
}
示例5: EarthquakeMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的package包/类
public EarthquakeMarker (PointFeature feature)
{
super(feature.getLocation());
// 添加属性radius,并将其加入properties中
java.util.HashMap<String, Object> properties = feature.getProperties();
float magnitude = Float.parseFloat(properties.get("magnitude").toString());
properties.put("radius", 2*magnitude );
setProperties(properties);
this.radius = 1.75f*getMagnitude();
}
示例6: isInCountry
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的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: isInCountry
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的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;
}
示例8: createMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
int yellow = color(255, 255, 0);
int red = color(255, 0, 0);
int blue = color(0, 0, 255);
SimplePointMarker quake = new SimplePointMarker(feature.getLocation());
Object magObj = feature.getProperty("magnitude");
float mag = Float.parseFloat(magObj.toString());
if (mag < THRESHOLD_LIGHT)
{
quake.setColor(blue);
quake.setRadius(6.0f);
}
else if (mag < THRESHOLD_MODERATE)
{
quake.setColor(yellow);
quake.setRadius(9.0f);
}
else
{
quake.setColor(red);
quake.setRadius(12.0f);
}
return quake;
}
示例9: createMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
// finish implementing and use this method, if it helps.
return new SimplePointMarker(feature.getLocation());
}
示例10: createMarker
import de.fhpotsdam.unfolding.data.PointFeature; //导入方法依赖的package包/类
private SimplePointMarker createMarker(PointFeature feature)
{
// Defining some colors
int red = color(255, 0, 0);
int yellow = color(255, 255, 0);
int blue = color(0, 0, 255);
SimplePointMarker marker = new SimplePointMarker(feature.getLocation());
// Getting different properties of the feature
float magnitude = Float.parseFloat(feature.getProperty("magnitude").toString());
/// Styling the marker according to the feature properties
// Higher magnitude earthquakes will have larger SimplePointMarker
// Setting the radiusIncrement according to the magnitudes
// default 5
float radiusIncrement = 5;
// Changing the color according to the magnitude intensity
// high if >= 5.0
// color = red
if (magnitude >= 5.0){
marker.setColor(red);
radiusIncrement = 10;
}
// moderate if >= 4.0 and < 5.0
// color = yellow
else if (magnitude >= 4.0 && magnitude < 5.0){
marker.setColor(yellow);
// defualt radius increment for moderate
}
// minor if < 4.0
// color = blue
else if (magnitude < 4.0){
marker.setColor(blue);
radiusIncrement = 2;
}
marker.setRadius(radiusIncrement + magnitude);
return marker;
}