Revision 41051 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/ViewPort.java
ViewPort.java | ||
---|---|---|
693 | 693 |
* @see GeoCalcImpl#distanceVincenty(Point2D, Point2D) |
694 | 694 |
*/ |
695 | 695 |
public double distanceWorld(Point2D pt1, Point2D pt2) { |
696 |
double dist = -1; |
|
697 |
dist = pt1.distance(pt2);
|
|
698 |
|
|
699 |
if ((proj != null) && !(proj instanceof UTM)) {
|
|
700 |
dist = |
|
701 |
new GeoCalc(proj).distanceVincenty(proj.toGeo(pt1),
|
|
702 |
proj.toGeo(pt2));
|
|
703 |
return dist;
|
|
696 |
|
|
697 |
double dist = 0;
|
|
698 |
if (proj.isProjected()) { |
|
699 |
dist = pt1.distance(pt2);
|
|
700 |
dist = dist * MapContext.getDistanceTrans2Meter()[getMapUnits()];
|
|
701 |
} else {
|
|
702 |
GeoCalc geocalc = new GeoCalc(proj);
|
|
703 |
dist = geocalc.distanceVincenty(pt1, pt2);
|
|
704 | 704 |
} |
705 |
return (dist * MapContext.getDistanceTrans2Meter()[getMapUnits()]);
|
|
705 |
return dist;
|
|
706 | 706 |
} |
707 | 707 |
|
708 | 708 |
/** |
Also available in: Unified diff