コード例 #1
0
  /**
   * Parse Lat Lon Bounding Box
   *
   * @param llBox
   * @return Envelope
   * @throws XMLParsingException
   * @throws UnknownCRSException
   */
  protected Envelope parseLatLonBoundingBox(Element llBox)
      throws XMLParsingException, UnknownCRSException {
    LOG.entering();

    double minx = XMLTools.getRequiredNodeAsDouble(llBox, "./@minx", nsContext);
    double maxx = XMLTools.getRequiredNodeAsDouble(llBox, "./@maxx", nsContext);
    double miny = XMLTools.getRequiredNodeAsDouble(llBox, "./@miny", nsContext);
    double maxy = XMLTools.getRequiredNodeAsDouble(llBox, "./@maxy", nsContext);
    /** default crs = EPSG:4326 */
    CoordinateSystem crs = CRSFactory.create("EPSG:4326");
    Envelope env = GeometryFactory.createEnvelope(minx, miny, maxx, maxy, crs);

    LOG.exiting();
    return env;
  }
コード例 #2
0
 /**
  * Parse Layer Bounding Boxes
  *
  * @param nl
  * @return LayerBoundingBox[]
  * @throws XMLParsingException
  */
 protected LayerBoundingBox[] parseLayerBoundingBoxes(List nl) throws XMLParsingException {
   LOG.entering();
   LayerBoundingBox[] llBoxes = new LayerBoundingBox[nl.size()];
   for (int i = 0; i < llBoxes.length; i++) {
     double minx = XMLTools.getRequiredNodeAsDouble((Node) nl.get(i), "./@minx", nsContext);
     double maxx = XMLTools.getRequiredNodeAsDouble((Node) nl.get(i), "./@maxx", nsContext);
     double miny = XMLTools.getRequiredNodeAsDouble((Node) nl.get(i), "./@miny", nsContext);
     double maxy = XMLTools.getRequiredNodeAsDouble((Node) nl.get(i), "./@maxy", nsContext);
     double resx = XMLTools.getNodeAsDouble((Node) nl.get(i), "./@resx", nsContext, -1);
     double resy = XMLTools.getNodeAsDouble((Node) nl.get(i), "./@resx", nsContext, -1);
     String srs = XMLTools.getRequiredNodeAsString((Node) nl.get(i), "./@SRS", nsContext);
     Position min = GeometryFactory.createPosition(minx, miny);
     Position max = GeometryFactory.createPosition(maxx, maxy);
     llBoxes[i] = new LayerBoundingBox(min, max, srs, resx, resy);
   }
   LOG.exiting();
   return llBoxes;
 }