当前位置: 首页>>代码示例>>Java>>正文


Java Geo.getLatitude方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:debrief,项目名称:deelite,代码行数:20,代码来源:DebriefDistance.java

示例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);
   }
}
 
开发者ID:d2fn,项目名称:passage,代码行数:19,代码来源:OMDistance.java

示例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");
                }
            }
        }
    }
}
 
开发者ID:d2fn,项目名称:passage,代码行数:69,代码来源:GeoIntersectionLayer.java


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