//--------------------------------------------------------------------- /// <summary> /// Returns a /// </summary> /// <param name="bottomLeft"> /// </param> /// <param name="topRight"> /// </param> /// <param name="precision"> /// </param> /// <returns></returns> //--------------------------------------------------------------------- public Dem getSelection(Point bottomLeft, Point topRight, Dem.Precision precision) { if (bottomLeft.getLatitude() > topRight.getLatitude()) { if (bottomLeft.getLongitude() > topRight.getLongitude()) { Point aux = bottomLeft; bottomLeft = topRight; topRight = aux; } else { WgsPoint aux = bottomLeft.toWgs(); WgsPoint aux2 = topRight.toWgs(); bottomLeft = new WgsPoint(aux2.getLatitude(), aux.getLongitude(), aux.getAltitude()); topRight = new WgsPoint(aux.getLatitude(), aux2.getLongitude(), aux2.getAltitude()); } } else { if (bottomLeft.getLongitude() > topRight.getLongitude()) { WgsPoint aux = bottomLeft.toWgs(); WgsPoint aux2 = topRight.toWgs(); bottomLeft = new WgsPoint(aux.getLatitude(), aux2.getLongitude(), aux.getAltitude()); topRight = new WgsPoint(aux2.getLatitude(), aux.getLongitude(), aux2.getAltitude()); } } Dem dem = this.addDem(bottomLeft, topRight, precision); return(dem.getSelection(bottomLeft, topRight)); }