Examples of LatLonRect


Examples of org.apache.sis.core.LatLonRect

      String urLat = request.getParameter("urLat");
      String urLon = request.getParameter("urLon");

      if (llLat != null && llLon != null && urLat != null && urLon != null) {
        try {
          LatLonRect bbox = new LatLonRect(new LatLon(
              Double.parseDouble(llLat), Double.parseDouble(llLon)),
              new LatLon(Double.parseDouble(urLat), Double.parseDouble(urLon)));

          beforeTime = System.currentTimeMillis();
          results = tree.queryByBoundingBox(bbox);
          afterTime = System.currentTimeMillis();
          // get the polygon that approximates the region
          Rectangle2D[] rects = bbox.getJavaRectangles();
          for (int i = 0; i < rects.length; i++) {
            String regionStr = (rects[i].getMinY() - 90) + ","
                + (rects[i].getMinX() - 180) + ",";
            regionStr += (rects[i].getMaxY() - 90) + ","
                + (rects[i].getMinX() - 180) + ",";
View Full Code Here

Examples of ucar.unidata.geoloc.LatLonRect

    // new AddePointDataset("adde://adde.ucar.edu/point?group=rtptsrc&descr=sfchourly&num=all&param=ID");
    String loc = "adde://adde.ucar.edu/point?group=rtptsrc&descr=sfchourly&num=10";
    StringBuffer sbuff = new StringBuffer();
    sbuff.append(loc);
    sbuff.append("&num=all&select='");
    makeSelectBB( sbuff, new LatLonRect( new LatLonPointImpl(10.0, 10.0), new LatLonPointImpl(20.0, 20.0)));
    sbuff.append("'");

    test(sbuff.toString());

    try {
View Full Code Here

Examples of ucar.unidata.geoloc.LatLonRect

    /**
     * _more_
     */
    protected void setBoundingBox() {
        LatLonRect bb;

        if (origin == null) {
            return;
        }

        double dLat = Math.toDegrees(getMaximumRadialDist()
                                     / Earth.getRadius());
        double latRadians = Math.toRadians(origin.getLatitude());
        double dLon       = dLat * Math.cos(latRadians);

        double lat1       = origin.getLatitude() - dLat / 2;
        double lon1       = origin.getLongitude() - dLon / 2;
        bb = new LatLonRect(new LatLonPointImpl(lat1, lon1), dLat, dLon);

        boundingBox = bb;
    }
View Full Code Here

Examples of ucar.unidata.geoloc.LatLonRect

  {
    // <CoverageOfferingBrief>/lonLatEnvelope
    Element lonLatEnvelopeElem = new Element( "lonLatEnvelope", wcsNS );
    lonLatEnvelopeElem.setAttribute( "srsName", "urn:ogc:def:crs:OGC:1.3:CRS84" );

    LatLonRect llbb = gcs.getLatLonBoundingBox();
    LatLonPoint llpt = llbb.getLowerLeftPoint();
    LatLonPoint urpt = llbb.getUpperRightPoint();

    // <CoverageOfferingBrief>/lonLatEnvelope/gml:pos
    String firstPosition = llpt.getLongitude() + " " + llpt.getLatitude();
    double lon = llpt.getLongitude() + llbb.getWidth();
    String secondPosition = lon + " " + urpt.getLatitude();
// ToDo WCS 1.0Plus - Deal with conversion to meters. (Yikes!!)
    CoordinateAxis1D vertAxis = gcs.getVerticalAxis();
    if ( vertAxis != null )
    {
View Full Code Here

Examples of ucar.unidata.geoloc.LatLonRect

      name_strlen = Math.max(name_strlen, station.getName().length());
      desc_strlen = Math.max(desc_strlen, station.getDescription().length());
      if (useWmoId) wmo_strlen = Math.max(wmo_strlen, station.getName().length());
    }

    LatLonRect llbb = getBoundingBox(stnList);
    ncfile.addGlobalAttribute("geospatial_lat_min", Double.toString(llbb.getLowerLeftPoint().getLatitude()));
    ncfile.addGlobalAttribute("geospatial_lat_max", Double.toString(llbb.getUpperRightPoint().getLatitude()));
    ncfile.addGlobalAttribute("geospatial_lon_min", Double.toString(llbb.getLowerLeftPoint().getLongitude()));
    ncfile.addGlobalAttribute("geospatial_lon_max", Double.toString(llbb.getUpperRightPoint().getLongitude()));

    // add the dimensions
    Dimension recordDim = ncfile.addUnlimitedDimension(recordDimName);
    recordDims.add(recordDim);
View Full Code Here

Examples of ucar.unidata.geoloc.LatLonRect

  private LatLonRect getBoundingBox(List stnList) {
    ucar.unidata.geoloc.Station s = (ucar.unidata.geoloc.Station) stnList.get(0);
    LatLonPointImpl llpt = new LatLonPointImpl();
    llpt.set(s.getLatitude(), s.getLongitude());
    LatLonRect rect = new LatLonRect(llpt, .001, .001);

    for (int i = 1; i < stnList.size(); i++) {
      s = (ucar.unidata.geoloc.Station) stnList.get(i);
      llpt.set(s.getLatitude(), s.getLongitude());
      rect.extend(llpt);
    }

    return rect;
  }
View Full Code Here

Examples of ucar.unidata.geoloc.LatLonRect

    return origin;
  }

  // you must set EarthLocation before you call this.
  protected void setBoundingBox() {
    LatLonRect largestBB = null;
    // look through all the coord systems
    for (Object o : csHash.values()) {
      RadialCoordSys sys = (RadialCoordSys) o;
      sys.setOrigin(origin);
      LatLonRect bb = sys.getBoundingBox();
      if (largestBB == null)
        largestBB = bb;
      else
        largestBB.extend(bb);
    }
View Full Code Here

Examples of ucar.unidata.geoloc.LatLonRect

        return null;

      ucar.unidata.geoloc.Station s =  (ucar.unidata.geoloc.Station) stations.get(0);
      LatLonPointImpl llpt = new LatLonPointImpl();
      llpt.set( s.getLatitude(), s.getLongitude());
      rect = new LatLonRect(llpt, .001, .001);
      if (debug) System.out.println("start="+s.getLatitude()+" "+s.getLongitude()+" rect= "+rect.toString2());

      for (int i = 1; i < stations.size(); i++) {
        s =  (ucar.unidata.geoloc.Station) stations.get(i);
        llpt.set( s.getLatitude(), s.getLongitude());
        rect.extend( llpt);
        if (debug) System.out.println("add="+s.getLatitude()+" "+s.getLongitude()+" rect= "+rect.toString2());
      }
    }
    if (rect.crossDateline() && rect.getWidth() > 350.0) { // call it global - less confusing
      double lat_min = rect.getLowerLeftPoint().getLatitude();
      double deltaLat = rect.getUpperLeftPoint().getLatitude() - lat_min;
      rect = new LatLonRect( new LatLonPointImpl(lat_min, -180.0), deltaLat, 360.0);
    }

    return rect;
  }
View Full Code Here

Examples of ucar.unidata.geoloc.LatLonRect

    setEndDate();
    setBoundingBox();
  }

  protected void setBoundingBox() {
    LatLonRect bb;

    if (origin == null)
      return;

    double dLat = Math.toDegrees( getMaximumRadialDist() / Earth.getRadius());
    double latRadians = Math.toRadians( origin.getLatitude());
    double dLon = dLat * Math.cos(latRadians);

    double lat1 = origin.getLatitude() - dLat/2;
    double lon1 = origin.getLongitude() - dLon/2;
    bb = new LatLonRect( new LatLonPointImpl( lat1, lon1), dLat, dLon);

    boundingBox = bb;
  }
View Full Code Here

Examples of ucar.unidata.geoloc.LatLonRect

    Attribute lat_range = ncfile.findGlobalAttribute("lat_range");
    double lat_start = lat_range.getNumericValue(0).doubleValue();
    double lat_end = lat_range.getNumericValue(1).doubleValue();

    boundingBox = new LatLonRect(new LatLonPointImpl(lat_start, lon_start), new LatLonPointImpl(lat_end, lon_end));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.