本文整理汇总了Java中com.bbn.openmap.geo.Geo.getLatitude方法的典型用法代码示例。如果您正苦于以下问题:Java Geo.getLatitude方法的具体用法?Java Geo.getLatitude怎么用?Java Geo.getLatitude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.bbn.openmap.geo.Geo
的用法示例。
在下文中一共展示了Geo.getLatitude方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDist
import com.bbn.openmap.geo.Geo; //导入方法依赖的package包/类
/**
* Return the distance between that lat/lons defined in radians. The
* returned value is in radians.
*/
public float getDist(Geo g1, Geo g2) {
switch (getLineType()) {
case LINETYPE_STRAIGHT:
float lonDist = ProjMath.lonDistance((float) g2.getLongitude(),
(float) g1.getLongitude());
float latDist = (float) g2.getLatitude() - (float) g1.getLatitude();
return (float) Math.sqrt(lonDist * lonDist + latDist * latDist);
case LINETYPE_RHUMB:
Debug.error("Rhumb distance calculation not implemented.");
case LINETYPE_GREATCIRCLE:
case LINETYPE_UNKNOWN:
default:
return (float) g1.distance(g2);
}
}
示例2: getDist
import com.bbn.openmap.geo.Geo; //导入方法依赖的package包/类
/**
* Return the distance between that lat/lons defined in radians. The returned
* value is in radians.
*/
public float getDist(Geo g1, Geo g2) {
switch (getLineType()) {
case LINETYPE_STRAIGHT:
float lonDist = ProjMath.lonDistance((float) g2.getLongitude(), (float) g1.getLongitude());
float latDist = (float) g2.getLatitude() - (float) g1.getLatitude();
return (float) Math.sqrt(lonDist * lonDist + latDist * latDist);
case LINETYPE_RHUMB:
Debug.error("Rhumb distance calculation not implemented.");
case LINETYPE_GREATCIRCLE:
case LINETYPE_UNKNOWN:
default:
return (float) g1.distance(g2);
}
}
示例3: calculateIntersectionsWithDrawnList
import com.bbn.openmap.geo.Geo; //导入方法依赖的package包/类
public void calculateIntersectionsWithDrawnList() {
intersectionResultList.clear();
ExtentIndex rIndex = getRegionIndex(true);
for (OMGraphic omg : drawnList) {
if (omg instanceof OMLine || (omg instanceof OMPoly && !((OMPoly) omg).isPolygon())) {
if (DEBUG) {
Debug.output("GeoIntersectLayer(" + getName()
+ "): Checking line against RegionIndex");
}
GeoPath path = getPathFromOMGraphic(omg);
Iterator intrsctns = null;
Iterator crssngs = null;
if (showCrossingPoints) {
BoundaryCrossing.Collector results = BoundaryCrossing.getCrossings(path, rIndex);
intrsctns = results.iterator();
crssngs = results.getCrossings();
} else {
intrsctns = Intersection.intersect(path, rIndex);
}
while (intrsctns.hasNext()) {
OMPolyRegion ompr = (OMPolyRegion) intrsctns.next();
setRegionAsSelected(ompr);
if (DEBUG) {
Debug.output("GeoIntersectLayer(" + getName() + "): Set Poly for hit");
}
}
int num = 0;
while (crssngs != null && crssngs.hasNext()) {
BoundaryCrossing bc = (BoundaryCrossing) crssngs.next();
Geo geo = bc.getGeo();
OMPoint pgeo = new OMPoint((float) geo.getLatitude(), (float) geo.getLongitude());
pgeo.setFillPaint(Color.WHITE);
pgeo.putAttribute(OMGraphic.LABEL, new OMTextLabeler(Integer.toString(num++)));
intersectionResultList.add(pgeo);
}
} else if (omg instanceof OMPoly) {
for (Iterator hits = Intersection.intersect(new OMPolyRegion((OMPoly) omg), rIndex); hits.hasNext();) {
setRegionAsSelected((OMPolyRegion) hits.next());
if (DEBUG) {
Debug.output("GeoIntersectLayer(" + getName() + "): Set Poly for hit");
}
}
} else if (omg instanceof OMPoint) {
OMPoint omp = (OMPoint) omg;
for (Iterator hits = Intersection.intersect(new GeoPoint.Impl(omp.getLat(), omp.getLon()), rIndex); hits.hasNext();) {
setRegionAsSelected((OMPolyRegion) hits.next());
if (DEBUG) {
Debug.output("GeoIntersectLayer(" + getName() + "): Set Poly for hit");
}
}
}
}
}