本文整理汇总了Java中com.graphhopper.util.shapes.GHPoint.getLon方法的典型用法代码示例。如果您正苦于以下问题:Java GHPoint.getLon方法的具体用法?Java GHPoint.getLon怎么用?Java GHPoint.getLon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.graphhopper.util.shapes.GHPoint
的用法示例。
在下文中一共展示了GHPoint.getLon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIntermediateLoc
import com.graphhopper.util.shapes.GHPoint; //导入方法依赖的package包/类
private Location getIntermediateLoc(GHPoint loc1, GHPoint loc2, double length, double i) {
double lon = (loc2.getLon() - loc1.getLon())*i/length + loc1.getLon();
double lat = (loc2.getLat() - loc1.getLat())*i/length + loc1.getLat();
return new Location(lon,lat);
}
示例2: getIntermediateLoc
import com.graphhopper.util.shapes.GHPoint; //导入方法依赖的package包/类
public static Location getIntermediateLoc(GHPoint loc1, GHPoint loc2, double length, double i) {
double lon = (loc2.getLon() - loc1.getLon()) * i / length + loc1.getLon();
double lat = (loc2.getLat() - loc1.getLat()) * i / length + loc1.getLat();
return new Location(lon, lat);
}
示例3: withinBoundingBox
import com.graphhopper.util.shapes.GHPoint; //导入方法依赖的package包/类
/**
* Checks if {@code point} is within the bounding box {@code bbox}.
*
* @param point
* @param bbox
* @return true, if {@code point} is within the bounding box (exclusive)
*/
public static boolean withinBoundingBox(GHPoint point, Bound bbox) {
double lat = point.getLat();
double lon = point.getLon();
return lat > bbox.getBottom() && lat < bbox.getTop()
&& lon > bbox.getLeft() && lon < bbox.getBottom();
}