/** * return height of bounding box, always between 0 and 180 degrees. * * @return height of bounding box in degrees latitude */ public double getHeight() { return getLatMax() - getLatMin(); }
/** * return height of bounding box, always between 0 and 180 degrees. * * @return height of bounding box in degrees latitude */ public double getHeight() { return getLatMax() - getLatMin(); }
/** * return height of bounding box, always between 0 and 180 degrees. * * @return height of bounding box in degrees latitude */ public double getHeight() { return getLatMax() - getLatMin(); }
/** * return height of bounding box, always between 0 and 180 degrees. * * @return height of bounding box in degrees latitude */ public double getHeight() { return getLatMax() - getLatMin(); }
/** * Return a String representation of this object. * <pre>lat= [-90.00,90.00] lon= [0.00,360.00</pre> * * @return a String representation of this object. */ public String toString2() { return " lat= [" + Format.dfrac(getLatMin(), 2) + "," + Format.dfrac(getLatMax(), 2) + "] lon= [" + Format.dfrac(getLonMin(), 2) + "," + Format.dfrac(getLonMax(), 2) + "]"; }
/** * Return a String representation of this object. * <pre>lat= [-90.00,90.00] lon= [0.00,360.00</pre> * * @return a String representation of this object. */ public String toString2() { return " lat= [" + Format.dfrac(getLatMin(), 2) + "," + Format.dfrac(getLatMax(), 2) + "] lon= [" + Format.dfrac(getLonMin(), 2) + "," + Format.dfrac(getLonMax(), 2) + "]"; }
/** * Return a String representation of this object. * <pre>lat= [-90.00,90.00] lon= [0.00,360.00</pre> * * @return a String representation of this object. */ public String toString2() { return " lat= [" + Format.dfrac(getLatMin(), 2) + "," + Format.dfrac(getLatMax(), 2) + "] lon= [" + Format.dfrac(getLonMin(), 2) + "," + Format.dfrac(getLonMax(), 2) + "]"; }
/** * Return a String representation of this object. * <pre>lat= [-90.00,90.00] lon= [0.00,360.00</pre> * * @return a String representation of this object. */ public String toString2() { return " lat= [" + Format.dfrac(getLatMin(), 2) + "," + Format.dfrac(getLatMax(), 2) + "] lon= [" + Format.dfrac(getLonMin(), 2) + "," + Format.dfrac(getLonMax(), 2) + "]"; } }
private Element writeBoundingBox(LatLonRect bb) { Element bbElem = new Element("LatLonBox"); bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMin(), 4))); bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMax(), 4))); bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMin(), 4))); bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMax(), 4))); return bbElem; }
private Element writeBoundingBox(LatLonRect bb) { Element bbElem = new Element("LatLonBox"); bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMin(), 4))); bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMax(), 4))); bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMin(), 4))); bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMax(), 4))); return bbElem; }
private Element writeBoundingBox(LatLonRect bb) { Element bbElem = new Element("LatLonBox"); // from KML bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMin(), 6))); bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMax(), 6))); bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMin(), 6))); bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMax(), 6))); return bbElem; }
private Element writeBoundingBox(LatLonRect bb) { Element bbElem = new Element("LatLonBox"); bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMin(), 4))); bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMax(), 4))); bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMin(), 4))); bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMax(), 4))); return bbElem; }
private Element writeBoundingBox(LatLonRect bb) { Element bbElem = new Element("LatLonBox"); // from KML bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMin(), 6))); bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMax(), 6))); bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMin(), 6))); bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMax(), 6))); return bbElem; }
private Element writeBoundingBox(LatLonRect bb) { Element bbElem = new Element("LatLonBox"); //LatLonPoint llpt = bb.getLowerLeftPoint(); //LatLonPoint urpt = bb.getUpperRightPoint(); //bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(llpt.getLongitude(), 4))); bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMin() , 4))); //bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(urpt.getLongitude(), 4))); bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMax(), 4))); //bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(llpt.getLatitude(), 4))); bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMin(), 4))); //bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(urpt.getLatitude(), 4))); bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMax(), 4))); return bbElem; }
private Element writeBoundingBox(LatLonRect bb) { Element bbElem = new Element("LatLonBox"); //LatLonPoint llpt = bb.getLowerLeftPoint(); //LatLonPoint urpt = bb.getUpperRightPoint(); //bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(llpt.getLongitude(), 4))); bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMin() , 4))); //bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(urpt.getLongitude(), 4))); bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMax(), 4))); //bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(llpt.getLatitude(), 4))); bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMin(), 4))); //bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(urpt.getLatitude(), 4))); bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMax(), 4))); return bbElem; }
private Element writeBoundingBox(LatLonRect bb) { Element bbElem = new Element("LatLonBox"); //LatLonPoint llpt = bb.getLowerLeftPoint(); //LatLonPoint urpt = bb.getUpperRightPoint(); //bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(llpt.getLongitude(), 4))); bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMin(), 4))); //bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(urpt.getLongitude(), 4))); bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMax(), 4))); //bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(llpt.getLatitude(), 4))); bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMin(), 4))); //bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(urpt.getLatitude(), 4))); bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMax(), 4))); return bbElem; }
private Element writeBoundingBox(LatLonRect bb) { Element bbElem = new Element("LatLonBox"); LatLonPoint llpt = bb.getLowerLeftPoint(); LatLonPoint urpt = bb.getUpperRightPoint(); //bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(llpt.getLongitude(), 4))); bbElem.addContent(new Element("west").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMin() , 4))); //bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(urpt.getLongitude(), 4))); bbElem.addContent(new Element("east").addContent(ucar.unidata.util.Format.dfrac(bb.getLonMax(), 4))); //bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(llpt.getLatitude(), 4))); bbElem.addContent(new Element("south").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMin(), 4))); //bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(urpt.getLatitude(), 4))); bbElem.addContent(new Element("north").addContent(ucar.unidata.util.Format.dfrac(bb.getLatMax(), 4))); return bbElem; }
@Test public void projToLatLonBB_everything() { // The bounding box includes the entire map. ProjectionPoint lowerLeft = new ProjectionPointImpl(-30000, -30000); ProjectionPoint upperRight = new ProjectionPointImpl(30000, 30000); Sinusoidal proj = new Sinusoidal(); ProjectionRect projBB = new ProjectionRect(lowerLeft, upperRight); LatLonRect latLonBB = proj.projToLatLonBB(projBB); Assert.assertEquals(-180.0, latLonBB.getLonMin(), 0.1); Assert.assertEquals(180.0, latLonBB.getLonMax(), 0.1); Assert.assertEquals(-90.0, latLonBB.getLatMin(), 0.1); Assert.assertEquals(90.0, latLonBB.getLatMax(), 0.1); } }
@Test public void projToLatLonBB_onlyintersects() { // Same bounding box as projToLatLonBB_partiallyValidTop(), but the left and right sides have been // extended completely off the map. None of its corners are on the map, but it intersects the edge at 4 places. ProjectionPoint lowerLeft = new ProjectionPointImpl(-13000, 8342); ProjectionPoint upperRight = new ProjectionPointImpl(15000, 9451); Sinusoidal proj = new Sinusoidal(); ProjectionRect projBB = new ProjectionRect(lowerLeft, upperRight); LatLonRect latLonBB = proj.projToLatLonBB(projBB); Assert.assertEquals(-180.0, latLonBB.getLonMin(), 0.1); Assert.assertEquals(180.0, latLonBB.getLonMax(), 0.1); Assert.assertEquals(75.0, latLonBB.getLatMin(), 0.1); Assert.assertEquals(85.0, latLonBB.getLatMax(), 0.1); }
@Test public void projToLatLonBB_includesNorthPole() { // Same bouding box as projToLatLonBB_partiallyValidTop(), but the top was extended past 90°N. // It intersects the map edge at 2 places and includes the north pole. ProjectionPoint lowerLeft = new ProjectionPointImpl(-4166, 8342); ProjectionPoint upperRight = new ProjectionPointImpl(4021, 11111); Sinusoidal proj = new Sinusoidal(); ProjectionRect projBB = new ProjectionRect(lowerLeft, upperRight); LatLonRect latLonBB = proj.projToLatLonBB(projBB); Assert.assertEquals(-180.0, latLonBB.getLonMin(), 0.1); Assert.assertEquals(180.0, latLonBB.getLonMax(), 0.1); Assert.assertEquals(75.0, latLonBB.getLatMin(), 0.1); Assert.assertEquals(90.0, latLonBB.getLatMax(), 0.1); }